[Bf-blender-cvs] [1a502097c7c] master: Cleanup: Fix build warnings on windows.
Ray Molenkamp
noreply at git.blender.org
Wed Mar 18 18:24:02 CET 2020
Commit: 1a502097c7c73bdb8afbca498102e971fb120575
Author: Ray Molenkamp
Date: Wed Mar 18 11:23:56 2020 -0600
Branches: master
https://developer.blender.org/rB1a502097c7c73bdb8afbca498102e971fb120575
Cleanup: Fix build warnings on windows.
Two headers define the _USE_MATH_DEFINES symbol now, if both
are included warnings are generated.
Added some guards, all good again.
===================================================================
M source/blender/blenlib/BLI_math_base.h
M source/blender/blenlib/BLI_winstuff.h
===================================================================
diff --git a/source/blender/blenlib/BLI_math_base.h b/source/blender/blenlib/BLI_math_base.h
index 7555d3d7daf..ef76958f269 100644
--- a/source/blender/blenlib/BLI_math_base.h
+++ b/source/blender/blenlib/BLI_math_base.h
@@ -27,7 +27,7 @@
* \ingroup bli
*/
-#ifdef _MSC_VER
+#if defined(_MSC_VER) && !defined(_USE_MATH_DEFINES)
# define _USE_MATH_DEFINES
#endif
diff --git a/source/blender/blenlib/BLI_winstuff.h b/source/blender/blenlib/BLI_winstuff.h
index 4666151f84a..eddb69e84ec 100644
--- a/source/blender/blenlib/BLI_winstuff.h
+++ b/source/blender/blenlib/BLI_winstuff.h
@@ -52,7 +52,10 @@
extern "C" {
#endif
-#define _USE_MATH_DEFINES
+#if !defined(_USE_MATH_DEFINES)
+# define _USE_MATH_DEFINES
+#endif
+
#define MAXPATHLEN MAX_PATH
#ifndef S_ISREG
More information about the Bf-blender-cvs
mailing list