From fdb343d1b09278b2098cd69fa0abce1a72c624bc Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Tue, 20 Mar 2012 16:44:39 -0600 Subject: 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 first, otherwise the gnulib header overrides tend to misbehave. Problem introduced by patch c700613b8. * python/generator.py (buildStubs): Include first. --- generator.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/generator.py b/generator.py index 98072f0..e641c31 100755 --- a/generator.py +++ b/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 \n") wrapper.write("#include \n") wrapper.write("#include \n") wrapper.write("#include \"typewrappers.h\"\n") -- cgit