mirror of
https://github.com/ziglang/zig.git
synced 2026-01-20 14:25:16 +00:00
start.zig: export main with strong linkage
Unmarks `_main` as weak symbol making it global (the entire linked program) in scope.
This commit is contained in:
parent
402264ab0e
commit
1b222cb1ff
@ -40,7 +40,7 @@ comptime {
|
||||
} else if (builtin.output_mode == .Exe or @hasDecl(root, "main")) {
|
||||
if (builtin.link_libc and @hasDecl(root, "main")) {
|
||||
if (@typeInfo(@TypeOf(root.main)).Fn.calling_convention != .C) {
|
||||
@export(main, .{ .name = "main", .linkage = .Weak });
|
||||
@export(main, .{ .name = "main" });
|
||||
}
|
||||
} else if (builtin.os.tag == .windows) {
|
||||
if (!@hasDecl(root, "WinMain") and !@hasDecl(root, "WinMainCRTStartup") and
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user