使用旧的 Rust 2015
0.2.0 |
|
---|---|
0.1.0 |
|
#30 在 #extern
5KB
extern_attrib
Rust 自动 ABI 属性宏:#[extern_auto]
此库的目的是在编译时替换或插入函数的 ABI 名称。这对于隐藏 FFI 回调的调用约定同时避免代码重复非常有用。
- 需要 nightly rust,依赖于 #[proc_macro_attribute]。
- 目前仅处理 target_os = "windows" / "macos" / "linux"。
- 请参阅 tests/tests.rs 以获取使用示例。
- 欢迎提交拉取请求!
lib.rs
:
extern_attrib
Rust 自动 ABI 属性宏:#[extern_auto]
此库的目的是在编译时替换或插入函数的 ABI 名称。这对于隐藏 FFI 回调的调用约定同时避免代码重复非常有用。
- 需要 nightly rust,依赖于 #[proc_macro_attribute]。
- 目前仅处理 target_os = "windows" / "macos" / "linux"。
- 请参阅 tests/tests.rs 以获取使用示例。
- 欢迎提交拉取请求!
TODO: 研究如何在过程宏中最佳地处理错误处理。TODO: 研究rustc是否将 "stdcall" 解释为 x64 的 "C"。
依赖关系
~1.5MB
~41K SLoC