Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling Convention #226

Open
MikhailGorobets opened this issue Nov 10, 2022 · 0 comments
Open

Calling Convention #226

MikhailGorobets opened this issue Nov 10, 2022 · 0 comments

Comments

@MikhailGorobets
Copy link

MikhailGorobets commented Nov 10, 2022

Hi @jkoritzinsky,
I noticed that SharpGenTools generates the wrong kind of calling convention, for example instead of cdecl we get thiscall

struct InterfaceWithProperties
{
    virtual bool __cdecl IsTrue() = 0;
    virtual int __stdcall GetValue() = 0;
};
public partial class InterfaceWithProperties : SharpGen.Runtime.CppObject
{
    // ...

    public unsafe bool IsTrue()
    {
        bool __result__;
        byte __result__native;
        __result__native = ((delegate* unmanaged[Thiscall]<System.IntPtr, byte> )this[0])(NativePointer);
        __result__ = 0 != __result__native;
        return __result__;
    }

    public unsafe int GetValue()
    {
        int __result__;
        __result__ = ((delegate* unmanaged[Stdcall]<System.IntPtr, int> )this[1])(NativePointer);
        return __result__;
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant