Closed

Description
Some cross-platform libraries use different calling conventions on different platform. For example, OpenGL uses cdecl on *nix, and stdcall on Windows. Writing wrappers for these libraries is currently troublesome, as it requires special-casing the calling convention in Rust code.
I propose adding an ABI alias called "system" which could be used in extern declarations, in place of "stdcall", "cdecl", etc. It would map to whichever calling convention is default on the specific platform.
Thus one could say, e.g.:
pub type GLDEBUGPROC = extern "system" fn(...);
Rather than:
#[cfg(target_os = "win32")]
pub type GLDEBUGPROC = extern "stdcall" fn(...);
#[cfg(not(target_os = "win32"))]
pub type GLDEBUGPROC = extern "cdecl" fn(...);
Metadata
Metadata
Assignees
Labels
No labels