Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 91cae85

Browse files
committed
Optionally bracket all external declarations of init functions with "ifndef"s.
1 parent 2afc2c7 commit 91cae85

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

Mac/Tools/macfreeze/macfreeze.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def main():
3838
if mustwait:
3939
sys.exit(1)
4040

41-
def process(gentype, program, output, modules=[], module_files=[], debug=0):
41+
def process(gentype, program, output, modules=[], module_files=[], debug=0, with_ifdef=0):
4242
try:
4343
module_dict = macmodulefinder.process(program, modules, module_files, debug)
4444
except macmodulefinder.Missing, arg:
@@ -54,7 +54,7 @@ def process(gentype, program, output, modules=[], module_files=[], debug=0):
5454
return 1 # So the user can inspect it
5555
elif gentype == 'source':
5656
import macgen_src
57-
warnings = macgen_src.generate(output, module_dict, debug)
57+
warnings = macgen_src.generate(output, module_dict, debug, with_ifdef)
5858
return warnings
5959
elif gentype == 'resource':
6060
import macgen_rsrc

Mac/Tools/macfreeze/macgen_src.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
CONFIG_TEMPLATE=os.path.join(TEMPLATEDIR, ':templatefrozenconfig.c')
1616
BUNDLE_TEMPLATE=os.path.join(TEMPLATEDIR, ':frozenbundle.rsrc')
1717

18-
def generate(output, module_dict, debug=0):
18+
def generate(output, module_dict, debug=0, with_ifdef=0):
1919
problems = 0
2020
output_created=0
2121
if not os.path.exists(output):
@@ -91,7 +91,7 @@ def generate(output, module_dict, debug=0):
9191
c_modules.append(module)
9292
ifp = open(CONFIG_TEMPLATE)
9393
ofp = open(config_name, 'w')
94-
makeconfig.makeconfig(ifp, ofp, c_modules)
94+
makeconfig.makeconfig(ifp, ofp, c_modules, with_ifdef)
9595
ifp.close()
9696
ofp.close()
9797
MacOS.SetCreatorAndType(config_name, 'CWIE', 'TEXT')

0 commit comments

Comments
 (0)