diff --git a/tools/winebuild/build.h b/tools/winebuild/build.h index 78624c5fb70..c49d0bd8dc7 100644 --- a/tools/winebuild/build.h +++ b/tools/winebuild/build.h @@ -55,9 +55,7 @@ typedef enum SPEC_MODE_DLL, SPEC_MODE_NATIVE, SPEC_MODE_GUIEXE, - SPEC_MODE_CUIEXE, - SPEC_MODE_GUIEXE_UNICODE, - SPEC_MODE_CUIEXE_UNICODE + SPEC_MODE_CUIEXE } SPEC_MODE; typedef struct diff --git a/tools/winebuild/import.c b/tools/winebuild/import.c index 25c517e7b03..e13424059b0 100644 --- a/tools/winebuild/import.c +++ b/tools/winebuild/import.c @@ -456,14 +456,6 @@ static void add_extra_undef_symbols( const DLLSPEC *spec ) case SPEC_MODE_CUIEXE: kernel_imports += add_extra_symbol( extras, &count, "ExitProcess", spec ); break; - case SPEC_MODE_GUIEXE_UNICODE: - kernel_imports += add_extra_symbol( extras, &count, "GetCommandLineA", spec ); - kernel_imports += add_extra_symbol( extras, &count, "GetStartupInfoA", spec ); - kernel_imports += add_extra_symbol( extras, &count, "GetModuleHandleA", spec ); - /* fall through */ - case SPEC_MODE_CUIEXE_UNICODE: - kernel_imports += add_extra_symbol( extras, &count, "ExitProcess", spec ); - break; } if (nb_delayed) { diff --git a/tools/winebuild/main.c b/tools/winebuild/main.c index 20509791130..26b9d3218e4 100644 --- a/tools/winebuild/main.c +++ b/tools/winebuild/main.c @@ -271,8 +271,6 @@ static char **parse_options( int argc, char **argv, DLLSPEC *spec ) case 'm': if (!strcmp( optarg, "gui" )) spec->mode = SPEC_MODE_GUIEXE; else if (!strcmp( optarg, "cui" )) spec->mode = SPEC_MODE_CUIEXE; - else if (!strcmp( optarg, "guiw" )) spec->mode = SPEC_MODE_GUIEXE_UNICODE; - else if (!strcmp( optarg, "cuiw" )) spec->mode = SPEC_MODE_CUIEXE_UNICODE; else if (!strcmp( optarg, "native" )) spec->mode = SPEC_MODE_NATIVE; else usage(1); break; diff --git a/tools/winebuild/spec32.c b/tools/winebuild/spec32.c index 7df293cc20b..0b7bb7da815 100644 --- a/tools/winebuild/spec32.c +++ b/tools/winebuild/spec32.c @@ -643,7 +643,6 @@ void BuildSpec32File( FILE *outfile, DLLSPEC *spec ) subsystem = IMAGE_SUBSYSTEM_NATIVE; break; case SPEC_MODE_GUIEXE: - case SPEC_MODE_GUIEXE_UNICODE: if (!init_func) init_func = "WinMain"; fprintf( outfile, "\ntypedef struct {\n" @@ -688,36 +687,31 @@ void BuildSpec32File( FILE *outfile, DLLSPEC *spec ) subsystem = IMAGE_SUBSYSTEM_WINDOWS_GUI; break; case SPEC_MODE_CUIEXE: - if (!init_func) init_func = "main"; + if (init_func) + fprintf( outfile, "extern int %s( int argc, char *argv[] );\n", init_func ); + else + { + declare_weak_function( outfile, "main", "int main( int argc, char *argv[] )" ); + declare_weak_function( outfile, "wmain", "int wmain( int argc, unsigned short *argv[] )" ); + } fprintf( outfile, "\nextern void __stdcall ExitProcess(int);\n" "static void __wine_exe_main(void)\n" "{\n" " int ret;\n" - " extern int %s( int argc, char *argv[] );\n" " if (__wine_spec_init_state == 1)\n" - " _init( __wine_main_argc, __wine_main_argv, __wine_main_environ );\n" - " ret = %s( __wine_main_argc, __wine_main_argv );\n" - " if (__wine_spec_init_state == 1) _fini();\n" - " ExitProcess( ret );\n" - "}\n\n", init_func, init_func ); - init_func = "__wine_exe_main"; - subsystem = IMAGE_SUBSYSTEM_WINDOWS_CUI; - break; - case SPEC_MODE_CUIEXE_UNICODE: - if (!init_func) init_func = "wmain"; + " _init( __wine_main_argc, __wine_main_argv, __wine_main_environ );\n" ); + if (init_func) + fprintf( outfile, + " ret = %s( __wine_main_argc, __wine_main_argv );\n", init_func ); + else + fprintf( outfile, + " if (wmain) ret = wmain( __wine_main_argc, __wine_main_wargv );\n" + " else ret = main( __wine_main_argc, __wine_main_argv );\n" ); fprintf( outfile, - "\nextern void __stdcall ExitProcess(int);\n" - "static void __wine_exe_main(void)\n" - "{\n" - " int ret;\n" - " extern int %s( int argc, unsigned short *argv[] );\n" - " if (__wine_spec_init_state == 1)\n" - " _init( __wine_main_argc, __wine_main_argv, __wine_main_environ );\n" - " ret = %s( __wine_main_argc, __wine_main_wargv );\n" " if (__wine_spec_init_state == 1) _fini();\n" " ExitProcess( ret );\n" - "}\n\n", init_func, init_func ); + "}\n\n" ); init_func = "__wine_exe_main"; subsystem = IMAGE_SUBSYSTEM_WINDOWS_CUI; break; diff --git a/tools/winebuild/winebuild.man.in b/tools/winebuild/winebuild.man.in index 8ad92b0a205..14d3ba3e40f 100644 --- a/tools/winebuild/winebuild.man.in +++ b/tools/winebuild/winebuild.man.in @@ -137,24 +137,18 @@ meaningful in \fB--dll\fR mode. Set the executable or dll mode, which can be one of the following: .br .B cui -for a command line ASCII executable, +for a command line executable, .br .B gui -for a graphical ASCII executable, -.br -.B cuiw -for a command line Unicode executable, -.br -.B guiw -for a graphical Unicode executable, +for a graphical executable, .br .B native for a native-mode dll. .br -A command line executable entry point is a normal C \fBmain\fR -function. A graphical executable has a \fBWinMain\fR entry point -instead. The ASCII/Unicode distinction applies to the strings that are -passed to the entry point. +The entry point of a command line executable is a normal C \fBmain\fR +function. A \fBwmain\fR function can be used instead if you need the +argument array to use Unicode strings. A graphical executable has a +\fBWinMain\fR entry point. .TP .BI \-N,\ --dll-name= dllname Set the internal name of the module. It is only used in Win16