Fix win forwarding functions.

This commit is contained in:
Christoffer Lerno
2026-02-07 19:57:43 +01:00
parent 120f56ac5f
commit 02a67254cc

View File

@@ -4210,7 +4210,6 @@ static inline bool sema_analyse_main_function(SemaContext *context, Decl *decl)
{
RETURN_SEMA_ERROR(rtype_info, "Expected a return type of 'void' or %s.", type_quoted_error_string(type_cint));
}
// At this point the style is either MAIN_INT_VOID, MAIN_VOID_VOID
MainType type = sema_find_main_type(context, signature, sub_type == MAIN_SUBTYPE_WINMAIN);
if (type == MAIN_TYPE_ERROR) return false;
if (compiler.build.type == TARGET_TYPE_TEST || compiler.build.type == TARGET_TYPE_BENCHMARK) return true;
@@ -4234,7 +4233,7 @@ static inline bool sema_analyse_main_function(SemaContext *context, Decl *decl)
function = decl;
goto REGISTER_MAIN;
}
if (is_win32 && type != MAIN_TYPE_NO_ARGS && sub_type != MAIN_SUBTYPE_WINMAIN) sub_type = MAIN_SUBTYPE_WMAIN;
if (is_win32 && sub_type != MAIN_SUBTYPE_WINMAIN) sub_type = MAIN_SUBTYPE_WMAIN;
compiler.build.win.use_win_subsystem = sub_type == MAIN_SUBTYPE_WINMAIN;
function = sema_create_synthetic_main(context, decl, type, sub_type);
if (!decl_ok(function)) return false;