diff options
author | Guido van Rossum <guido@python.org> | 1999-09-30 14:12:44 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1999-09-30 14:12:44 (GMT) |
commit | 8bd738278ede0e1e74e1bd05b629e380026d7984 (patch) | |
tree | e0a0243802bb1558f06c0767e8c905dd4d3135f5 /Tools/freeze | |
parent | a856d9f450f86e86afae41be267f41d08ac58025 (diff) | |
download | cpython-8bd738278ede0e1e74e1bd05b629e380026d7984.zip cpython-8bd738278ede0e1e74e1bd05b629e380026d7984.tar.gz cpython-8bd738278ede0e1e74e1bd05b629e380026d7984.tar.bz2 |
Patch by Jack Jansen to add with_ifdef option, which places #ifndef
around external decls.
Diffstat (limited to 'Tools/freeze')
-rw-r--r-- | Tools/freeze/makeconfig.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Tools/freeze/makeconfig.py b/Tools/freeze/makeconfig.py index 958c2be..db6bf6b 100644 --- a/Tools/freeze/makeconfig.py +++ b/Tools/freeze/makeconfig.py @@ -5,7 +5,7 @@ import regex never = ['marshal', '__main__', '__builtin__', 'sys'] -def makeconfig(infp, outfp, modules): +def makeconfig(infp, outfp, modules, with_ifdef=0): m1 = regex.compile('-- ADDMODULE MARKER 1 --') m2 = regex.compile('-- ADDMODULE MARKER 2 --') while 1: @@ -17,7 +17,11 @@ def makeconfig(infp, outfp, modules): for mod in modules: if mod in never: continue + if with_ifdef: + outfp.write("#ifndef init%s\n"%mod) outfp.write('extern void init%s();\n' % mod) + if with_ifdef: + outfp.write("#endif\n") elif m2 and m2.search(line) >= 0: m2 = None for mod in modules: |