[Bf-blender-cvs] [a288644] master: Code Cleanup: WIN32 defines, check for _MSC_VER instead of !FREE_WINDOWS

Campbell Barton noreply at git.blender.org
Fri Jan 3 10:47:08 CET 2014


Commit: a288644b1eaef1017d21368bd04c3ee1f038ff4c
Author: Campbell Barton
Date:   Fri Jan 3 20:46:12 2014 +1100
https://developer.blender.org/rBa288644b1eaef1017d21368bd04c3ee1f038ff4c

Code Cleanup: WIN32 defines, check for _MSC_VER instead of !FREE_WINDOWS

===================================================================

M	intern/cycles/util/util_math.h
M	intern/iksolver/intern/TNT/tntmath.h
M	intern/smoke/intern/tnt/tnt_math_utils.h
M	source/blender/blenlib/BLI_math_base.h

===================================================================

diff --git a/intern/cycles/util/util_math.h b/intern/cycles/util/util_math.h
index fdee1e9..f35129c 100644
--- a/intern/cycles/util/util_math.h
+++ b/intern/cycles/util/util_math.h
@@ -78,11 +78,11 @@ CCL_NAMESPACE_BEGIN
 
 #ifndef __KERNEL_GPU__
 
-#if (!defined(FREE_WINDOWS)) && (_MSC_VER < 1800)
-#define copysignf(x, y) ((float)_copysign(x, y))
-#define hypotf(x, y) _hypotf(x, y)
-#define isnan(x) _isnan(x)
-#define isfinite(x) _finite(x)
+#if defined(_MSC_VER) && (_MSC_VER < 1800)
+#  define copysignf(x, y) ((float)_copysign(x, y))
+#  define hypotf(x, y) _hypotf(x, y)
+#  define isnan(x) _isnan(x)
+#  define isfinite(x) _finite(x)
 #endif
 
 #endif
diff --git a/intern/iksolver/intern/TNT/tntmath.h b/intern/iksolver/intern/TNT/tntmath.h
index d55acb0..be72796 100644
--- a/intern/iksolver/intern/TNT/tntmath.h
+++ b/intern/iksolver/intern/TNT/tntmath.h
@@ -34,7 +34,7 @@
 
 // conventional functions required by several matrix algorithms
 
-#if (defined _WIN32) && (_MSC_VER < 1800)
+#if defined(_MSC_VER) && (_MSC_VER < 1800)
 #define hypot _hypot
 #endif
 
diff --git a/intern/smoke/intern/tnt/tnt_math_utils.h b/intern/smoke/intern/tnt/tnt_math_utils.h
index d96a0ae..9226bc4 100644
--- a/intern/smoke/intern/tnt/tnt_math_utils.h
+++ b/intern/smoke/intern/tnt/tnt_math_utils.h
@@ -7,7 +7,7 @@
 /* needed for fabs, sqrt() below */
 #include <cmath>
 
-#if (defined _WIN32) && (_MSC_VER < 1800)
+#if defined(_MSC_VER) && (_MSC_VER < 1800)
 #define hypot _hypot
 #endif
 
diff --git a/source/blender/blenlib/BLI_math_base.h b/source/blender/blenlib/BLI_math_base.h
index f218554..c634c9d 100644
--- a/source/blender/blenlib/BLI_math_base.h
+++ b/source/blender/blenlib/BLI_math_base.h
@@ -146,14 +146,14 @@ static const int NAN_INT = 0x7FC00000;
 #endif  /* C99 or POSIX.1-2001 */
 
 #ifdef WIN32
-#  ifndef FREE_WINDOWS
-#    if (!defined isnan) && (_MSC_VER < 1800)
-#		define isnan(n) _isnan(n)
-#	 endif
-#    define finite _finite
-#    if (!defined hypot) && (_MSC_VER < 1800)
-#		define hypot(a, b) _hypot(a, b)
-#	endif
+#  if defined(_MSC_VER)
+#    if (_MSC_VER < 1800) && !defined(isnan)
+#      define isnan(n) _isnan(n)
+#    endif
+#    define finite(n) _finite(n)
+#    if (_MSC_VER < 1800) && !defined(hypot)
+#      define hypot(a, b) _hypot(a, b)
+#    endif
 #  endif
 #endif




More information about the Bf-blender-cvs mailing list