From f5e983962703b5cb39278048b1c35e712b2b2263 Mon Sep 17 00:00:00 2001
From: Nat Goodspeed <nat@lindenlab.com>
Date: Wed, 16 Nov 2016 15:39:00 -0500
Subject: [PATCH] DRTVWR-418: Replace preprocessor tests for Windows-specific
 _M_AMD64 with tests on ADDRESS_SIZE, which is now set on the compiler command
 line.

---
 indra/llcommon/llpreprocessor.h | 2 +-
 indra/llmath/llmath.h           | 4 ++--
 indra/llmath/llsimdmath.h       | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/indra/llcommon/llpreprocessor.h b/indra/llcommon/llpreprocessor.h
index 7c277c2bed9..3698d9db442 100644
--- a/indra/llcommon/llpreprocessor.h
+++ b/indra/llcommon/llpreprocessor.h
@@ -139,7 +139,7 @@
 #pragma warning (disable : 4180)	// qualifier applied to function type has no meaning; ignored
 //#pragma warning( disable : 4284 )	// silly MS warning deep inside their <map> include file
 
-#ifdef _M_AMD64
+#if ADDRESS_SIZE == 64
 // That one is all over the place for x64 builds.
 #pragma warning( disable : 4267 )   // 'var' : conversion from 'size_t' to 'type', possible loss of data)
 #endif
diff --git a/indra/llmath/llmath.h b/indra/llmath/llmath.h
index b66a3c63d68..92a48df53c7 100644
--- a/indra/llmath/llmath.h
+++ b/indra/llmath/llmath.h
@@ -153,7 +153,7 @@ inline F64 llabs(const F64 a)
 
 inline S32 lltrunc( F32 f )
 {
-#if LL_WINDOWS && !defined( __INTEL_COMPILER ) && !defined( _M_AMD64 )
+#if LL_WINDOWS && !defined( __INTEL_COMPILER ) && (ADDRESS_SIZE == 32)
 		// Avoids changing the floating point control word.
 		// Add or subtract 0.5 - epsilon and then round
 		const static U32 zpfp[] = { 0xBEFFFFFF, 0x3EFFFFFF };
@@ -179,7 +179,7 @@ inline S32 lltrunc( F64 f )
 
 inline S32 llfloor( F32 f )
 {
-#if LL_WINDOWS && !defined( __INTEL_COMPILER ) && !defined( _M_AMD64 )
+#if LL_WINDOWS && !defined( __INTEL_COMPILER ) && (ADDRESS_SIZE == 32)
 		// Avoids changing the floating point control word.
 		// Accurate (unlike Stereopsis version) for all values between S32_MIN and S32_MAX and slightly faster than Stereopsis version.
 		// Add -(0.5 - epsilon) and then round
diff --git a/indra/llmath/llsimdmath.h b/indra/llmath/llsimdmath.h
index 9f078ec1ef3..54a275633f5 100644
--- a/indra/llmath/llsimdmath.h
+++ b/indra/llmath/llsimdmath.h
@@ -31,7 +31,7 @@
 #error "Please include llmath.h before this file."
 #endif
 
-#if ( ( LL_DARWIN || LL_LINUX ) && !(__SSE2__) ) || ( LL_WINDOWS && ( _M_IX86_FP < 2 && !_M_AMD64 ) )
+#if ( ( LL_DARWIN || LL_LINUX ) && !(__SSE2__) ) || ( LL_WINDOWS && ( _M_IX86_FP < 2 && ADDRESS_SIZE == 32 ) )
 #error SSE2 not enabled. LLVector4a and related class will not compile.
 #endif
 
-- 
GitLab