Skip to content

Commit 7443168

Browse files
committed
Use extern "C" instead of extern "cdecl"
1 parent 1c1e563 commit 7443168

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

crates/libs/bindgen/src/tables/method_def.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ impl MethodDef {
5151
if flags.contains(PInvokeAttributes::CallConvPlatformapi) {
5252
"system"
5353
} else if flags.contains(PInvokeAttributes::CallConvCdecl) {
54-
"cdecl"
54+
"C"
5555
} else {
5656
""
5757
}

crates/libs/link/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ macro_rules! link {
3232
#[macro_export]
3333
macro_rules! link {
3434
($library:literal $abi:literal $($link_name:literal)? fn $($function:tt)*) => (
35-
extern $abi {
35+
extern "C" {
3636
pub fn $($function)*;
3737
}
3838
)

crates/libs/targets/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ macro_rules! link {
4545
#[macro_export]
4646
macro_rules! link {
4747
($library:literal $abi:literal $($link_name:literal)? fn $($function:tt)*) => (
48-
extern $abi {
48+
extern "C" {
4949
pub fn $($function)*;
5050
}
5151
)

crates/tests/misc/standalone/src/b_std.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ windows_link::link!("kernel32.dll" "system" fn CloseHandle(hobject : HANDLE) ->
1010
windows_link::link!("kernel32.dll" "system" fn GetLastError() -> WIN32_ERROR);
1111
windows_link::link!("advapi32.dll" "system" "SystemFunction036" fn RtlGenRandom(randombuffer : *mut core::ffi::c_void, randombufferlength : u32) -> bool);
1212
windows_link::link!("ws2_32.dll" "system" fn socket(af : i32, r#type : WINSOCK_SOCKET_TYPE, protocol : i32) -> SOCKET);
13-
windows_link::link!("user32.dll" "cdecl" fn wsprintfA(param0 : PSTR, param1 : PCSTR, ...) -> i32);
13+
windows_link::link!("user32.dll" "C" fn wsprintfA(param0 : PSTR, param1 : PCSTR, ...) -> i32);
1414
pub type BCRYPT_ALG_HANDLE = *mut core::ffi::c_void;
1515
pub type BCRYPT_HANDLE = *mut core::ffi::c_void;
1616
pub type BOOL = i32;

crates/tests/misc/standalone/src/b_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ windows_link::link!("ole32.dll" "system" fn CoCreateInstance(rclsid : *const GUI
1111
windows_link::link!("kernel32.dll" "system" fn CreateEventW(lpeventattributes : *const SECURITY_ATTRIBUTES, bmanualreset : BOOL, binitialstate : BOOL, lpname : PCWSTR) -> HANDLE);
1212
windows_link::link!("kernel32.dll" "system" fn SetEvent(hevent : HANDLE) -> BOOL);
1313
windows_link::link!("kernel32.dll" "system" fn WaitForSingleObject(hhandle : HANDLE, dwmilliseconds : u32) -> WAIT_EVENT);
14-
windows_link::link!("user32.dll" "cdecl" fn wsprintfA(param0 : PSTR, param1 : PCSTR, ...) -> i32);
14+
windows_link::link!("user32.dll" "C" fn wsprintfA(param0 : PSTR, param1 : PCSTR, ...) -> i32);
1515
pub type BOOL = i32;
1616
pub type CLSCTX = u32;
1717
pub const CLSCTX_ALL: CLSCTX = 23u32;

0 commit comments

Comments
 (0)