[Piglit] [PATCH 3/9] piglit-dispatch: Prevent re-definition of APIENTRY.

jfonseca at vmware.com jfonseca at vmware.com
Tue Apr 29 10:57:48 PDT 2014


From: José Fonseca <jfonseca at vmware.com>

---
 tests/util/piglit-dispatch.h | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/tests/util/piglit-dispatch.h b/tests/util/piglit-dispatch.h
index 669aecc..c24c186 100644
--- a/tests/util/piglit-dispatch.h
+++ b/tests/util/piglit-dispatch.h
@@ -56,21 +56,15 @@
 #include <stdint.h>
 #include <stddef.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 #ifndef _WIN32
 
 /* APIENTRY and GLAPIENTRY are not used on Linux or Mac. */
 #define APIENTRY
 #define GLAPIENTRY
 
-#else
+#else /* _WIN32 */
 
-#ifndef APIENTRY
-#define APIENTRY __stdcall
-#endif
+#include <windows.h> // APIENTRY
 
 #ifndef GLAPIENTRY
 #define GLAPIENTRY APIENTRY
@@ -80,6 +74,10 @@ extern "C" {
 #define GLAPI extern
 #endif
 
+#endif /* _WIN32 */
+
+#ifdef __cplusplus
+extern "C" {
 #endif
 
 typedef unsigned int GLenum;
-- 
1.9.1



More information about the Piglit mailing list