aboutsummaryrefslogtreecommitdiff
path: root/lib/std/start.zig
diff options
context:
space:
mode:
authormlugg <mlugg@mlugg.co.uk>2024-08-26 03:49:36 +0100
committermlugg <mlugg@mlugg.co.uk>2024-08-27 00:44:35 +0100
commita3a737e9a68fae96519743a644209b4a30cf3b58 (patch)
tree361a08a2386a880ac7ef03e3f27dd90fe8a84cce /lib/std/start.zig
parent22f65c3dd593bc8dd1ec88adf3f3dbbc0eca49a8 (diff)
downloadzig-a3a737e9a68fae96519743a644209b4a30cf3b58.tar.gz
zig-a3a737e9a68fae96519743a644209b4a30cf3b58.zip
lib,test,tools,doc: update usages of @export
Diffstat (limited to 'lib/std/start.zig')
-rw-r--r--lib/std/start.zig26
1 files changed, 13 insertions, 13 deletions
diff --git a/lib/std/start.zig b/lib/std/start.zig
index e899e80568..4716b7df03 100644
--- a/lib/std/start.zig
+++ b/lib/std/start.zig
@@ -31,38 +31,38 @@ comptime {
if (builtin.output_mode == .Exe) {
if ((builtin.link_libc or builtin.object_format == .c) and @hasDecl(root, "main")) {
if (@typeInfo(@TypeOf(root.main)).Fn.calling_convention != .C) {
- @export(main2, .{ .name = "main" });
+ @export(&main2, .{ .name = "main" });
}
} else if (builtin.os.tag == .windows) {
if (!@hasDecl(root, "wWinMainCRTStartup") and !@hasDecl(root, "mainCRTStartup")) {
- @export(wWinMainCRTStartup2, .{ .name = "wWinMainCRTStartup" });
+ @export(&wWinMainCRTStartup2, .{ .name = "wWinMainCRTStartup" });
}
} else if (builtin.os.tag == .opencl) {
if (@hasDecl(root, "main"))
- @export(spirvMain2, .{ .name = "main" });
+ @export(&spirvMain2, .{ .name = "main" });
} else {
if (!@hasDecl(root, "_start")) {
- @export(_start2, .{ .name = "_start" });
+ @export(&_start2, .{ .name = "_start" });
}
}
}
} else {
if (builtin.output_mode == .Lib and builtin.link_mode == .dynamic) {
if (native_os == .windows and !@hasDecl(root, "_DllMainCRTStartup")) {
- @export(_DllMainCRTStartup, .{ .name = "_DllMainCRTStartup" });
+ @export(&_DllMainCRTStartup, .{ .name = "_DllMainCRTStartup" });
}
} else if (builtin.output_mode == .Exe or @hasDecl(root, "main")) {
if (builtin.link_libc and @hasDecl(root, "main")) {
if (native_arch.isWasm()) {
- @export(mainWithoutEnv, .{ .name = "main" });
+ @export(&mainWithoutEnv, .{ .name = "main" });
} else if (@typeInfo(@TypeOf(root.main)).Fn.calling_convention != .C) {
- @export(main, .{ .name = "main" });
+ @export(&main, .{ .name = "main" });
}
} else if (native_os == .windows) {
if (!@hasDecl(root, "WinMain") and !@hasDecl(root, "WinMainCRTStartup") and
!@hasDecl(root, "wWinMain") and !@hasDecl(root, "wWinMainCRTStartup"))
{
- @export(WinStartup, .{ .name = "wWinMainCRTStartup" });
+ @export(&WinStartup, .{ .name = "wWinMainCRTStartup" });
} else if (@hasDecl(root, "WinMain") and !@hasDecl(root, "WinMainCRTStartup") and
!@hasDecl(root, "wWinMain") and !@hasDecl(root, "wWinMainCRTStartup"))
{
@@ -70,10 +70,10 @@ comptime {
} else if (@hasDecl(root, "wWinMain") and !@hasDecl(root, "wWinMainCRTStartup") and
!@hasDecl(root, "WinMain") and !@hasDecl(root, "WinMainCRTStartup"))
{
- @export(wWinMainCRTStartup, .{ .name = "wWinMainCRTStartup" });
+ @export(&wWinMainCRTStartup, .{ .name = "wWinMainCRTStartup" });
}
} else if (native_os == .uefi) {
- if (!@hasDecl(root, "EfiMain")) @export(EfiMain, .{ .name = "EfiMain" });
+ if (!@hasDecl(root, "EfiMain")) @export(&EfiMain, .{ .name = "EfiMain" });
} else if (native_os == .wasi) {
const wasm_start_sym = switch (builtin.wasi_exec_model) {
.reactor => "_initialize",
@@ -82,14 +82,14 @@ comptime {
if (!@hasDecl(root, wasm_start_sym) and @hasDecl(root, "main")) {
// Only call main when defined. For WebAssembly it's allowed to pass `-fno-entry` in which
// case it's not required to provide an entrypoint such as main.
- @export(wasi_start, .{ .name = wasm_start_sym });
+ @export(&wasi_start, .{ .name = wasm_start_sym });
}
} else if (native_arch.isWasm() and native_os == .freestanding) {
// Only call main when defined. For WebAssembly it's allowed to pass `-fno-entry` in which
// case it's not required to provide an entrypoint such as main.
- if (!@hasDecl(root, start_sym_name) and @hasDecl(root, "main")) @export(wasm_freestanding_start, .{ .name = start_sym_name });
+ if (!@hasDecl(root, start_sym_name) and @hasDecl(root, "main")) @export(&wasm_freestanding_start, .{ .name = start_sym_name });
} else if (native_os != .other and native_os != .freestanding) {
- if (!@hasDecl(root, start_sym_name)) @export(_start, .{ .name = start_sym_name });
+ if (!@hasDecl(root, start_sym_name)) @export(&_start, .{ .name = start_sym_name });
}
}
}