Open Susko3 opened 7 months ago
Yes, this is correct for .NET 5+. Before .NET 5+, it could not be done. I have the type information of the calling convention but didn't update the C# code generator to use said information when adding function pointer support.
The SDL definition notably includes
SDLCALL
, which is defined as__cdecl
.So this should map to the following C# type (notice the
[Cdecl]
): ClangSharpPInvokeGenerator correctly generates this definition.Current code: https://github.com/bottlenoselabs/SDL-cs/blob/158a06cccd26a36ac37dc001733d40e668d5c46a/src/cs/production/SDL/Generated/SDL.gen.cs#L3778-L3783
Tip: A cdecl callback function would be defined as: