From edca61f92810bb0cc0f5aac1ee36dd0d487a917f Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Mon, 22 Jul 2019 19:36:00 +0200 Subject: transformer: only include function macros from headers. See #159 We already do the same thing for constants (see _create_const()). Otherwise macros in .c files which aren't namespaced will trigger a warning. --- giscanner/transformer.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'giscanner') diff --git a/giscanner/transformer.py b/giscanner/transformer.py index a3cf3126..f63894cb 100644 --- a/giscanner/transformer.py +++ b/giscanner/transformer.py @@ -459,6 +459,10 @@ raise ValueError.""" def _create_function_macro(self, symbol): if symbol.ident.startswith('_'): return None + + if (symbol.source_filename is None or not symbol.source_filename.endswith('.h')): + return None + parameters = list(self._create_parameters(symbol, symbol.base_type)) name = self._strip_symbol(symbol) macro = ast.FunctionMacro(name, parameters, symbol.ident) -- cgit v1.2.1