mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
langref: Documented extern "..." use
The use of `extern "..."` for specifying the library that has the definition was undocumented. Fixes #13906
This commit is contained in:
parent
b643c5dc91
commit
14c68e847a
1 changed files with 2 additions and 1 deletions
|
|
@ -5184,7 +5184,8 @@ export fn sub(a: i8, b: i8) i8 { return a - b; }
|
||||||
|
|
||||||
// The extern specifier is used to declare a function that will be resolved
|
// The extern specifier is used to declare a function that will be resolved
|
||||||
// at link time, when linking statically, or at runtime, when linking
|
// at link time, when linking statically, or at runtime, when linking
|
||||||
// dynamically.
|
// 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.
|
// The callconv specifier changes the calling convention of the function.
|
||||||
const WINAPI: std.builtin.CallingConvention = if (native_arch == .x86) .Stdcall else .C;
|
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;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue