From 2eefdcde4c641aa6d80050d09ffb561c5d883346 Mon Sep 17 00:00:00 2001 From: Daljit Singh Date: Wed, 22 May 2024 13:13:49 +0100 Subject: [PATCH 1/2] Add missing windows.h include header Including gl_core_3_3.h should automatically include windows.h if APIENTRY is not defined, but some libraries (e.g. latest versions of Qt) define this macro without including windows.h in their public headers (to avoid polluting the global namespace). An explicit include is added to deal with this. --- src/gui/opengl/gl_core_3_3.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/opengl/gl_core_3_3.cpp b/src/gui/opengl/gl_core_3_3.cpp index 5514142d3d..2fa8767f66 100644 --- a/src/gui/opengl/gl_core_3_3.cpp +++ b/src/gui/opengl/gl_core_3_3.cpp @@ -14,6 +14,10 @@ * For more details, see http://www.mrtrix.org/. */ +#if defined(_WIN32) +#include +#endif + #include "gui/opengl/gl_core_3_3.h" #include #include From 961eeb2edb9894451e717ddbd793fdccd1b86b4f Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Thu, 23 May 2024 10:46:50 +1000 Subject: [PATCH 2/2] OpenGL: Minimise what is imported by windows.h --- src/gui/opengl/gl_core_3_3.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gui/opengl/gl_core_3_3.cpp b/src/gui/opengl/gl_core_3_3.cpp index 2fa8767f66..884d7e702b 100644 --- a/src/gui/opengl/gl_core_3_3.cpp +++ b/src/gui/opengl/gl_core_3_3.cpp @@ -15,6 +15,13 @@ */ #if defined(_WIN32) +#define WIN32_LEAN_AND_MEAN +#define NOSERVICE +#define NOMCX +#define NOIME +#ifndef NOMINMAX +#define NOMINMAX +#endif #include #endif