diff --git a/src/Magnum/Platform/Implementation/OpenGLFunctionLoader.cpp b/src/Magnum/Platform/Implementation/OpenGLFunctionLoader.cpp index b5bd91890..fb051ad37 100644 --- a/src/Magnum/Platform/Implementation/OpenGLFunctionLoader.cpp +++ b/src/Magnum/Platform/Implementation/OpenGLFunctionLoader.cpp @@ -41,6 +41,10 @@ #pragma warning(disable: 4055) #pragma warning(disable: 4054) #endif +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif +#include /* GLX-specific includes */ #elif defined(CORRADE_TARGET_UNIX) && defined(MAGNUM_PLATFORM_USE_GLX) @@ -93,9 +97,9 @@ auto OpenGLFunctionLoader::load(const char* const name) -> FunctionPointer { const PROC address = wglGetProcAddress(reinterpret_cast(name)); const auto integerAddress = reinterpret_cast(address); if(address && integerAddress != 1 && integerAddress != 2 && - integerAddress != 3 && integerAddress != -1) return address; + integerAddress != 3 && integerAddress != -1) return reinterpret_cast(address); - return GetProcAddress(library, reinterpret_cast(name)); + return reinterpret_cast(GetProcAddress(library, reinterpret_cast(name))); } /* GLX-specific implementation */ diff --git a/src/Magnum/Platform/Implementation/OpenGLFunctionLoader.h b/src/Magnum/Platform/Implementation/OpenGLFunctionLoader.h index 13d6bb5ee..0d9173c80 100644 --- a/src/Magnum/Platform/Implementation/OpenGLFunctionLoader.h +++ b/src/Magnum/Platform/Implementation/OpenGLFunctionLoader.h @@ -28,19 +28,16 @@ #include "Magnum/Magnum.h" #if defined(CORRADE_TARGET_WINDOWS) && !defined(MAGNUM_PLATFORM_USE_EGL) -#define WIN32_LEAN_AND_MEAN 1 -#include +/* I didn't find a better way to circumvent the need for including windows.h */ +struct HINSTANCE__; +typedef struct HINSTANCE__* HMODULE; #endif namespace Magnum { namespace Platform { namespace Implementation { class OpenGLFunctionLoader { public: - #if !defined(CORRADE_TARGET_WINDOWS) || defined(MAGNUM_PLATFORM_USE_EGL) using FunctionPointer = void(*)(); - #else - using FunctionPointer = PROC; - #endif explicit OpenGLFunctionLoader(); ~OpenGLFunctionLoader();