mono / CppSharp

Tools and libraries to glue C/C++ APIs to high-level languages
MIT License
3.15k stars 518 forks source link

typedef error Cannot marshal argument of function #1846

Open xushengbo opened 7 months ago

xushengbo commented 7 months ago

An error occurred while wrapping the following code into a CLI :Cannot marshal argument of function IsEqual

typedef int Standard_Integer; typedef char16_t Standard_ExtCharacter; typedef bool Standard_Boolean; class Foo { public:

Standard_Integer a;

float b;
Standard_ExtCharacter c;

inline Standard_Boolean IsEqual(const Standard_ExtCharacter One,
    const Standard_ExtCharacter Two)
{
    return One == Two;
}

}; Replace the code below and work fine.Why? not support typedef ? or not support char16_t ?

pragma once

typedef int Standard_Integer; typedef char16_t Standard_ExtCharacter; typedef bool Standard_Boolean; class Foo { public:

Standard_Integer a;

float b;
Standard_ExtCharacter c;

inline Standard_Boolean IsEqual(const char16_t One,
    const char16_t Two)
{
    return One == Two;
}

}; __declspec(dllexport) Standard_Integer FooAdd(Foo* foo);