From: Guido van Rossum Date: Wed, 4 Mar 1998 18:12:39 +0000 (+0000) Subject: Untested changes to make the '-s windows' option X-Git-Tag: v1.5.1~507 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f888350dec14dae1879b1dd0d85616440be9af03;p=python Untested changes to make the '-s windows' option work on Windows. --- diff --git a/Tools/freeze/freeze.py b/Tools/freeze/freeze.py index b584ec598f..181e84598b 100755 --- a/Tools/freeze/freeze.py +++ b/Tools/freeze/freeze.py @@ -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: diff --git a/Tools/freeze/winmakemakefile.py b/Tools/freeze/winmakemakefile.py index 453bbffe44..972f400e75 100644 --- a/Tools/freeze/winmakemakefile.py +++ b/Tools/freeze/winmakemakefile.py @@ -1,5 +1,19 @@ import sys, os, string +WINMAINTEMPLATE = """ +#include + +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: