From 02a67254cc83a27dc2b8b947ac98cae32ba3dded Mon Sep 17 00:00:00 2001 From: Christoffer Lerno Date: Sat, 7 Feb 2026 19:57:43 +0100 Subject: [PATCH] Fix win forwarding functions. --- src/compiler/sema_decls.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/compiler/sema_decls.c b/src/compiler/sema_decls.c index 36ed76b6c..916f3ba24 100644 --- a/src/compiler/sema_decls.c +++ b/src/compiler/sema_decls.c @@ -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;