authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2017-10-14 20:12:15-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2017-10-14 20:12:15-04:00
logfd7654e4e80f59e18bfaf7ba4872fefcd74feeb5
treea7f7582bc03d4f0a562dfef581613412641474a3
parentf54aff46721b04fe43b645f27d3c4dbb8d2cc74d

build-exe allows direct export of WinMainCRTStartup


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

src/all_types.hpp+1
......@@ -1455,6 +1455,7 @@ struct CodeGen {
14551455 bool have_pub_main;
14561456 bool have_c_main;
14571457 bool have_winmain;
1458 bool have_winmain_crt_startup;
14581459 bool have_pub_panic;
14591460 Buf *libc_lib_dir;
14601461 Buf *libc_static_lib_dir;
src/analyze.cpp+4
......@@ -3196,6 +3196,10 @@ ImportTableEntry *add_source_file(CodeGen *g, PackageTableEntry *package, Buf *a
31963196 g->have_winmain = true;
31973197 g->windows_subsystem_windows = true;
31983198 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;
31993203 }
32003204
32013205 }
src/codegen.cpp+2-1
......@@ -5213,7 +5213,8 @@ static void gen_root_source(CodeGen *g) {
52135213 assert(g->root_out_name);
52145214 assert(g->out_type != OutTypeUnknown);
52155215
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 &&
52175218 ((g->have_pub_main && g->out_type == OutTypeObj) || g->out_type == OutTypeExe))
52185219 {
52195220 g->bootstrap_import = add_special_code(g, create_bootstrap_pkg(g, g->root_package), "bootstrap.zig");