Skip to content

Commit 0d04348

Browse files
committed
set subsystem to null if not on windows or uefi
1 parent eda0a00 commit 0d04348

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/codegen.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7899,13 +7899,13 @@ Buf *codegen_generate_builtin_source(CodeGen *g) {
78997899
"EfiRuntimeDriver",
79007900
};
79017901

7902-
if (g->subsystem == TargetSubsystemAuto) {
7902+
if (g->zig_target->os != OsWindows || g->zig_target->os != OsUefi || g->have_dllmain_crt_startup || g->out_type == OutTypeLib) {
7903+
buf_appendf(contents, "pub const subsystem = null;\n");
7904+
} else if (g->subsystem == TargetSubsystemAuto) {
79037905
if (g->have_c_main || g->have_pub_main) {
79047906
buf_appendf(contents, "pub const subsystem = SubSystem.%s;\n", subsystem_strings[TargetSubsystemConsole - 1]);
79057907
} else if (g->have_winmain || g->have_winmain_crt_startup) {
79067908
buf_appendf(contents, "pub const subsystem = SubSystem.%s;\n", subsystem_strings[TargetSubsystemWindows - 1]);
7907-
} else if (g->have_dllmain_crt_startup || g->out_type == OutTypeLib) {
7908-
buf_appendf(contents, "pub const subsystem = null;\n");
79097909
}
79107910
} else {
79117911
buf_appendf(contents, "pub const subsystem = SubSystem.%s;\n", subsystem_strings[g->subsystem - 1]);

0 commit comments

Comments
 (0)