#abi #extern #macro #cross-compilation #calling-convention

macro fn_abi

A proc attribute macro that sets the ABI/calling convention for the attributed function

2 stable releases

3.0.0 Mar 7, 2022
2.0.1 Sep 27, 2021
0.1.2 Sep 26, 2021
0.1.1 Sep 24, 2021
0.1.0 Sep 23, 2021

#16 in #cross-compilation

Download history 10/week @ 2024-11-15 22/week @ 2024-11-22 24/week @ 2024-11-29 55/week @ 2024-12-06 41/week @ 2024-12-13 13/week @ 2024-12-20 1/week @ 2024-12-27 13/week @ 2025-01-03 33/week @ 2025-01-10 32/week @ 2025-01-17 19/week @ 2025-01-24 30/week @ 2025-01-31 33/week @ 2025-02-07 34/week @ 2025-02-14 58/week @ 2025-02-21 25/week @ 2025-02-28

160 downloads per month
Used in 2 crates (via gmod)

MIT license

7KB
91 lines

crates.io

fn_abi

A proc attribute macro that sets the ABI/calling convention for the attributed function.

Example

#[macro_use] extern crate fn_abi;

#[abi("fastcall")]
extern fn hello_world_fastcall() {
    println!("hello world!");
}

#[cfg_attr(all(target_os = "windows", target_pointer_width = "32"), abi("thiscall"))]
#[cfg_attr(all(target_os = "windows", target_pointer_width = "64"), abi("fastcall"))]
extern fn hello_world_windows() {
    println!("hello world!");
}

lib.rs:

fn_abi

A proc attribute macro that sets the ABI/calling convention for the attributed function.

Example

#[macro_use] extern crate fn_abi;

#[abi("fastcall")]
extern fn hello_world_fastcall() {
    println!("hello world!");
}

#[cfg_attr(all(target_os = "windows", target_pointer_width = "32"), abi("thiscall"))]
#[cfg_attr(all(target_os = "windows", target_pointer_width = "64"), abi("fastcall"))]
extern fn hello_world_windows() {
    println!("hello world!");
}

Dependencies

~1.5MB
~38K SLoC