Alex Bradbury wrote:
Initially, this option appeals to me. However, don't cdecl and stdcall refer to x86 calling conventions? On ARM you'd be aliasing cdecl to aapcs to have the intended meaning.
Hmm, that's a very good point. For some reason I was under the impression `cdecl` was a "cross-platform" moniker for "whatever the C compiler does". But even if that were true—and I think I was mistaken—there is the question about something like `stdcall`.
One option is just to have the set of ABIs vary by target architecture. We definitely would want one (`C`?) that means "whatever the C compiler does", but beyond that #[cfg] directives and typedefs would be needed.
Another option is to have all the Rust ABI-ish names have meaning on all platforms. So `C` might map to `cdecl` on x86 and `aapcs` on ARM, and likewise `Pascal` (or whatever) might map to `stdcall` on x86 and `aapcs` on ARM (presuming that anyone wanted to call obscure Windows APIs on ARM...).
I lean towards the first option at the moment mostly because I worry that we won't be able to come up with smart names and consistent meanings across platforms for all ABIs we may someday want to support. Plus I don't claim any sort of encyclopedic knowledge about this sort of thing so I know I shouldn't be the one to create such a catalog. :)
Niko _______________________________________________ Rust-dev mailing list [email protected] https://mail.mozilla.org/listinfo/rust-dev
