zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit b461e600e2cb4d2f5a1f8b15003d7b7a5e397482 (tree)
parent 6bc5b07e3e24871fc81ddd5a3780523bf95cf8d5
Author: emekoi <emekankurumeh@outlook.com>
Date:   Fri, 10 May 2019 09:57:02 -0500

set subsystem to null if not on windows or uefi

Diffstat:
Msrc/codegen.cpp | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/codegen.cpp b/src/codegen.cpp @@ -7919,13 +7919,13 @@ Buf *codegen_generate_builtin_source(CodeGen *g) { "EfiRuntimeDriver", }; - if (g->subsystem == TargetSubsystemAuto) { + if (g->zig_target->os != OsWindows || g->zig_target->os != OsUefi || g->have_dllmain_crt_startup || g->out_type == OutTypeLib) { + buf_appendf(contents, "pub const subsystem = null;\n"); + } else if (g->subsystem == TargetSubsystemAuto) { if (g->have_c_main || g->have_pub_main) { buf_appendf(contents, "pub const subsystem = SubSystem.%s;\n", subsystem_strings[TargetSubsystemConsole - 1]); } else if (g->have_winmain || g->have_winmain_crt_startup) { buf_appendf(contents, "pub const subsystem = SubSystem.%s;\n", subsystem_strings[TargetSubsystemWindows - 1]); - } else if (g->have_dllmain_crt_startup || g->out_type == OutTypeLib) { - buf_appendf(contents, "pub const subsystem = null;\n"); } } else { buf_appendf(contents, "pub const subsystem = SubSystem.%s;\n", subsystem_strings[g->subsystem - 1]);