gl: Allow using non-system mesa with both GL and GLES
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Wed, 16 Dec 2015 00:25:16 +0000 (19:25 -0500)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 9 Dec 2017 19:32:12 +0000 (19:32 +0000)
GCC automatically disable redundance warnings for system headers. As
soon as we start using a non-system installed mesa, we would start
having issues. The test for both wasn't setting any flags, so it would
work but then fail at runtime.

This is being fixed by disabling in the code (where needed only) that
GCC warning. The test is also fixed to avoid the false positive we had.

gst-libs/gst/gl/gstglapi.h

index dd44b45239fce763c5d3d7e9c6edbd1c3034815d..ab1a203f52d2fed294189ca2efe1b3d04d452c8b 100644 (file)
 
 #include <gst/gl/gstglconfig.h>
 
+/* This mimic GCC behaviour with system headers files even if GL headers may
+ * not be in the system header path. */
+#ifdef __GNUC__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wredundant-decls"
+#endif
+
 /* OpenGL 2.0 for Embedded Systems */
 #if GST_GL_HAVE_GLES2
 #ifndef GL_GLEXT_PROTOTYPES
 # endif
 #endif
 
+#ifdef __GNUC__
+#pragma GCC diagnostic pop
+#endif
+
 #ifdef WINAPI
 #define GSTGLAPI WINAPI
 #else