From 57d4f63b65aa8801f11e860ad18c9b9054134104 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Wed, 18 Sep 2019 18:10:21 +0300 Subject: [PATCH] Hide windows.h from public headers OpenGL headers require a few #defines, so do those manually instead. --- source/extension.cpp | 4 +++- source/gl.h | 19 +++++++++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/source/extension.cpp b/source/extension.cpp index a0959861..21fab9a2 100644 --- a/source/extension.cpp +++ b/source/extension.cpp @@ -2,7 +2,9 @@ #include #if defined(__ANDROID__) #include -#elif !defined(_WIN32) && !defined(__APPLE__) +#elif defined(_WIN32) +#include +#elif !defined(__APPLE__) #define GLX_GLXEXT_PROTOTYPES #include #endif diff --git a/source/gl.h b/source/gl.h index 9a7cb9cd..69b9b130 100644 --- a/source/gl.h +++ b/source/gl.h @@ -15,8 +15,23 @@ typedef double GLdouble; typedef long long GLint64; #else -#ifdef WIN32 -#include +#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 #include -- 2.45.2