mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Fix win forwarding functions.
This commit is contained in:
@@ -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));
|
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);
|
MainType type = sema_find_main_type(context, signature, sub_type == MAIN_SUBTYPE_WINMAIN);
|
||||||
if (type == MAIN_TYPE_ERROR) return false;
|
if (type == MAIN_TYPE_ERROR) return false;
|
||||||
if (compiler.build.type == TARGET_TYPE_TEST || compiler.build.type == TARGET_TYPE_BENCHMARK) return true;
|
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;
|
function = decl;
|
||||||
goto REGISTER_MAIN;
|
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;
|
compiler.build.win.use_win_subsystem = sub_type == MAIN_SUBTYPE_WINMAIN;
|
||||||
function = sema_create_synthetic_main(context, decl, type, sub_type);
|
function = sema_create_synthetic_main(context, decl, type, sub_type);
|
||||||
if (!decl_ok(function)) return false;
|
if (!decl_ok(function)) return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user