[Mesa-dev] [PATCH 07/14] mesa_glinterop: remove inclusion of GLX header

Emil Velikov emil.l.velikov at gmail.com
Tue May 24 14:32:49 UTC 2016


From: Emil Velikov <emil.velikov at collabora.com>

Since we only need partial information about the GLX symbols we can
forward declare them and drop the include. Obviously each user of the
said API will needs more than what's provides, so they'll include the
GLX header.

If they don't, the compiler will give us a nice warning ;-)

Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
---
 include/GL/mesa_glinterop.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/GL/mesa_glinterop.h b/include/GL/mesa_glinterop.h
index ae71fea..b76bd7e 100644
--- a/include/GL/mesa_glinterop.h
+++ b/include/GL/mesa_glinterop.h
@@ -51,13 +51,16 @@
 #define MESA_GLINTEROP_H
 
 #include <stddef.h>
-#include <GL/glx.h>
 #include <EGL/egl.h>
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+/* Forward declarations to avoid inclusion of GL/glx.h */
+typedef struct _XDisplay Display;
+typedef struct __GLXcontextRec *GLXContext;
+
 /** Returned error codes. */
 enum {
    MESA_GLINTEROP_SUCCESS = 0,
-- 
2.8.2



More information about the mesa-dev mailing list