[Piglit] [PATCH 01/12] util: move windows macro redefitions into a single place

Emil Velikov emil.l.velikov at gmail.com
Sat Nov 22 14:40:23 PST 2014


Move the final two windows specific #undef next to their min/max
brothers. Note that they seem to be defined when building with MSVC
(_MSV_VER) rather than all windows platfroms (_WIN32).

Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
---
 tests/general/fog-modes.c        | 5 -----
 tests/spec/ext_fog_coord/modes.c | 5 -----
 tests/util/piglit-util.h         | 4 ++++
 3 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/tests/general/fog-modes.c b/tests/general/fog-modes.c
index 3e396ba..ce604dd 100644
--- a/tests/general/fog-modes.c
+++ b/tests/general/fog-modes.c
@@ -28,11 +28,6 @@
 
 #include "piglit-util-gl.h"
 
-#if defined(_WIN32)
-#undef near
-#undef far
-#endif
-
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
 	config.supports_gl_compat_version = 10;
diff --git a/tests/spec/ext_fog_coord/modes.c b/tests/spec/ext_fog_coord/modes.c
index a316595..4b7ba72 100644
--- a/tests/spec/ext_fog_coord/modes.c
+++ b/tests/spec/ext_fog_coord/modes.c
@@ -28,11 +28,6 @@
 
 #include "piglit-util-gl.h"
 
-#if defined(_WIN32)
-#undef near
-#undef far
-#endif
-
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
 	config.supports_gl_compat_version = 10;
diff --git a/tests/util/piglit-util.h b/tests/util/piglit-util.h
index 84e2066..320dfde 100755
--- a/tests/util/piglit-util.h
+++ b/tests/util/piglit-util.h
@@ -54,6 +54,10 @@ extern "C" {
 #undef max
 #undef min
 
+/* Another two macros provided by windows.h which conflict with piglit */
+#undef near
+#undef far
+
 #if !defined(__cplusplus) && !defined(inline)
 #define inline __inline
 #endif
-- 
2.1.3



More information about the Piglit mailing list