Add (Docs) -> Added doc for newly added callconv attribute

pull/14027/head
Shib 2022-04-13 12:03:33 +02:00
parent 77efa1f074
commit 5be88d97ae
1 changed files with 31 additions and 26 deletions

View File

@ -5978,10 +5978,15 @@ fn custom_allocations() {
struct C.Foo {
}
// Used in Win32 API code when you need to pass callback function
[windows_stdcall]
// Used to add a custom calling convention to a function, available calling convention: stdcall, fastcall and cdecl.
// This list aslo apply for type aliases (see below).
[callconv: "stdcall"]
fn C.DefWindowProc(hwnd int, msg int, lparam int, wparam int)
// Used to add a custom calling convention to a function type aliases.
[callconv: "fastcall"]
type FastFn = fn (int) bool
// Windows only:
// If a default graphics library is imported (ex. gg, ui), then the graphical window takes
// priority and no console window is created, effectively disabling println() statements.