]> granicus.if.org Git - python/commitdiff
Untested changes to make the '-s windows' option
authorGuido van Rossum <guido@python.org>
Wed, 4 Mar 1998 18:12:39 +0000 (18:12 +0000)
committerGuido van Rossum <guido@python.org>
Wed, 4 Mar 1998 18:12:39 +0000 (18:12 +0000)
work on Windows.

Tools/freeze/freeze.py
Tools/freeze/winmakemakefile.py

index b584ec598ffa49237d5a26c0a945a0d1c5bd717a..181e84598b194ab2bdb4bae6829d7f6f3d0dd6a2 100755 (executable)
@@ -240,6 +240,9 @@ def main():
     outfp = open(frozen_c, 'w')
     try:
         makefreeze.makefreeze(outfp, dict)
+        if win and subsystem == 'windows':
+            import winmakemakefile
+            outfp.write(winmakemakefile.WINMAINTEMPLATE)
     finally:
         outfp.close()
     if backup:
index 453bbffe448de29822010ed66cd46d270b8878e6..972f400e751d8f529f7d65f545c652587f5c94ac 100644 (file)
@@ -1,5 +1,19 @@
 import sys, os, string
 
+WINMAINTEMPLATE = """
+#include <windows.h>
+
+int WINAPI WinMain(
+    HINSTANCE hInstance,      // handle to current instance
+    HINSTANCE hPrevInstance,  // handle to previous instance
+    LPSTR lpCmdLine,          // pointer to command line
+    int nCmdShow              // show state of window
+    )
+{
+    return main(__argc, __argv);
+}
+"""
+
 def makemakefile(outfp, vars, files, target):
     save = sys.stdout
     try: