| author | |
| committer | |
| log | fd7654e4e80f59e18bfaf7ba4872fefcd74feeb5 |
| tree | a7f7582bc03d4f0a562dfef581613412641474a3 |
| parent | f54aff46721b04fe43b645f27d3c4dbb8d2cc74d |
3 files changed, 7 insertions(+), 1 deletions(-)
src/all_types.hpp+1| ... | @@ -1455,6 +1455,7 @@ struct CodeGen { | ... | @@ -1455,6 +1455,7 @@ struct CodeGen { |
| 1455 | bool have_pub_main; | 1455 | bool have_pub_main; |
| 1456 | bool have_c_main; | 1456 | bool have_c_main; |
| 1457 | bool have_winmain; | 1457 | bool have_winmain; |
| 1458 | bool have_winmain_crt_startup; | ||
| 1458 | bool have_pub_panic; | 1459 | bool have_pub_panic; |
| 1459 | Buf *libc_lib_dir; | 1460 | Buf *libc_lib_dir; |
| 1460 | Buf *libc_static_lib_dir; | 1461 | Buf *libc_static_lib_dir; |
src/analyze.cpp+4| ... | @@ -3196,6 +3196,10 @@ ImportTableEntry *add_source_file(CodeGen *g, PackageTableEntry *package, Buf *a | ... | @@ -3196,6 +3196,10 @@ ImportTableEntry *add_source_file(CodeGen *g, PackageTableEntry *package, Buf *a |
| 3196 | g->have_winmain = true; | 3196 | g->have_winmain = true; |
| 3197 | g->windows_subsystem_windows = true; | 3197 | g->windows_subsystem_windows = true; |
| 3198 | g->windows_subsystem_console = false; | 3198 | g->windows_subsystem_console = false; |
| 3199 | } else if (proto_node->data.fn_proto.visib_mod == VisibModExport && | ||
| 3200 | buf_eql_str(proto_name, "WinMainCRTStartup") && g->zig_target.os == ZigLLVM_Win32) | ||
| 3201 | { | ||
| 3202 | g->have_winmain_crt_startup = true; | ||
| 3199 | } | 3203 | } |
| 3200 | 3204 | ||
| 3201 | } | 3205 | } |
src/codegen.cpp+2-1| ... | @@ -5213,7 +5213,8 @@ static void gen_root_source(CodeGen *g) { | ... | @@ -5213,7 +5213,8 @@ static void gen_root_source(CodeGen *g) { |
| 5213 | assert(g->root_out_name); | 5213 | assert(g->root_out_name); |
| 5214 | assert(g->out_type != OutTypeUnknown); | 5214 | assert(g->out_type != OutTypeUnknown); |
| 5215 | 5215 | ||
| 5216 | if (!g->is_test_build && g->zig_target.os != ZigLLVM_UnknownOS && !g->have_c_main && !g->have_winmain && | 5216 | if (!g->is_test_build && g->zig_target.os != ZigLLVM_UnknownOS && |
| 5217 | !g->have_c_main && !g->have_winmain && !g->have_winmain_crt_startup && | ||
| 5217 | ((g->have_pub_main && g->out_type == OutTypeObj) || g->out_type == OutTypeExe)) | 5218 | ((g->have_pub_main && g->out_type == OutTypeObj) || g->out_type == OutTypeExe)) |
| 5218 | { | 5219 | { |
| 5219 | g->bootstrap_import = add_special_code(g, create_bootstrap_pkg(g, g->root_package), "bootstrap.zig"); | 5220 | g->bootstrap_import = add_special_code(g, create_bootstrap_pkg(g, g->root_package), "bootstrap.zig"); |