summaryrefslogtreecommitdiff
path: root/cogl/cogl-gles2.h
diff options
context:
space:
mode:
authorRobert Bragg <robert@linux.intel.com>2013-11-28 12:34:45 +0000
committerRobert Bragg <robert@linux.intel.com>2013-11-28 16:59:55 +0000
commit31a9726506668184e0a3b0044cf74a08fe219c0e (patch)
treebcd44d720ae4929433b83ef09bceccd2b5aa2620 /cogl/cogl-gles2.h
parent0bf128198d18a62c981e68d87c1d42f951efa7c1 (diff)
downloadcogl-31a9726506668184e0a3b0044cf74a08fe219c0e.tar.gz
build: fix building introspection data
This fixes the build with --enable-introspection. I'm not sure why g-ir-scanner seems to parse all public headers in isolation instead of being able take a more limited list of top-level public headers and automatically parse all necessary #include directives but this means we have to special case how we define and undefine __COGL_H_INSIDE__ to subvert the guards we have in place for detecting misuse of the headers. Reviewed-by: Neil Roberts <neil@linux.intel.com> (cherry picked from commit e0b2255876c1cf11d124d5ae37cbe9a6e43777f1)
Diffstat (limited to 'cogl/cogl-gles2.h')
-rw-r--r--cogl/cogl-gles2.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/cogl/cogl-gles2.h b/cogl/cogl-gles2.h
index 1fc4bc43..265db466 100644
--- a/cogl/cogl-gles2.h
+++ b/cogl/cogl-gles2.h
@@ -36,9 +36,16 @@
* api definitions
*/
#ifndef COGL_COMPILATION
+
+/* Note: When building Cogl .gir we explicitly define
+ * __COGL_H_INSIDE__ */
+#ifndef __COGL_H_INSIDE__
#define __COGL_H_INSIDE__
+#define __COGL_MUST_UNDEF_COGL_H_INSIDE__
#endif
+#endif /* COGL_COMPILATION */
+
#include <cogl/cogl-defines.h>
#include <cogl/cogl-context.h>
#include <cogl/cogl-framebuffer.h>
@@ -379,5 +386,18 @@ cogl_is_gles2_context (void *object);
COGL_END_DECLS
+/* The gobject introspection scanner seems to parse public headers in
+ * isolation which means we need to be extra careful about how we
+ * define and undefine __COGL_H_INSIDE__ used to detect when internal
+ * headers are incorrectly included by developers. In the gobject
+ * introspection case we have to manually define __COGL_H_INSIDE__ as
+ * a commandline argument for the scanner which means we must be
+ * careful not to undefine it in a header...
+ */
+#ifdef __COGL_MUST_UNDEF_COGL_H_INSIDE__
+#undef __COGL_H_INSIDE__
+#undef __COGL_MUST_UNDEF_COGL_H_INSIDE__
+#endif
+
#endif /* __COGL_GLES2_H__ */