OpenGL headers require a few #defines, so do those manually instead.
#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
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>