#cross-compilation #abi #extern

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

#17 in #cross-compilation

Download history 97/week @ 2024-06-27 55/week @ 2024-07-04 47/week @ 2024-07-11 83/week @ 2024-07-18 60/week @ 2024-07-25 30/week @ 2024-08-01 23/week @ 2024-08-08 12/week @ 2024-08-15 9/week @ 2024-08-22 14/week @ 2024-08-29 22/week @ 2024-09-05 27/week @ 2024-09-12 36/week @ 2024-09-19 36/week @ 2024-09-26 14/week @ 2024-10-03 5/week @ 2024-10-10

94 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
~36K SLoC