| ... | @@ -23,8 +23,7 @@ export fn sub(a: i8, b: i8) i8 { | ... | @@ -23,8 +23,7 @@ export fn sub(a: i8, b: i8) i8 { |
| 23 | // dynamically. The quoted identifier after the extern keyword specifies | 23 | // dynamically. The quoted identifier after the extern keyword specifies |
| 24 | // the library that has the function. (e.g. "c" -> libc.so) | 24 | // the library that has the function. (e.g. "c" -> libc.so) |
| 25 | // The callconv specifier changes the calling convention of the function. | 25 | // The callconv specifier changes the calling convention of the function. |
| 26 | const WINAPI: std.builtin.CallingConvention = if (native_arch == .x86) .Stdcall else .C; | 26 | extern "kernel32" fn ExitProcess(exit_code: u32) callconv(.winapi) noreturn; |
| 27 | extern "kernel32" fn ExitProcess(exit_code: u32) callconv(WINAPI) noreturn; | | |
| 28 | extern "c" fn atan2(a: f64, b: f64) f64; | 27 | extern "c" fn atan2(a: f64, b: f64) f64; |
| 29 | | 28 | |
| 30 | // The @branchHint builtin can be used to tell the optimizer that a function is rarely called ("cold"). | 29 | // The @branchHint builtin can be used to tell the optimizer that a function is rarely called ("cold"). |