[gobject-introspection] scanner: Include all headers when building the dumper binary
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gobject-introspection] scanner: Include all headers when building the dumper binary
- Date: Mon, 10 Jan 2011 18:24:02 +0000 (UTC)
commit bedd7dd61508684b78bd1e95fed8025d48661b48
Author: Benjamin Otte <otte redhat com>
Date: Mon Jan 10 18:48:23 2011 +0100
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 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/giscanner/dumper.py b/giscanner/dumper.py
index 3ea43e2..538fe0e 100644
--- a/giscanner/dumper.py
+++ b/giscanner/dumper.py
@@ -37,6 +37,8 @@ _PROGRAM_TEMPLATE = """/* This file is generated, do not edit */
#include <string.h>
#include <stdlib.h>
+%(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)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]