diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2020-01-06 18:53:17 -0500 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2020-01-06 18:53:17 -0500 |
| commit | 633b6bf92055a62f8a18dbfdb1ddc4f7330bf4ec (patch) | |
| tree | 3be9c09b1e6c0c3aff43fdc3d6d98948756de023 /lib/std/start.zig | |
| parent | 4e6ad8efd9fcefb820acf4a03fc4ab9157f85c1b (diff) | |
| parent | c0e8837ce9168088e89bfeef9516d7318cd5f97d (diff) | |
| download | zig-633b6bf92055a62f8a18dbfdb1ddc4f7330bf4ec.tar.gz zig-633b6bf92055a62f8a18dbfdb1ddc4f7330bf4ec.zip | |
Merge branch 'LemonBoy-cc-work'
Diffstat (limited to 'lib/std/start.zig')
| -rw-r--r-- | lib/std/start.zig | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/lib/std/start.zig b/lib/std/start.zig index 3c46449949..7c1353e18b 100644 --- a/lib/std/start.zig +++ b/lib/std/start.zig @@ -43,11 +43,7 @@ comptime { } } -stdcallcc fn _DllMainCRTStartup( - hinstDLL: std.os.windows.HINSTANCE, - fdwReason: std.os.windows.DWORD, - lpReserved: std.os.windows.LPVOID, -) std.os.windows.BOOL { +fn _DllMainCRTStartup(hinstDLL: std.os.windows.HINSTANCE, fdwReason: std.os.windows.DWORD, lpReserved: std.os.windows.LPVOID) callconv(.Stdcall) std.os.windows.BOOL { if (@hasDecl(root, "DllMain")) { return root.DllMain(hinstDLL, fdwReason, lpReserved); } @@ -55,13 +51,13 @@ stdcallcc fn _DllMainCRTStartup( return std.os.windows.TRUE; } -extern fn wasm_freestanding_start() void { +fn wasm_freestanding_start() callconv(.C) void { // This is marked inline because for some reason LLVM in release mode fails to inline it, // and we want fewer call frames in stack traces. _ = @call(.{ .modifier = .always_inline }, callMain, .{}); } -extern fn EfiMain(handle: uefi.Handle, system_table: *uefi.tables.SystemTable) usize { +fn EfiMain(handle: uefi.Handle, system_table: *uefi.tables.SystemTable) callconv(.C) usize { const bad_efi_main_ret = "expected return type of main to be 'void', 'noreturn', or 'usize'"; uefi.handle = handle; uefi.system_table = system_table; @@ -84,7 +80,7 @@ extern fn EfiMain(handle: uefi.Handle, system_table: *uefi.tables.SystemTable) u } } -nakedcc fn _start() noreturn { +fn _start() callconv(.Naked) noreturn { if (builtin.os == builtin.Os.wasi) { // This is marked inline because for some reason LLVM in release mode fails to inline it, // and we want fewer call frames in stack traces. @@ -127,7 +123,7 @@ nakedcc fn _start() noreturn { @call(.{ .modifier = .never_inline }, posixCallMainAndExit, .{}); } -stdcallcc fn WinMainCRTStartup() noreturn { +fn WinMainCRTStartup() callconv(.Stdcall) noreturn { @setAlignStack(16); if (!builtin.single_threaded) { _ = @import("start_windows_tls.zig"); @@ -198,7 +194,7 @@ fn callMainWithArgs(argc: usize, argv: [*][*:0]u8, envp: [][*:0]u8) u8 { return initEventLoopAndCallMain(); } -extern fn main(c_argc: i32, c_argv: [*][*:0]u8, c_envp: [*:null]?[*:0]u8) i32 { +fn main(c_argc: i32, c_argv: [*][*:0]u8, c_envp: [*:null]?[*:0]u8) callconv(.C) i32 { var env_count: usize = 0; while (c_envp[env_count] != null) : (env_count += 1) {} const envp = @ptrCast([*][*:0]u8, c_envp)[0..env_count]; |
