[mutter] renderer-native-gles3: Add cpp error if gl.h was included



commit 626621a53a691ebc41c41d4e3ad8ff02476521b9
Author: Jonas Ådahl <jadahl gmail com>
Date:   Mon Oct 30 16:08:46 2017 +0800

    renderer-native-gles3: Add cpp error if gl.h was included
    
    On some architectures, including both GLES3/gl3.h GL/gl.h will cause
    compilation issues due to incompatible type definitions. To avoid
    running into that issue while building on other architectures, make
    sure we haven't included GL/gl.h by accident.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=788695

 src/backends/native/meta-renderer-native-gles3.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/backends/native/meta-renderer-native-gles3.c 
b/src/backends/native/meta-renderer-native-gles3.c
index 2aaae76..0914dfe 100644
--- a/src/backends/native/meta-renderer-native-gles3.c
+++ b/src/backends/native/meta-renderer-native-gles3.c
@@ -34,6 +34,14 @@
 #include "backends/meta-gles3.h"
 #include "backends/meta-gles3-table.h"
 
+/*
+ * GL/gl.h being included may conflit with gl3.h on some architectures.
+ * Make sure that hasn't happened on any architecture.
+ */
+#ifdef GL_VERSION_1_1
+#error "Somehow included OpenGL headers when we shouldn't have"
+#endif
+
 static EGLImageKHR
 create_egl_image (MetaEgl       *egl,
                   EGLDisplay     egl_display,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]