#abi #cross-compilation #extern #macro #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

#4 in #extern

Download history 36/week @ 2023-01-27 30/week @ 2023-02-03 40/week @ 2023-02-10 61/week @ 2023-02-17 47/week @ 2023-02-24 25/week @ 2023-03-03 20/week @ 2023-03-10 25/week @ 2023-03-17 6/week @ 2023-03-24 24/week @ 2023-03-31 25/week @ 2023-04-07 13/week @ 2023-04-14 14/week @ 2023-04-21 37/week @ 2023-04-28 44/week @ 2023-05-05 15/week @ 2023-05-12

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

MIT license

6KB
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

~0.9–1.2MB
~30K SLoC