Commits

Maciej Fijalkowski committed f122c7c

Add #ifdefs to our generated decl files

  • Participants
  • Parent commits 310b0c2

Comments (0)

Files changed (1)

rpython/translator/c/genc.py

     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:
     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: