mono / CppSharp

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

ptrdiff_t / size_t data types issue? (and long / ulong) #1853

Open SuRGeoNix opened 5 months ago

SuRGeoNix commented 5 months ago

In my case it looks in vcruntime.h which includes:

#ifdef _WIN64
    typedef unsigned __int64 size_t;
    typedef __int64          ptrdiff_t;
    typedef __int64          intptr_t;
#else
    typedef unsigned int     size_t;
    typedef int              ptrdiff_t;
    typedef int              intptr_t;
#endif

and it gives me a qualified type (in x64 win case) LongLong which is wrong it should be IntPtr / nint?

Similarly for size_t it should be nuint and for long/ulong to use CLong / CULong.

tritao commented 4 months ago

Looks like I missed this issue previously, did you made any progress in figuring out your issue?

SuRGeoNix commented 4 months ago

@tritao I manually changing the types for now, just thought that this should be handle at lower level from CppSharp?