From 561ab59ceccb18c8a26b91292cf034556c6b0e4d Mon Sep 17 00:00:00 2001 From: Felix Rabe Date: Fri, 30 May 2025 03:11:00 +0200 Subject: [PATCH] langref: Update calling convention (#24022) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * langref: Update calling convention * Apply suggestions from code review Co-authored-by: Alex Rønne Petersen * langref: Just use .winapi directly --------- Co-authored-by: Alex Rønne Petersen --- doc/langref/test_functions.zig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/langref/test_functions.zig b/doc/langref/test_functions.zig index 2bb36c575a..7b70961ab3 100644 --- a/doc/langref/test_functions.zig +++ b/doc/langref/test_functions.zig @@ -23,8 +23,7 @@ export fn sub(a: i8, b: i8) i8 { // dynamically. The quoted identifier after the extern keyword specifies // the library that has the function. (e.g. "c" -> libc.so) // 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; // The @branchHint builtin can be used to tell the optimizer that a function is rarely called ("cold").