From: Colin Walters Date: Fri, 13 Apr 2012 19:28:49 +0000 (-0400) Subject: scanner: Ignore #defines starting with _ X-Git-Tag: GOBJECT_INTROSPECTION_1_35_2~45 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7f10346a378b2f33bf87730cce43c8b85e565952;p=platform%2Fupstream%2Fgobject-introspection.git scanner: Ignore #defines starting with _ This matches our behavior for symbols (and we should probably fix this more globally...I think we still scan _-prefixed enums). Noticed from gudev which had #define _GUDEV_INSIDE_H 1 https://bugzilla.gnome.org/show_bug.cgi?id=674072 --- diff --git a/giscanner/transformer.py b/giscanner/transformer.py index b96e141..e4938b9 100644 --- a/giscanner/transformer.py +++ b/giscanner/transformer.py @@ -710,6 +710,9 @@ raise ValueError.""" return ast.Return(typeval) def _create_const(self, symbol): + if symbol.ident.startswith('_'): + return None + # Don't create constants for non-public things # http://bugzilla.gnome.org/show_bug.cgi?id=572790 if (symbol.source_filename is None or diff --git a/tests/scanner/regress.h b/tests/scanner/regress.h index 635ea7b..b55c463 100644 --- a/tests/scanner/regress.h +++ b/tests/scanner/regress.h @@ -888,7 +888,6 @@ void regress_test_struct_fixed_array_frob (RegressTestStructFixedArray *str); void regress_has_parameter_named_attrs (int foo, gpointer attributes); - typedef struct { int dummy; struct { @@ -899,4 +898,9 @@ typedef struct { double dummy2; } RegressLikeGnomeKeyringPasswordSchema; +/* Ensure we ignore symbols that start with _; in particular we don't + * want to issue a namespace warning. + */ +#define _DONTSCANTHIS 1 + #endif /* __GITESTTYPES_H__ */