summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorStef Walter <stefw@gnome.org>2013-04-19 16:18:40 +0200
committerStef Walter <stefw@gnome.org>2013-10-21 20:42:10 +0200
commit917da2d1aeffdc884a5fd5cf5b38a60ef088d0fb (patch)
tree115a99b4da986468aca556aec5af292626807948 /tests
parentebb80508d6959a0c94351e841c2cab6220602e62 (diff)
downloadgobject-introspection-917da2d1aeffdc884a5fd5cf5b38a60ef088d0fb.tar.gz
giscanner: Respect __GI_SCANNER__ when scanning for macros
When scanning for macros respect ifdefs of __GI_SCANNER__ in the various header files. Only #ifdef and #ifndef are supported. If __GI_SCANNER__ appears in plain #if statements, a warning is printed. https://bugzilla.gnome.org/show_bug.cgi?id=698367
Diffstat (limited to 'tests')
-rw-r--r--tests/scanner/Regress-1.0-expected.gir10
-rw-r--r--tests/scanner/regress.h12
2 files changed, 22 insertions, 0 deletions
diff --git a/tests/scanner/Regress-1.0-expected.gir b/tests/scanner/Regress-1.0-expected.gir
index 637a2735..bb83e225 100644
--- a/tests/scanner/Regress-1.0-expected.gir
+++ b/tests/scanner/Regress-1.0-expected.gir
@@ -1911,6 +1911,16 @@ exposed to language bindings.</doc>
</parameter>
</parameters>
</callback>
+ <constant name="GI_SCANNER_ELSE"
+ value="3"
+ c:type="REGRESS_GI_SCANNER_ELSE">
+ <type name="gint" c:type="gint"/>
+ </constant>
+ <constant name="GI_SCANNER_IFDEF"
+ value="3"
+ c:type="REGRESS_GI_SCANNER_IFDEF">
+ <type name="gint" c:type="gint"/>
+ </constant>
<constant name="GUINT64_CONSTANT"
value="18446744073709551615"
c:type="REGRESS_GUINT64_CONSTANT">
diff --git a/tests/scanner/regress.h b/tests/scanner/regress.h
index 274d0e4b..9c858840 100644
--- a/tests/scanner/regress.h
+++ b/tests/scanner/regress.h
@@ -950,4 +950,16 @@ typedef struct {
#define REGRESS_MININT64 ((gint64) G_GINT64_CONSTANT(0x8000000000000000))
#define REGRESS_MAXUINT64 (G_GINT64_CONSTANT(0xffffffffffffffffU))
+/* https://bugzilla.gnome.org/show_bug.cgi?id=698367 */
+#ifndef __GI_SCANNER__
+#define REGRESS_DONTSCANTHIS 1
+#else
+#define REGRESS_GI_SCANNER_ELSE 3
+#endif
+#ifndef BLAH
+#ifdef __GI_SCANNER__
+#define REGRESS_GI_SCANNER_IFDEF 3
+#endif
+#endif
+
#endif /* __GITESTTYPES_H__ */