]> git.tdb.fi Git - libs/gl.git/commitdiff
Hide windows.h from public headers
authorMikko Rasa <tdb@tdb.fi>
Wed, 18 Sep 2019 15:10:21 +0000 (18:10 +0300)
committerMikko Rasa <tdb@tdb.fi>
Wed, 18 Sep 2019 15:10:21 +0000 (18:10 +0300)
OpenGL headers require a few #defines, so do those manually instead.

source/extension.cpp
source/gl.h

index a095986123dd535d192881c2870649ae8e936e43..21fab9a290161b55cb46d234bb5cb43ffa742a08 100644 (file)
@@ -2,7 +2,9 @@
 #include <cstdlib>
 #if defined(__ANDROID__)
 #include <EGL/egl.h>
-#elif !defined(_WIN32) && !defined(__APPLE__)
+#elif defined(_WIN32)
+#include <windows.h>
+#elif !defined(__APPLE__)
 #define GLX_GLXEXT_PROTOTYPES
 #include <GL/glx.h>
 #endif
index 9a7cb9cd88a338aaf44582dac1a2b65fbdda969d..69b9b130adb8f537d93a1ed32c5a7655974dcec3 100644 (file)
 typedef double GLdouble;
 typedef long long GLint64;
 #else
-#ifdef WIN32
-#include <windows.h>
+#ifdef _WIN32
+#ifndef WINAPI
+#if defined(_ARM_)
+#define WINAPI
+#else
+#define WINAPI __stdcall
+#endif
+#endif
+#ifndef APIENTRY
+#define APIENTRY WINAPI
+#endif
+#ifndef DECLSPEC_IMPORT
+#define DECLSPEC_IMPORT __declspec(dllimport)
+#endif
+#ifndef WINGDIAPI
+#define WINGDIAPI DECLSPEC_IMPORT
+#endif
 #endif
 #include <GL/gl.h>
 #include <GL/glext.h>