Alexandre Julliard : winebuild: Set the default entry point also for Windows builds.

Alexandre Julliard julliard at winehq.org
Tue Jun 25 17:25:51 CDT 2019


Module: wine
Branch: master
Commit: 907896fba57f1c1ca6f0d9ca3379dc7ccabd8285
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=907896fba57f1c1ca6f0d9ca3379dc7ccabd8285

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Tue Jun 25 17:36:44 2019 +0200

winebuild: Set the default entry point also for Windows builds.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47410
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 tools/winebuild/import.c | 10 ----------
 tools/winebuild/main.c   | 10 ++++++++++
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/tools/winebuild/import.c b/tools/winebuild/import.c
index 8c32b73..7d3c725 100644
--- a/tools/winebuild/import.c
+++ b/tools/winebuild/import.c
@@ -456,15 +456,6 @@ static void add_undef_import( const char *name, int is_ordinal )
         add_import_func( import, xstrdup( p ), NULL, ordinal, 0 );
 }
 
-/* get the default entry point for a given spec file */
-static const char *get_default_entry_point( const DLLSPEC *spec )
-{
-    if (spec->characteristics & IMAGE_FILE_DLL) return "__wine_spec_dll_entry";
-    if (spec->subsystem == IMAGE_SUBSYSTEM_NATIVE) return "__wine_spec_drv_entry";
-    if (spec->type == SPEC_WIN16) return "__wine_spec_exe16_entry";
-    return "__wine_spec_exe_entry";
-}
-
 /* check if the spec file exports any stubs */
 static int has_stubs( const DLLSPEC *spec )
 {
@@ -480,7 +471,6 @@ static int has_stubs( const DLLSPEC *spec )
 /* add the extra undefined symbols that will be contained in the generated spec file itself */
 static void add_extra_undef_symbols( DLLSPEC *spec )
 {
-    if (!spec->init_func) spec->init_func = xstrdup( get_default_entry_point(spec) );
     add_extra_ld_symbol( spec->init_func );
     if (has_stubs( spec )) add_extra_ld_symbol( "__wine_spec_unimplemented_stub" );
     if (delayed_imports.count) add_extra_ld_symbol( "__wine_spec_delay_load" );
diff --git a/tools/winebuild/main.c b/tools/winebuild/main.c
index 2539577..0a5becd 100644
--- a/tools/winebuild/main.c
+++ b/tools/winebuild/main.c
@@ -369,6 +369,15 @@ static void set_exec_mode( enum exec_mode_values mode )
     exec_mode = mode;
 }
 
+/* get the default entry point for a given spec file */
+static const char *get_default_entry_point( const DLLSPEC *spec )
+{
+    if (spec->characteristics & IMAGE_FILE_DLL) return "__wine_spec_dll_entry";
+    if (spec->subsystem == IMAGE_SUBSYSTEM_NATIVE) return "__wine_spec_drv_entry";
+    if (spec->type == SPEC_WIN16) return "__wine_spec_exe16_entry";
+    return "__wine_spec_exe_entry";
+}
+
 /* parse options from the argv array and remove all the recognized ones */
 static char **parse_options( int argc, char **argv, DLLSPEC *spec )
 {
@@ -633,6 +642,7 @@ int main(int argc, char **argv)
     case MODE_EXE:
         load_resources( argv, spec );
         if (spec_file_name && !parse_input_file( spec )) break;
+        if (!spec->init_func) spec->init_func = xstrdup( get_default_entry_point( spec ));
 
         if (fake_module)
         {




More information about the wine-cvs mailing list