diff options
author | Liang Qi <liang.qi@qt.io> | 2016-11-16 12:26:36 +0000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2016-11-16 13:54:01 +0000 |
commit | b39adf8945616dfc02df7177dccef6b051a1903b (patch) | |
tree | 21a91178abc484b8cf191eec461f80678a107b33 /src/gui/opengl/qopengl.h | |
parent | 38e935701c0faeb19b9b1493dc2d6d60c6bc3ca3 (diff) | |
parent | 90c425642dfeae4564b43dacf15f80479962e910 (diff) |
Merge "Merge remote-tracking branch 'origin/5.7' into 5.8" into refs/staging/5.8
Diffstat (limited to 'src/gui/opengl/qopengl.h')
-rw-r--r-- | src/gui/opengl/qopengl.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/gui/opengl/qopengl.h b/src/gui/opengl/qopengl.h index c7a3e79666..cd44ddfe4d 100644 --- a/src/gui/opengl/qopengl.h +++ b/src/gui/opengl/qopengl.h @@ -95,8 +95,11 @@ typedef void* GLeglImageOES; // applications cannot target ES 3. Therefore QOpenGLFunctions and // friends do everything dynamically and never rely on these macros. +// Some Khronos headers use the ext proto guard in the standard headers as well, +// which is bad. Work it around, but avoid spilling over to the ext header. # ifndef GL_GLEXT_PROTOTYPES # define GL_GLEXT_PROTOTYPES +# define QGL_TEMP_GLEXT_PROTO # endif # if defined(QT_OPENGL_ES_3_1) @@ -107,6 +110,11 @@ typedef void* GLeglImageOES; # include <GLES2/gl2.h> #endif +# ifdef QGL_TEMP_GLEXT_PROTO +# undef GL_GLEXT_PROTOTYPES +# undef QGL_TEMP_GLEXT_PROTO +# endif + /* Some GLES2 implementations (like the one on Harmattan) are missing the typedef for GLchar. Work around it here by adding it. The Kkronos headers @@ -125,7 +133,15 @@ typedef char GLchar; # include <OpenGL/glext.h> # else # define GL_GLEXT_LEGACY // Prevents GL/gl.h from #including system glext.h -# include <GL/gl.h> +// Some Khronos headers use the ext proto guard in the standard headers as well, +// which is bad. Work it around, but avoid spilling over to the ext header. +# ifndef GL_GLEXT_PROTOTYPES +# define GL_GLEXT_PROTOTYPES +# include <GL/gl.h> +# undef GL_GLEXT_PROTOTYPES +# else +# include <GL/gl.h> +# endif # include <QtGui/qopenglext.h> # endif // Q_OS_MAC #endif // QT_OPENGL_ES_2 |