summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-03-03 13:02:10 +0100
committerwm4 <wm4@nowhere>2013-03-03 15:36:56 +0100
commit979ce46c6403e70bc90348aba260c825e5189b2c (patch)
tree3d8c51cbcac6526369ad12a6cdc06a414a2b6385 /video
parentca893689fefdac74338b41aa21fbc601ae102ff6 (diff)
downloadmpv-979ce46c6403e70bc90348aba260c825e5189b2c.tar.bz2
mpv-979ce46c6403e70bc90348aba260c825e5189b2c.tar.xz
gl_common: get rid of symbol redefinition warnings with recent Mesa
Apparently newer Mesa versions changed their <GL/glx.h> header, and unconditionally define GLX_CONTEXT_MAJOR_VERSION_ARB and others. This clashed with gl_header_fixes.h, a header which quarantines bad hacks to make compilation possible on systems with outdated GL headers. Specifically, our header was included before glx.h, so the hacks were always active, and somehow Mesa's glx.h used to deal with this by not redefining existing identifiers. Fix the gl_header_fixes.h logic so the hacks are checked after including glx.h.
Diffstat (limited to 'video')
-rw-r--r--video/out/gl_common.c4
-rw-r--r--video/out/gl_common.h1
-rw-r--r--video/out/gl_header_fixes.h12
3 files changed, 17 insertions, 0 deletions
diff --git a/video/out/gl_common.c b/video/out/gl_common.c
index 1f7b51de5b..89ed0cbbd3 100644
--- a/video/out/gl_common.c
+++ b/video/out/gl_common.c
@@ -1060,8 +1060,12 @@ static void swapGlBuffers_w32(MPGLContext *ctx)
#ifdef CONFIG_GL_X11
#include <X11/Xlib.h>
#include <GL/glx.h>
+
#include "x11_common.h"
+#define MP_GET_GLX_WORKAROUNDS
+#include "gl_header_fixes.h"
+
struct glx_context {
XVisualInfo *vinfo;
GLXContext context;
diff --git a/video/out/gl_common.h b/video/out/gl_common.h
index 415e31e941..0150e9319c 100644
--- a/video/out/gl_common.h
+++ b/video/out/gl_common.h
@@ -47,6 +47,7 @@
#include <GL/glext.h>
#endif
+#define MP_GET_GL_WORKAROUNDS
#include "video/out/gl_header_fixes.h"
struct GL;
diff --git a/video/out/gl_header_fixes.h b/video/out/gl_header_fixes.h
index 41a3aabcd3..7f859defbf 100644
--- a/video/out/gl_header_fixes.h
+++ b/video/out/gl_header_fixes.h
@@ -21,6 +21,8 @@
* version 2.1 of the License, or (at your option) any later version.
*/
+#ifdef MP_GET_GL_WORKAROUNDS
+
// workaround for some gl.h headers
#ifndef GLAPIENTRY
#ifdef APIENTRY
@@ -244,6 +246,12 @@
#endif
#endif
+#undef MP_GET_GL_WORKAROUNDS
+
+#endif
+
+#ifdef MP_GET_GLX_WORKAROUNDS
+
// FreeBSD 10.0-CURRENT lacks the GLX_ARB_create_context extension completely
#ifndef GLX_CONTEXT_MAJOR_VERSION_ARB
#define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091
@@ -258,3 +266,7 @@
#define GLX_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001
#define GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002
#endif
+
+#undef MP_GET_GLX_WORKAROUNDS
+
+#endif