mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 05:44:20 +00:00
langref: Update calling convention (#24022)
* langref: Update calling convention * Apply suggestions from code review Co-authored-by: Alex Rønne Petersen <alex@alexrp.com> * langref: Just use .winapi directly --------- Co-authored-by: Alex Rønne Petersen <alex@alexrp.com>
This commit is contained in:
parent
4641e9556d
commit
561ab59cec
1 changed files with 1 additions and 2 deletions
|
|
@ -23,8 +23,7 @@ export fn sub(a: i8, b: i8) i8 {
|
||||||
// dynamically. The quoted identifier after the extern keyword specifies
|
// dynamically. The quoted identifier after the extern keyword specifies
|
||||||
// the library that has the function. (e.g. "c" -> libc.so)
|
// the library that has the function. (e.g. "c" -> libc.so)
|
||||||
// The callconv specifier changes the calling convention of the function.
|
// The callconv specifier changes the calling convention of the function.
|
||||||
const WINAPI: std.builtin.CallingConvention = if (native_arch == .x86) .Stdcall else .C;
|
extern "kernel32" fn ExitProcess(exit_code: u32) callconv(.winapi) noreturn;
|
||||||
extern "kernel32" fn ExitProcess(exit_code: u32) callconv(WINAPI) noreturn;
|
|
||||||
extern "c" fn atan2(a: f64, b: f64) f64;
|
extern "c" fn atan2(a: f64, b: f64) f64;
|
||||||
|
|
||||||
// The @branchHint builtin can be used to tell the optimizer that a function is rarely called ("cold").
|
// The @branchHint builtin can be used to tell the optimizer that a function is rarely called ("cold").
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue