Repro header:
struct TestInterface_;
struct MyStruct_;
#ifdef __cplusplus
typedef MyStruct_ MyStruct;
#endif
struct TestInterface_ {
int (__stdcall *TestMethod)(MyStruct *vm);
};
struct MyStruct_ {
const struct TestInterface_ *functions;
#ifdef __cplusplus
int TestMethod() {
return functions->TestMethod(this);
}
#endif
};
Generated (Invalid) C# code:
public unsafe partial struct TestInterface_
{
[NativeTypeName("int (*)(MyStruct *) __attribute__((stdcall))")]
public delegate* unmanaged[Cdecl]<MyStruct_*, int> TestMethod;
}
public unsafe partial struct MyStruct_
{
[NativeTypeName("const struct TestInterface_ *")]
public TestInterface_* functions;
public int TestMethod()
{
return functions->TestMethod(this);
}
}
Repro header:
Generated (Invalid) C# code: