aboutsummaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2012-03-20 16:44:39 -0600
committerEric Blake <eblake@redhat.com>2012-03-20 16:54:39 -0600
commit2791b8ab9b7027433ba34946de8a43de8231b722 (patch)
tree5fbc7b98c200c5aa1b4c304f197e4b1385a3d7d2 /python
parentMinor docs fix (diff)
downloadlibvirt-2791b8ab9b7027433ba34946de8a43de8231b722.tar.gz
libvirt-2791b8ab9b7027433ba34946de8a43de8231b722.tar.bz2
libvirt-2791b8ab9b7027433ba34946de8a43de8231b722.zip
python: always include config.h first
On RHEL 5.7, I got this compilation failure: In file included from /usr/include/python2.4/pyport.h:98, from /usr/include/python2.4/Python.h:55, from libvirt.c:3: ../gnulib/lib/time.h:468: error: expected ';', ',' or ')' before '__timer' Turns out that our '#define restrict __restrict' from config.h wasn't being picked up. Gnulib _requires_ that all .c files include <config.h> first, otherwise the gnulib header overrides tend to misbehave. Problem introduced by patch c700613b8. * python/generator.py (buildStubs): Include <config.h> first.
Diffstat (limited to 'python')
-rwxr-xr-xpython/generator.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/python/generator.py b/python/generator.py
index 98072f0a9..e641c3187 100755
--- a/python/generator.py
+++ b/python/generator.py
@@ -757,7 +757,8 @@ def buildStubs(module):
export.write("/* Generated */\n\n")
wrapper = open(wrapper_file, "w")
- wrapper.write("/* Generated */\n\n")
+ wrapper.write("/* Generated by generator.py */\n\n")
+ wrapper.write("#include <config.h>\n")
wrapper.write("#include <Python.h>\n")
wrapper.write("#include <libvirt/" + module + ".h>\n")
wrapper.write("#include \"typewrappers.h\"\n")