Description
openedon Oct 5, 2014
Hi.
After some questions on IRC I think this might be a bug or at least a missing feature:
I'd like to export functions with a name of my choosing. I knew about #[no_mangle] and learned about #[export_name] on IRC, but both fail to work in my case.
Code/test.rs:
pub extern "stdcall" fn stdcall() {
}
#[no_mangle]
pub extern "stdcall" fn stdcall_nomangle() {
}
#[export_name="stdcall_export"]
pub extern "stdcall" fn stdcall_exportname() {
}
pub extern "C" fn c() {
}
#[no_mangle]
pub extern "C" fn c_nomangle() {
}
#[export_name="c_export"]
pub extern "C" fn c_exportname() {
}
Build with rustc --cratetype dylib test.rs
So, every single stdcall entry point follows the name@sizeofarguments convention. I have a number of DLLs right in front of me (not based on rust) that export stdcall entries and DON'T use that convention. In fact, I'm reasonably sure that most of the windows API is both using stdcall and exporting 'unmangled' names.
Can I create something similar with rust? Am I missing another attribute? Should no_mangle work in these cases? Should export_name?