[Piglit] [PATCH 1/4] Move more MSVC workarounds to piglit-util.h

Eric Anholt eric at anholt.net
Wed Mar 14 13:58:59 PDT 2012


---
 tests/spec/gl-2.1/minmax.c |    7 -------
 tests/spec/gl-3.0/minmax.c |    7 -------
 tests/util/piglit-util.h   |    1 +
 3 files changed, 1 insertions(+), 14 deletions(-)

diff --git a/tests/spec/gl-2.1/minmax.c b/tests/spec/gl-2.1/minmax.c
index 2ce7e1e..f94f34d 100644
--- a/tests/spec/gl-2.1/minmax.c
+++ b/tests/spec/gl-2.1/minmax.c
@@ -93,13 +93,6 @@ size_range_test(GLenum token, const char *name)
 	}
 }
 
-#if defined(_MSC_VER)
-static double log2(double x)
-{
-	return log(x) / log(2);
-}
-#endif
-
 static void
 test_oq_bits()
 {
diff --git a/tests/spec/gl-3.0/minmax.c b/tests/spec/gl-3.0/minmax.c
index d81ddc7..217d61f 100644
--- a/tests/spec/gl-3.0/minmax.c
+++ b/tests/spec/gl-3.0/minmax.c
@@ -109,13 +109,6 @@ size_range_test(GLenum token, const char *name)
 	}
 }
 
-#if defined(_MSC_VER)
-static double log2(double x)
-{
-	return log(x) / log(2);
-}
-#endif
-
 static void
 test_oq_bits()
 {
diff --git a/tests/util/piglit-util.h b/tests/util/piglit-util.h
index bb17c2f..ea35e64 100755
--- a/tests/util/piglit-util.h
+++ b/tests/util/piglit-util.h
@@ -45,6 +45,7 @@ typedef unsigned __int64 uint64_t;
 #define bool BOOL
 #define true 1
 #define false 0
+#define log2(x) (log(x) / log(2))
 #else
 #include <stdint.h>
 #include <stdbool.h>
-- 
1.7.9.1



More information about the Piglit mailing list