Exposing a c function from an objective-c file, and then calling into our swift code from there is what we've been doing since before this feature was enabled. That of course also requires the Objective C runtime, but we haven't changed to @_cdecl mainly because I'm more worried about the behavior changing than I am about anyone trying to run our swift code on Linux.
Assigning a block to a c function pointer is an interesting alternative, I thought we tried something like that but I can't remember now.
Hopefully @_cdecl will become a documented and supported feature.
Assigning a block to a c function pointer is an interesting alternative, I thought we tried something like that but I can't remember now.
Hopefully @_cdecl will become a documented and supported feature.