-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
qt6-base: fix inclusion of OpenGL header after Qt6 header
- Loading branch information
Showing
2 changed files
with
49 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
Avoid issue for projects that include <GL/glu.h> after <QOpenGLContext> | ||
on Windows. | ||
|
||
diff -urN qtbase-everywhere-src-6.7.0/src/gui/opengl/qopengl.h.orig qtbase-everywhere-src-6.7.0/src/gui/opengl/qopengl.h | ||
+++ qtbase-everywhere-src-6.7.0/src/gui/opengl/qopengl.h 2024-04-22 19:00:32.146776300 +0200 | ||
@@ -11,15 +11,21 @@ | ||
// On Windows we need to ensure that APIENTRY and WINGDIAPI are defined before | ||
// we can include gl.h. But we do not want to include <windows.h> in this public | ||
// Qt header, as it pollutes the global namespace with macros. | ||
+// We also need to make sure that CALLBACK and GLAPI are defined (and all of | ||
+// these keep being defined) in case <GL/glu.h> is included after this header. | ||
#if defined(Q_OS_WIN) | ||
# ifndef APIENTRY | ||
# define APIENTRY __stdcall | ||
-# define Q_UNDEF_APIENTRY | ||
# endif // APIENTRY | ||
# ifndef WINGDIAPI | ||
# define WINGDIAPI __declspec(dllimport) | ||
-# define Q_UNDEF_WINGDIAPI | ||
# endif // WINGDIAPI | ||
+# ifndef CALLBACK | ||
+# define CALLBACK APIENTRY | ||
+# endif // CALLBACK | ||
+# ifndef GLAPI | ||
+# define GLAPI extern | ||
+# endif // GLAPI | ||
# define QT_APIENTRY __stdcall | ||
#endif | ||
|
||
@@ -281,15 +287,6 @@ | ||
|
||
QT_END_NAMESPACE | ||
|
||
-#ifdef Q_UNDEF_WINGDIAPI | ||
-# undef WINGDIAPI | ||
-# undef Q_UNDEF_WINGDIAPI | ||
-#endif | ||
-#ifdef Q_UNDEF_APIENTRY | ||
-# undef APIENTRY | ||
-# undef Q_UNDEF_APIENTRY | ||
-#endif | ||
- | ||
#endif // QT_NO_OPENGL | ||
|
||
#endif // QOPENGL_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters