summaryrefslogtreecommitdiff
path: root/giscanner/codegen.py
diff options
context:
space:
mode:
authorChun-wei Fan <fanchunwei@src.gnome.org>2014-07-04 18:41:01 +0800
committerChun-wei Fan <fanchunwei@src.gnome.org>2014-08-15 10:03:05 +0800
commit7a82752734b496bb619fce62572c0c7f8578350a (patch)
tree773dd0c4f66796ec475a0ec10d9461a373dcb522 /giscanner/codegen.py
parentfffc66a67a217009199c1682d50263a574bbfaef (diff)
downloadgobject-introspection-7a82752734b496bb619fce62572c0c7f8578350a.tar.gz
codegen.py: Update Generation of everything.[c|h]
Update everything.h include the header used to decorate symbols with the macro for export and everything.c to include config.h first, and have the symbols decorated with the aforementioned macro. https://bugzilla.gnome.org/show_bug.cgi?id=732669
Diffstat (limited to 'giscanner/codegen.py')
-rw-r--r--giscanner/codegen.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/giscanner/codegen.py b/giscanner/codegen.py
index e9ed9415..a9fa375c 100644
--- a/giscanner/codegen.py
+++ b/giscanner/codegen.py
@@ -51,6 +51,7 @@ class CCodeGenerator(object):
def _write_prelude(self, out, func):
out.write("""
+_GI_TEST_EXTERN
%s
%s (""" % (self._typecontainer_to_ctype(func.retval), func.symbol))
l = len(func.parameters)
@@ -110,10 +111,18 @@ class CCodeGenerator(object):
#define __%s_H__
#include <glib-object.h>
+
+#include "../tests/gitestmacros.h"
+
""" % (nsupper, nsupper))
self.out_c.write(warning)
- self.out_c.write("""#include "%s"\n\n""" % (self.out_h_filename, ))
+ self.out_c.write("""
+#include "config.h"
+
+#include "%s"
+
+""" % (self.out_h_filename, ))
def _codegen_end(self):
self.out_h.write("""#endif\n""")