Function pointer in a struct declaration

Calling clang_getCanonicalType on Unexposed works well, thanks for the tip.

It would be nice to know what function can be used on what type with confidence without checking for invalid type all the time, so again, perhaps there are test cases or references in the code that can shed some light?

Cheers,

Henry

This may help you, it’s similar to your project description in that it generates C# extern definitions (C# equivalent of JNI, I suppose):

https://github.com/mjsabby/ClangSharp/blob/master/ClangSharpPInvokeGenerator/TypeDefVisitor.cs#L27,#L75

The highlighted part is the relevant Function Pointer case where it checks that is a pointer type and then its canonical pointee type which should be a CXType_FunctionProto.