From 626621a53a691ebc41c41d4e3ad8ff02476521b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Mon, 30 Oct 2017 16:08:46 +0800 Subject: [PATCH] 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 file changed, 8 insertions(+) diff --git a/src/backends/native/meta-renderer-native-gles3.c b/src/backends/native/meta-renderer-native-gles3.c index 2aaae7619..0914dfe1d 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,