#abi #extern

yanked extern_attrib

Rust automatic ABI attribute macro: #[extern_auto]

Uses old Rust 2015

0.2.0 May 21, 2017
0.1.0 May 20, 2017

#29 in #extern

MIT license

5KB

extern_attrib

Rust automatic ABI attribute macro: #[extern_auto]

The purpose of this library is to replace or insert the ABI name at compile time for functions. This is useful for hiding the calling convention for FFI callbacks while avoiding code duplication.

  • Requires nightly rust, depends on #[proc_macro_attribute].
  • Currenly only handles target_os = "windows" / "macos" / "linux".
  • See the tests/tests.rs for a usage example.
  • Pull Requests Welcome!

lib.rs:

extern_attrib

Rust automatic ABI attribute macro: #[extern_auto]

The purpose of this library is to replace or insert the ABI name at compile time for functions. This is useful for hiding the calling convention for FFI callbacks while avoiding code duplication.

  • Requires nightly rust, depends on #[proc_macro_attribute].
  • Currenly only handles target_os = "windows" / "macos" / "linux".
  • See the tests/tests.rs for a usage example.
  • Pull Requests Welcome!

TODO: Investigate how error handling should best be done in procedural macros. TODO: Investigate if rustc interprets "stdcall" as "C" for x64.

Dependencies

~2MB
~42K SLoC