authorgravatar for emekankurumeh@outlook.comemekoi <emekankurumeh@outlook.com> 2019-05-10 09:57:02-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-05-29 16:55:01-04:00
logb461e600e2cb4d2f5a1f8b15003d7b7a5e397482
tree8222b2176a1689fac22bad96289c0f9f5396ddad
parent6bc5b07e3e24871fc81ddd5a3780523bf95cf8d5
signature Commit is signed but in an unrecognized format.

set subsystem to null if not on windows or uefi


1 files changed, 3 insertions(+), 3 deletions(-)

src/codegen.cpp+3-3
...@@ -7919,13 +7919,13 @@ Buf *codegen_generate_builtin_source(CodeGen *g) {...@@ -7919,13 +7919,13 @@ Buf *codegen_generate_builtin_source(CodeGen *g) {
7919 "EfiRuntimeDriver",7919 "EfiRuntimeDriver",
7920 };7920 };
79217921
7922 if (g->subsystem == TargetSubsystemAuto) {7922 if (g->zig_target->os != OsWindows || g->zig_target->os != OsUefi || g->have_dllmain_crt_startup || g->out_type == OutTypeLib) {
7923 buf_appendf(contents, "pub const subsystem = null;\n");
7924 } else if (g->subsystem == TargetSubsystemAuto) {
7923 if (g->have_c_main || g->have_pub_main) {7925 if (g->have_c_main || g->have_pub_main) {
7924 buf_appendf(contents, "pub const subsystem = SubSystem.%s;\n", subsystem_strings[TargetSubsystemConsole - 1]);7926 buf_appendf(contents, "pub const subsystem = SubSystem.%s;\n", subsystem_strings[TargetSubsystemConsole - 1]);
7925 } else if (g->have_winmain || g->have_winmain_crt_startup) {7927 } else if (g->have_winmain || g->have_winmain_crt_startup) {
7926 buf_appendf(contents, "pub const subsystem = SubSystem.%s;\n", subsystem_strings[TargetSubsystemWindows - 1]);7928 buf_appendf(contents, "pub const subsystem = SubSystem.%s;\n", subsystem_strings[TargetSubsystemWindows - 1]);
7927 } else if (g->have_dllmain_crt_startup || g->out_type == OutTypeLib) {
7928 buf_appendf(contents, "pub const subsystem = null;\n");
7929 }7929 }
7930 } else {7930 } else {
7931 buf_appendf(contents, "pub const subsystem = SubSystem.%s;\n", subsystem_strings[g->subsystem - 1]);7931 buf_appendf(contents, "pub const subsystem = SubSystem.%s;\n", subsystem_strings[g->subsystem - 1]);