From 2562ca447c4eb45a2bb6a306463ec042e38fca8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 7 Feb 2020 11:56:34 +0100 Subject: [PATCH] GL: fix build on 32-bit Windows. Now that the CI checks this I feel much safer. --- doc/changelog.dox | 2 ++ src/Magnum/GL/Implementation/RendererState.h | 18 ++++++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/doc/changelog.dox b/doc/changelog.dox index c748966dd..4e2ed4ef9 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -229,6 +229,8 @@ See also: - `FindMagnum.cmake` now properly recognizes an optional dependency between @ref DebugTools and @ref Trade on GL-less builds - Various compiler warning fixes (see [mosra/magnum#406](https://github.com/mosra/magnum/pull/406)) +- Added a 32-bit Windows build to the CI matrix to avoid random compilation + issues (see [mosra/magnum#421](https://github.com/mosra/magnum/issues/421)) @subsection changelog-latest-bugfixes Bug fixes diff --git a/src/Magnum/GL/Implementation/RendererState.h b/src/Magnum/GL/Implementation/RendererState.h index 1300d6eca..ef978041c 100644 --- a/src/Magnum/GL/Implementation/RendererState.h +++ b/src/Magnum/GL/Implementation/RendererState.h @@ -43,17 +43,19 @@ struct RendererState { #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void(*minSampleShadingImplementation)(GLfloat); #endif + /* These are direct pointers to the GL functions, so need a __stdcall on + Windows to compile properly on 32 bits */ #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) - void (*patchParameteriImplementation)(GLenum, GLint); + void(APIENTRY *patchParameteriImplementation)(GLenum, GLint); #endif #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) - void(*enableiImplementation)(GLenum, GLuint); - void(*disableiImplementation)(GLenum, GLuint); - void(*blendEquationiImplementation)(GLuint, GLenum); - void(*blendEquationSeparateiImplementation)(GLuint, GLenum, GLenum); - void(*blendFunciImplementation)(GLuint, GLenum, GLenum); - void(*blendFuncSeparateiImplementation)(GLuint, GLenum, GLenum, GLenum, GLenum); - void(*colorMaskiImplementation)(GLuint, GLboolean, GLboolean, GLboolean, GLboolean); + void(APIENTRY *enableiImplementation)(GLenum, GLuint); + void(APIENTRY *disableiImplementation)(GLenum, GLuint); + void(APIENTRY *blendEquationiImplementation)(GLuint, GLenum); + void(APIENTRY *blendEquationSeparateiImplementation)(GLuint, GLenum, GLenum); + void(APIENTRY *blendFunciImplementation)(GLuint, GLenum, GLenum); + void(APIENTRY *blendFuncSeparateiImplementation)(GLuint, GLenum, GLenum, GLenum, GLenum); + void(APIENTRY *colorMaskiImplementation)(GLuint, GLboolean, GLboolean, GLboolean, GLboolean); #endif #ifndef MAGNUM_TARGET_WEBGL Renderer::GraphicsResetStatus(*graphicsResetStatusImplementation)();