Author: Maciej Fijalkowski <[email protected]>
Branch: 
Changeset: r64026:f122c7c37700
Date: 2013-05-13 14:21 +0200
http://bitbucket.org/pypy/pypy/changeset/f122c7c37700/

Log:    Add #ifdefs to our generated decl files

diff --git a/rpython/translator/c/genc.py b/rpython/translator/c/genc.py
--- a/rpython/translator/c/genc.py
+++ b/rpython/translator/c/genc.py
@@ -703,6 +703,8 @@
     print >> f, '/***********************************************************/'
     print >> f, '/***  Structure definitions                              ***/'
     print >> f
+    print >> f, "#ifndef _PYPY_STRUCTDEF_H"
+    print >> f, "#define _PYPY_STRUCTDEF_H"
     for node in structdeflist:
         if hasattr(node, 'forward_decl'):
             if node.forward_decl:
@@ -713,14 +715,18 @@
     for node in structdeflist:
         for line in node.definition():
             print >> f, line
+    print >> f, "#endif"
 
 def gen_forwarddecl(f, database):
     print >> f, '/***********************************************************/'
     print >> f, '/***  Forward declarations                               ***/'
     print >> f
+    print >> f, "#ifndef _PYPY_FORWARDDECL_H"
+    print >> f, "#define _PYPY_FORWARDDECL_H"
     for node in database.globalcontainers():
         for line in node.forward_declaration():
             print >> f, line
+    print >> f, "#endif"
 
 def gen_preimpl(f, database):
     if database.translator is None or database.translator.rtyper is None:
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to