summaryrefslogtreecommitdiff
path: root/cogl/cogl.h
diff options
context:
space:
mode:
Diffstat (limited to 'cogl/cogl.h')
-rw-r--r--cogl/cogl.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/cogl/cogl.h b/cogl/cogl.h
index 539a1271..fdb68bfa 100644
--- a/cogl/cogl.h
+++ b/cogl/cogl.h
@@ -29,7 +29,12 @@
#error "<cogl/cogl.h> shouldn't be included internally"
#endif
+/* 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
#include <cogl/cogl-defines.h>
#include <cogl/cogl-error.h>
@@ -99,6 +104,17 @@
#include <cogl/cogl-sdl.h>
#endif
+/* 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_H__ */