Be careful; it currently relies on the Objecive-C runtime which is not present on non-Apple platforms.
As the PR says, it also doesn't handle turning throwing functions into errors, nor does it check for collisions.
Another thing you can do is declare a function pointer type in C and assign to it from Swift by calling a C setter function (more or less a small trampoline).
As the PR says, it also doesn't handle turning throwing functions into errors, nor does it check for collisions.
Another thing you can do is declare a function pointer type in C and assign to it from Swift by calling a C setter function (more or less a small trampoline).