authorgravatar for emekankurumeh@outlook.comemekoi <emekankurumeh@outlook.com> 2019-05-25 14:25:46-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-05-27 22:15:33-04:00
log3f302594b855e4d0dff9fbbfb2fe9d1d1801cb6e
tree97e13c675e77d6f93a018dfdcbea2df3bee09fa9
parentf924fbddcfb615014aa7527686c1651c6e4d7846

respect subsystem flag in all cases


2 files changed, 4 insertions(+), 4 deletions(-)

src/analyze.cpp+3-3
...@@ -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 }
src/codegen.cpp+1-1
...@@ -7998,7 +7998,7 @@ static void init(CodeGen *g) {...@@ -7998,7 +7998,7 @@ static void init(CodeGen *g) {
7998 }7998 }
79997999
8000 if (g->is_test_build) {8000 if (g->is_test_build) {
8001 g->subsystem = TargetSubsystemConsole;8001 g->subsystem = g->subsystem == TargetSubsystemAuto ? TargetSubsystemConsole : g->subsystem;
8002 }8002 }
80038003
8004 assert(g->root_out_name);8004 assert(g->root_out_name);