summaryrefslogtreecommitdiff
path: root/gobject-introspection
diff options
context:
space:
mode:
authorRyan Lortie <desrt@desrt.ca>2014-01-25 01:57:31 -0500
committerRyan Lortie <desrt@desrt.ca>2014-02-09 16:24:04 -0500
commitaff8625e4ec24129294b1557ec6756e0abdfa5eb (patch)
treeea25bf1d1bc00d1fe5766567779e02b9e6919dba /gobject-introspection
parent01fa2bfab504b40b01a9fb14e3ce80f790d0a949 (diff)
downloadvala-aff8625e4ec24129294b1557ec6756e0abdfa5eb.tar.gz
gen-introspect: pretend to be lint
Some system headers (notably <stdarg.h> on FreeBSD) get upset when they see an unexpected compiler. We go out of our way to pass -U__GNUC__ to cpp from the scanner code during gen-introspect and this is causing problems. As a workaround, we can pretend to be lint, which fixes the issue at least for FreeBSD. https://bugzilla.gnome.org/show_bug.cgi?id=722954
Diffstat (limited to 'gobject-introspection')
-rw-r--r--gobject-introspection/scanner.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gobject-introspection/scanner.c b/gobject-introspection/scanner.c
index f691e78b8..40e4efec5 100644
--- a/gobject-introspection/scanner.c
+++ b/gobject-introspection/scanner.c
@@ -1531,13 +1531,16 @@ g_igenerator_start_preprocessor (GIGenerator *igenerator,
int tmp;
char *tmpname;
- cpp_argv = g_new0 (char *, g_list_length (cpp_options) + 4);
+ cpp_argv = g_new0 (char *, g_list_length (cpp_options) + 5);
cpp_argv[cpp_argc++] = "cpp";
cpp_argv[cpp_argc++] = "-C";
/* Disable GCC extensions as we cannot parse them yet */
cpp_argv[cpp_argc++] = "-U__GNUC__";
+ /* Help system headers cope with the lack of __GNUC__ by pretending to be lint */
+ cpp_argv[cpp_argc++] = "-Dlint";
+
for (l = cpp_options; l; l = l->next)
cpp_argv[cpp_argc++] = (char*)l->data;