Commit 3d708a5b authored by Edward Hervey's avatar Edward Hervey Committed by Edward Hervey

qtgl: Handle OPENGL header guard changes

In 2018 khronos changed the gl header guards. If we don't detect
this properly we would end up with plenty of symbol redifinition
(since we would be importing twice the "same" header).

Instead detect if the "newer" header was already included and if
so define the "old" define to avoid this situation

Fixes #523
parent 4f7ef56c
...@@ -30,6 +30,21 @@ ...@@ -30,6 +30,21 @@
#include <QtGui/qtgui-config.h> #include <QtGui/qtgui-config.h>
#endif #endif
/* The glext.h guard was renamed in 2018, but some software which
* includes their own copy of the GL headers (such as qt) might have
* older version which use the old guard. This would result in the
* header being included again (and symbols redefined).
*
* To avoid this, we define the "old" guard if the "new" guard is
* defined.*/
#if GST_GL_HAVE_OPENGL
#ifdef __gl_glext_h_
#ifndef __glext_h_
#define __glext_h_ 1
#endif
#endif
#endif
#if defined(QT_OPENGL_ES_2) #if defined(QT_OPENGL_ES_2)
#define GLsync gst_qt_GLsync #define GLsync gst_qt_GLsync
#include <QOpenGLContext> #include <QOpenGLContext>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment