From bedd7dd61508684b78bd1e95fed8025d48661b48 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Mon, 10 Jan 2011 18:48:23 +0100 Subject: scanner: Include all headers when building the dumper binary This avoids warnings about undefined functions when using init sections and it removes the requirement to predeclare the get_type functions that should be called. For an example for this problem with GStreamer, see https://bugzilla.gnome.org/show_bug.cgi?id=639039 We can now also use gcc's error checking to ensure that users - specify the correct C includes in the gir file (because otherwise we get errors when compiling the dumper). - the types do actually exist (because again, the compiler will complain). --- giscanner/dumper.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/giscanner/dumper.py b/giscanner/dumper.py index 3ea43e2c..538fe0e4 100644 --- a/giscanner/dumper.py +++ b/giscanner/dumper.py @@ -37,6 +37,8 @@ _PROGRAM_TEMPLATE = """/* This file is generated, do not edit */ #include #include +%(c_include)s + %(gdump_include)s int @@ -107,6 +109,7 @@ class DumpCompiler(object): gdump_file = open(gdump_path) gdump_contents = gdump_file.read() gdump_file.close() + tpl_args['c_include'] = "\n".join("#include <%s>" % i for i in self._options.c_includes) tpl_args['gdump_include'] = gdump_contents tpl_args['init_sections'] = "\n".join(self._options.init_sections) -- cgit v1.2.1