bottlenoselabs / c2cs

Generate C# bindings from a C header.
MIT License
245 stars 18 forks source link

Sanitize unnamed const params #72

Closed waldnercharles closed 2 years ago

waldnercharles commented 2 years ago

It seems like unnamed const pointers aren't being sanitized correctly for function pointers.

The issue is with the 2nd parameter: HRESULT (IRpcStubBuffer *, IID *const, void **)

IID and IID* exist in the types dictionary, but, TypeNameMapFunctionPointer is looking for IID*const.

Possible test cases:

const int *ptr;
const int* ptr;
int const *ptr;
int const* ptr;
const int const *ptr;
const int const* ptr;
lithiumtoast commented 2 years ago

Hm, okay I'll add it to the integration tests after the multi-pass branch is merged.

lithiumtoast commented 2 years ago

Merged the branch in. I'll take a look at this tomorrow.

lithiumtoast commented 2 years ago

Added tests for this using a function declaration, but I can't seem to reproduce it. I suspect it got fixed when I merged in multipass branch. If you have the problem happen to you again let me know.