5 Replies
Hey @Tanner Gooding, currently looking at this. I've got to the point where I believe the native part + ClangSharp.Interop/ClangSharp is done, and am now looking at getting some basic visitation working. Right now I've got a common
VisitObjCContainerDecl
function that just does a BeginStruct
/EndStruct
and nothing else at the moment. However, this itself was enough to expose the issue of:
F O R W A R D D E C L A R A T I O N S
MTLAccelerationStructure.h, for example, contains:
Which as far as I can tell is just a regular forward declaration. This results in a MTLAccelerationStructure.cs of:
How does ClangSharp handle this for e.g. C++ classes that may be forward declared? I'm not sure how best to handle this, IsCanonicalDecl
is false
for both and the only way I can think of is detecting when CursorChildren
only contains 1 element of a ref to itself, but this may prevent valid forward declarations from being output (do we care?).
Please advise 😅@Perksey please see
IsExcluded
: https://source.clangsharp.dev/#ClangSharp.PInvokeGenerator/PInvokeGenerator.cs,35cd24f4f6591161,references
specifically: https://source.clangsharp.dev/#ClangSharp.PInvokeGenerator/PInvokeGenerator.cs,4639
where it checks for the declaration vs the definitionthat's exactly what I wanted, thanks! smacked that at the start of the function.
discovered another problematic case: enums that are nuint sized. what's your stance here?
just prefer 64-bit and call it a day?
there isn't really a good option there, but matching 64-bit is the closest
especially considering apples stance on 32-bit