authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2021-05-13 18:34:52+02:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-05-13 17:24:32-04:00
log1b222cb1ff6b95be2f8b03a0ae872efcc7873aa6
tree9ffd4e7e0de10d115de9498efbd30198076e83da
parent402264ab0e16dfdc98e861a440df9ef5db35c402

start.zig: export main with strong linkage

Unmarks `_main` as weak symbol making it global (the entire linked program) in scope.

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

lib/std/start.zig+1-1
...@@ -40,7 +40,7 @@ comptime {...@@ -40,7 +40,7 @@ comptime {
40 } else if (builtin.output_mode == .Exe or @hasDecl(root, "main")) {40 } else if (builtin.output_mode == .Exe or @hasDecl(root, "main")) {
41 if (builtin.link_libc and @hasDecl(root, "main")) {41 if (builtin.link_libc and @hasDecl(root, "main")) {
42 if (@typeInfo(@TypeOf(root.main)).Fn.calling_convention != .C) {42 if (@typeInfo(@TypeOf(root.main)).Fn.calling_convention != .C) {
43 @export(main, .{ .name = "main", .linkage = .Weak });43 @export(main, .{ .name = "main" });
44 }44 }
45 } else if (builtin.os.tag == .windows) {45 } else if (builtin.os.tag == .windows) {
46 if (!@hasDecl(root, "WinMain") and !@hasDecl(root, "WinMainCRTStartup") and46 if (!@hasDecl(root, "WinMain") and !@hasDecl(root, "WinMainCRTStartup") and