diff options
author | Edward Hervey <edward@centricular.com> | 2018-12-17 09:33:39 +0100 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2019-05-16 23:14:44 +0100 |
commit | 5479af133ffe6077aab8a8be8f397f246aacb773 (patch) | |
tree | d6723b1902c765010bd8cd417db57ecb26b77480 | |
parent | 5ae9cbcc7fb327b3bf461d557bc9640e6d3ce67b (diff) | |
download | gstreamer-plugins-good-5479af133ffe6077aab8a8be8f397f246aacb773.tar.gz |
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
-rw-r--r-- | ext/qt/gstqtgl.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/ext/qt/gstqtgl.h b/ext/qt/gstqtgl.h index fd82b27e6..13761aea5 100644 --- a/ext/qt/gstqtgl.h +++ b/ext/qt/gstqtgl.h @@ -30,6 +30,21 @@ #include <QtGui/qtgui-config.h> #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) #define GLsync gst_qt_GLsync #include <QOpenGLContext> |