| ... | @@ -2711,12 +2711,12 @@ void add_fn_export(CodeGen *g, ZigFn *fn_table_entry, Buf *symbol_name, GlobalLi | ... | @@ -2711,12 +2711,12 @@ void add_fn_export(CodeGen *g, ZigFn *fn_table_entry, Buf *symbol_name, GlobalLi |
| 2711 | if (ccc) { | 2711 | if (ccc) { |
| 2712 | if (buf_eql_str(symbol_name, "main") && g->libc_link_lib != nullptr) { | 2712 | if (buf_eql_str(symbol_name, "main") && g->libc_link_lib != nullptr) { |
| 2713 | g->have_c_main = true; | 2713 | g->have_c_main = true; |
| 2714 | g->subsystem = TargetSubsystemConsole; | 2714 | g->subsystem = g->subsystem == TargetSubsystemAuto ? TargetSubsystemConsole : g->subsystem; |
| 2715 | } else if (buf_eql_str(symbol_name, "WinMain") && | 2715 | } else if (buf_eql_str(symbol_name, "WinMain") && |
| 2716 | g->zig_target->os == OsWindows) | 2716 | g->zig_target->os == OsWindows) |
| 2717 | { | 2717 | { |
| 2718 | g->have_winmain = true; | 2718 | g->have_winmain = true; |
| 2719 | g->subsystem = TargetSubsystemWindows; | 2719 | g->subsystem = g->subsystem == TargetSubsystemAuto ? TargetSubsystemWindows : g->subsystem; |
| 2720 | } else if (buf_eql_str(symbol_name, "WinMainCRTStartup") && | 2720 | } else if (buf_eql_str(symbol_name, "WinMainCRTStartup") && |
| 2721 | g->zig_target->os == OsWindows) | 2721 | g->zig_target->os == OsWindows) |
| 2722 | { | 2722 | { |
| ... | @@ -3937,7 +3937,7 @@ ZigType *add_source_file(CodeGen *g, ZigPackage *package, Buf *resolved_path, Bu | ... | @@ -3937,7 +3937,7 @@ ZigType *add_source_file(CodeGen *g, ZigPackage *package, Buf *resolved_path, Bu |
| 3937 | if (is_pub) { | 3937 | if (is_pub) { |
| 3938 | if (buf_eql_str(proto_name, "main")) { | 3938 | if (buf_eql_str(proto_name, "main")) { |
| 3939 | g->have_pub_main = true; | 3939 | g->have_pub_main = true; |
| 3940 | g->subsystem = TargetSubsystemConsole; | 3940 | g->subsystem = g->subsystem == TargetSubsystemAuto ? TargetSubsystemConsole : g->subsystem; |
| 3941 | } else if (buf_eql_str(proto_name, "panic")) { | 3941 | } else if (buf_eql_str(proto_name, "panic")) { |
| 3942 | g->have_pub_panic = true; | 3942 | g->have_pub_panic = true; |
| 3943 | } | 3943 | } |