authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-12-03 13:10:26-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-12-03 13:10:26-05:00
log8db4d2332e62ba31412b28e725f4c4ae3b7dd801
tree5e133da5eb01424b0c0634029b191d83d485bf79
parenta91f55239369b4401aaa50a74ed939f5eb98395d
signature Commit is signed but in an unrecognized format.

correct startup logic for exporting libc main


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

lib/std/special/start.zig+4-4
......@@ -24,10 +24,10 @@ comptime {
2424 @export("_DllMainCRTStartup", _DllMainCRTStartup, .Strong);
2525 }
2626 } else if (builtin.output_mode == .Exe or @hasDecl(root, "main")) {
27 if (builtin.link_libc and @hasDecl(root, "main") and
28 @typeInfo(@typeOf(root.main)).Fn.calling_convention != .C)
29 {
30 @export("main", main, .Weak);
27 if (builtin.link_libc and @hasDecl(root, "main")) {
28 if (@typeInfo(@typeOf(root.main)).Fn.calling_convention != .C) {
29 @export("main", main, .Weak);
30 }
3131 } else if (builtin.os == .windows) {
3232 if (!@hasDecl(root, "WinMain") and !@hasDecl(root, "WinMainCRTStartup")) {
3333 @export("WinMainCRTStartup", WinMainCRTStartup, .Strong);