egl: Fix inclusion of egl.h+mesa_glinterop.h
authorMatt Turner <mattst88@gmail.com>
Fri, 7 Jul 2017 01:40:53 +0000 (18:40 -0700)
committerMatt Turner <mattst88@gmail.com>
Mon, 21 Aug 2017 21:45:44 +0000 (14:45 -0700)
Previously clang would warn about redefinition of typedef EGLDisplay. Avoid
this by adding preprocessor guards to mesa_glinterop.h and including it
after EGL.h is indirectly included.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
include/GL/mesa_glinterop.h
src/egl/drivers/dri2/egl_dri2.c
src/egl/main/eglapi.c

index 173476a988e0d6f7ce06a45e1017689440157e6b..45fda93ca2495608a8d0340643755604f1042bc1 100644 (file)
@@ -58,12 +58,16 @@ extern "C" {
 #endif
 
 /* Forward declarations to avoid inclusion of GL/glx.h */
+#ifndef GLX_H
 struct _XDisplay;
 struct __GLXcontextRec;
+#endif
 
 /* Forward declarations to avoid inclusion of EGL/egl.h */
+#ifndef __egl_h_
 typedef void *EGLDisplay;
 typedef void *EGLContext;
+#endif
 
 /** Returned error codes. */
 enum {
index ed79e0d0a35e7dfb67df8816e20fcff86224d0f5..125943333bea837122d530d5b28f7d8b4c5b42d2 100644 (file)
@@ -46,7 +46,6 @@
 #endif
 #include <GL/gl.h>
 #include <GL/internal/dri_interface.h>
-#include "GL/mesa_glinterop.h"
 #include <sys/types.h>
 #include <sys/stat.h>
 
@@ -61,6 +60,7 @@
 #endif
 
 #include "egl_dri2.h"
+#include "GL/mesa_glinterop.h"
 #include "loader/loader.h"
 #include "util/u_atomic.h"
 #include "util/u_vector.h"
index c935c4db79b53399389279e2066b387d67f8f8da..e3f10fcbe24162b5912ea60e85a0b657da09455f 100644 (file)
@@ -88,7 +88,6 @@
 #include <string.h>
 #include "c99_compat.h"
 #include "c11/threads.h"
-#include "GL/mesa_glinterop.h"
 #include "util/macros.h"
 
 #include "eglglobals.h"
 #include "eglimage.h"
 #include "eglsync.h"
 
+#include "GL/mesa_glinterop.h"
 
 /**
  * Macros to help return an API entrypoint.