Biohazrd icon indicating copy to clipboard operation
Biohazrd copied to clipboard

Detect x86 calling convention when building for x64

Open PathogenDavid opened this issue 3 years ago • 1 comments

For our purposes, calling convention attributes are really only relevant on x86. Clang knows this and returns cdecl for everything even if it's marked as stdcall/etc when building for x64 targets.

We should try to extract the x86 calling convention from the attributes even on x64 so that we emit function pointers with the correct calling convention. That way developers implementing UnmanagedCallersOnly functions don't have to worry about their function only working with one architecture.

We also might consider exposing an option to skip emitting calling convention information entirely since the .NET unmanaged default is generally suitable.

PathogenDavid avatar Jan 22 '21 02:01 PathogenDavid

There's a chance this is exposed by PathogenArrangedFunction, but I've not had a chance to check whether or not it has the same issue.

PathogenDavid avatar Jul 04 '21 13:07 PathogenDavid