summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2011-03-13 22:19:40 +0000
committerJosé Fonseca <jfonseca@vmware.com>2011-03-13 22:19:40 +0000
commit0f0543fd1b27cc07c3bb06d47763e3e1007adc3c (patch)
treeed7949a18a070de0ed1f7c6f4e5d1ccfe07ad338
parenta46710f39f55cc81905caf1b48803f66a2d8eb97 (diff)
Portability build fixes for MinGW.
-rw-r--r--CMakeLists.txt5
-rw-r--r--src/piglit/gl_wrap.h4
-rw-r--r--src/piglit/glut_wrap.h4
-rw-r--r--tests/general/fog-modes.c2
-rw-r--r--tests/glean/CMakeLists.gl.txt2
-rw-r--r--tests/shaders/glsl-fs-pointcoord.c4
-rw-r--r--tests/spec/ext_fog_coord/modes.c2
-rw-r--r--tests/util/piglit-util-gl.c2
-rw-r--r--tests/util/piglit-util-gles2.c2
-rw-r--r--tests/util/piglit-util.c2
-rw-r--r--tests/util/piglit-util.h4
11 files changed, 26 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e4336233c..df1ee9c11 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -18,6 +18,11 @@ IF (C_COMPILER_FLAG_WALL)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
ENDIF (C_COMPILER_FLAG_WALL)
+if (WIN32)
+ # MSVC & MinGW only define & use APIENTRY
+ add_definitions (-DGLAPIENTRY=__stdcall)
+endif (WIN32)
+
if (APPLE)
find_path(GLEXT_INCLUDE_DIR
NAMES OpenGL/glext.h
diff --git a/src/piglit/gl_wrap.h b/src/piglit/gl_wrap.h
index cf68c737f..872f768b6 100644
--- a/src/piglit/gl_wrap.h
+++ b/src/piglit/gl_wrap.h
@@ -38,6 +38,10 @@
extern "C" {
#endif
+#ifdef WIN32
+#include <windows.h>
+#endif
+
#ifdef USE_OPENGL
# include "glew.h"
/* Include the real headers too, in case GLEW misses something. */
diff --git a/src/piglit/glut_wrap.h b/src/piglit/glut_wrap.h
index e03af04dc..245b6d055 100644
--- a/src/piglit/glut_wrap.h
+++ b/src/piglit/glut_wrap.h
@@ -38,6 +38,10 @@
extern "C" {
#endif
+#ifdef WIN32
+#include <windows.h>
+#endif
+
#ifdef USE_GLUT
# ifdef __APPLE__
# include <GLUT/glut.h>
diff --git a/tests/general/fog-modes.c b/tests/general/fog-modes.c
index cd28f795d..e0a85ff0a 100644
--- a/tests/general/fog-modes.c
+++ b/tests/general/fog-modes.c
@@ -29,7 +29,7 @@
#include "piglit-util.h"
#include "piglit-framework.h"
-#if defined(_MSC_VER)
+#if defined(WIN32)
#undef near
#undef far
#endif
diff --git a/tests/glean/CMakeLists.gl.txt b/tests/glean/CMakeLists.gl.txt
index 82648658a..df9041627 100644
--- a/tests/glean/CMakeLists.gl.txt
+++ b/tests/glean/CMakeLists.gl.txt
@@ -1,4 +1,4 @@
-if (MSVC)
+if (WIN32)
add_definitions ( -D__WIN__ -D__MS__ )
ELSEIF (APPLE)
add_definitions ( -D__AGL__ -D__UNIX__ )
diff --git a/tests/shaders/glsl-fs-pointcoord.c b/tests/shaders/glsl-fs-pointcoord.c
index 87e36b947..439c17b9d 100644
--- a/tests/shaders/glsl-fs-pointcoord.c
+++ b/tests/shaders/glsl-fs-pointcoord.c
@@ -31,6 +31,10 @@
* with point sprites enabled.
*/
+#if defined(WIN32)
+#include <windows.h>
+#endif
+
#include <assert.h>
#include <string.h>
#include <stdio.h>
diff --git a/tests/spec/ext_fog_coord/modes.c b/tests/spec/ext_fog_coord/modes.c
index 777d56478..0c4daf688 100644
--- a/tests/spec/ext_fog_coord/modes.c
+++ b/tests/spec/ext_fog_coord/modes.c
@@ -29,7 +29,7 @@
#include "piglit-util.h"
#include "piglit-framework.h"
-#if defined(_MSC_VER)
+#if defined(WIN32)
#undef near
#undef far
#endif
diff --git a/tests/util/piglit-util-gl.c b/tests/util/piglit-util-gl.c
index d18dd1196..7d7d50d00 100644
--- a/tests/util/piglit-util-gl.c
+++ b/tests/util/piglit-util-gl.c
@@ -21,7 +21,7 @@
* USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#if defined(_MSC_VER)
+#if defined(WIN32)
#include <windows.h>
#endif
diff --git a/tests/util/piglit-util-gles2.c b/tests/util/piglit-util-gles2.c
index 97ac871d4..4553233f2 100644
--- a/tests/util/piglit-util-gles2.c
+++ b/tests/util/piglit-util-gles2.c
@@ -21,7 +21,7 @@
* USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#if defined(_MSC_VER)
+#if defined(WIN32)
#include <windows.h>
#endif
diff --git a/tests/util/piglit-util.c b/tests/util/piglit-util.c
index dedfdaa85..d46994acf 100644
--- a/tests/util/piglit-util.c
+++ b/tests/util/piglit-util.c
@@ -21,7 +21,7 @@
* USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#if defined(_MSC_VER)
+#if defined(WIN32)
#include <windows.h>
#endif
diff --git a/tests/util/piglit-util.h b/tests/util/piglit-util.h
index 0b9b42dc1..a73f4530c 100644
--- a/tests/util/piglit-util.h
+++ b/tests/util/piglit-util.h
@@ -25,9 +25,11 @@
#include "config.h"
-#if defined(_MSC_VER)
+#if defined(WIN32)
#include <windows.h>
+#endif
+#if defined(_MSC_VER)
typedef __int32 int32_t;
typedef __int64 int64_t;
typedef unsigned __int8 uint8_t;