[Bf-blender-cvs] [b59b8124001] master: MSVC: resolve near/far issue take2
Campbell Barton
noreply at git.blender.org
Wed May 9 11:24:34 CEST 2018
Commit: b59b8124001182a40bf4aa271591d589b2d46cfa
Author: Campbell Barton
Date: Wed May 9 11:20:12 2018 +0200
Branches: master
https://developer.blender.org/rBb59b8124001182a40bf4aa271591d589b2d46cfa
MSVC: resolve near/far issue take2
Previous fix failed w/ compositor,
tested on MSVC2015, full build.
===================================================================
M source/blender/makesdna/DNA_view3d_types.h
M source/blender/windowmanager/intern/wm_init_exit.c
===================================================================
diff --git a/source/blender/makesdna/DNA_view3d_types.h b/source/blender/makesdna/DNA_view3d_types.h
index 5169657206c..6f3cf4e2bec 100644
--- a/source/blender/makesdna/DNA_view3d_types.h
+++ b/source/blender/makesdna/DNA_view3d_types.h
@@ -54,9 +54,13 @@ struct GPUFX;
/* ******************************** */
-/* The near/far thing is a Win EXCEPTION. Thus, leave near/far in the
- * code, and patch for windows. */
-
+/* The near/far thing is a Win EXCEPTION, caused by indirect includes from <windows.h>.
+ * Thus, leave near/far in the code, and undef for windows. */
+#ifdef _WIN32
+# undef near
+# undef far
+#endif
+
/* Background Picture in 3D-View */
typedef struct BGpic {
struct BGpic *next, *prev;
diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c
index 912809c7ab9..f05d8b0a90e 100644
--- a/source/blender/windowmanager/intern/wm_init_exit.c
+++ b/source/blender/windowmanager/intern/wm_init_exit.c
@@ -34,10 +34,8 @@
#include <stdio.h>
#include <string.h>
-#ifdef WIN32
+#ifdef _WIN32
# include <windows.h>
-# undef near
-# undef far
#endif
#include "MEM_guardedalloc.h"
More information about the Bf-blender-cvs
mailing list