I'm trying to use an API with a complicated callback structure. You pass a 
struct with a set of pointers to callbacks to a function, along with a pointer 
to a buffer it fills out. Here's an elided version of the C and Swift code:

        https://pastebin.com/k3VYJTjB

This compiles, but I get a runtime error in the unsafeBitCast() call 
(mismatched sizes) on line 56.

I realize unsafeBitCast() is dangerous, but I was relying Quinn's post in the 
Apple Dev Forums suggesting it was the best way to go. However, I'm pretty sure 
I'm using it incorrectly here.

I can't seem to get Xcode to show me its Swift interpretation of the header 
file. Sometimes it does, sometimes it doesn't.

But can someone please help me get the pointer conversions right for this?

Thank you very much.

-- 
Rick Mann
rm...@latencyzero.com


_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users

Reply via email to