Avoid including winbase.h in generated .spec.c files.

This commit is contained in:
Alexandre Julliard 2001-10-02 20:32:58 +00:00
parent 5a9ba2826e
commit 5b1e934218
1 changed files with 33 additions and 8 deletions

View File

@ -509,19 +509,31 @@ void BuildSpec32File( FILE *outfile )
case SPEC_MODE_GUIEXE: case SPEC_MODE_GUIEXE:
if (!init_func) init_func = "WinMain"; if (!init_func) init_func = "WinMain";
fprintf( outfile, fprintf( outfile,
"\n#include <winbase.h>\n" "\ntypedef struct {\n"
" unsigned int cb;\n"
" char *lpReserved, *lpDesktop, *lpTitle;\n"
" unsigned int dwX, dwY, dwXSize, dwYSize;\n"
" unsigned int dwXCountChars, dwYCountChars, dwFillAttribute, dwFlags;\n"
" unsigned short wShowWindow, cbReserved2;\n"
" char *lpReserved2;\n"
" void *hStdInput, *hStdOutput, *hStdError;\n"
"} STARTUPINFOA;\n"
"int _ARGC;\n" "int _ARGC;\n"
"char **_ARGV;\n" "char **_ARGV;\n"
"extern int __stdcall %s(HINSTANCE,HINSTANCE,LPSTR,INT);\n" "extern int __stdcall %s(void *,void *,char *,int);\n"
"extern char * __stdcall GetCommandLineA(void);\n"
"extern void * __stdcall GetModuleHandleA(char *);\n"
"extern void __stdcall GetStartupInfoA(STARTUPINFOA *);\n"
"extern void __stdcall ExitProcess(unsigned int);\n"
"static void __wine_exe_main(void)\n" "static void __wine_exe_main(void)\n"
"{\n" "{\n"
" extern int __wine_get_main_args( char ***argv );\n" " extern int __wine_get_main_args( char ***argv );\n"
" STARTUPINFOA info;\n" " STARTUPINFOA info;\n"
" LPSTR cmdline = GetCommandLineA();\n" " char *cmdline = GetCommandLineA();\n"
" while (*cmdline && *cmdline != ' ') cmdline++;\n" " while (*cmdline && *cmdline != ' ') cmdline++;\n"
" if (*cmdline) cmdline++;\n" " if (*cmdline) cmdline++;\n"
" GetStartupInfoA( &info );\n" " GetStartupInfoA( &info );\n"
" if (!(info.dwFlags & STARTF_USESHOWWINDOW)) info.wShowWindow = 1;\n" " if (!(info.dwFlags & 1)) info.wShowWindow = 1;\n"
" _ARGC = __wine_get_main_args( &_ARGV );\n" " _ARGC = __wine_get_main_args( &_ARGV );\n"
" ExitProcess( %s( GetModuleHandleA(0), 0, cmdline, info.wShowWindow ) );\n" " ExitProcess( %s( GetModuleHandleA(0), 0, cmdline, info.wShowWindow ) );\n"
"}\n\n", init_func, init_func ); "}\n\n", init_func, init_func );
@ -531,19 +543,32 @@ void BuildSpec32File( FILE *outfile )
case SPEC_MODE_GUIEXE_UNICODE: case SPEC_MODE_GUIEXE_UNICODE:
if (!init_func) init_func = "WinMain"; if (!init_func) init_func = "WinMain";
fprintf( outfile, fprintf( outfile,
"\n#include <winbase.h>\n" "\ntypedef unsigned short WCHAR;\n"
"typedef struct {\n"
" unsigned int cb;\n"
" char *lpReserved, *lpDesktop, *lpTitle;\n"
" unsigned int dwX, dwY, dwXSize, dwYSize;\n"
" unsigned int dwXCountChars, dwYCountChars, dwFillAttribute, dwFlags;\n"
" unsigned short wShowWindow, cbReserved2;\n"
" char *lpReserved2;\n"
" void *hStdInput, *hStdOutput, *hStdError;\n"
"} STARTUPINFOA;\n"
"int _ARGC;\n" "int _ARGC;\n"
"WCHAR **_ARGV;\n" "WCHAR **_ARGV;\n"
"extern int __stdcall %s(HINSTANCE,HINSTANCE,LPSTR,INT);\n" "extern int __stdcall %s(void *,void *,char *,int);\n"
"extern char * __stdcall GetCommandLineA(void);\n"
"extern void * __stdcall GetModuleHandleA(char *);\n"
"extern void __stdcall GetStartupInfoA(STARTUPINFOA *);\n"
"extern void __stdcall ExitProcess(unsigned int);\n"
"static void __wine_exe_main(void)\n" "static void __wine_exe_main(void)\n"
"{\n" "{\n"
" extern int __wine_get_wmain_args( WCHAR ***argv );\n" " extern int __wine_get_wmain_args( WCHAR ***argv );\n"
" STARTUPINFOA info;\n" " STARTUPINFOA info;\n"
" LPSTR cmdline = GetCommandLineA();\n" " char *cmdline = GetCommandLineA();\n"
" while (*cmdline && *cmdline != ' ') cmdline++;\n" " while (*cmdline && *cmdline != ' ') cmdline++;\n"
" if (*cmdline) cmdline++;\n" " if (*cmdline) cmdline++;\n"
" GetStartupInfoA( &info );\n" " GetStartupInfoA( &info );\n"
" if (!(info.dwFlags & STARTF_USESHOWWINDOW)) info.wShowWindow = 1;\n" " if (!(info.dwFlags & 1)) info.wShowWindow = 1;\n"
" _ARGC = __wine_get_wmain_args( &_ARGV );\n" " _ARGC = __wine_get_wmain_args( &_ARGV );\n"
" ExitProcess( %s( GetModuleHandleA(0), 0, cmdline, info.wShowWindow ) );\n" " ExitProcess( %s( GetModuleHandleA(0), 0, cmdline, info.wShowWindow ) );\n"
"}\n\n", init_func, init_func ); "}\n\n", init_func, init_func );