Closed brianmichel closed 8 months ago
I feel uneasy about this. This only impacts the implementation and not the declaration which are consumed by the ClangImporter and thus this can lead to a mismatch in the linkage.
Ah this should likely just be in the header files, right? Sorry, long day of debugging.
@swift-server-bot test this please
@Lukasa can we get this merged please?
Ensure C linkage for shims to allow for usage in C++ interop environments.
Checklist
If you've made changes to
gyb
files.script/generate_boilerplate_files_with_gyb
and included updated generated files in a commit of this pull requestMotivation:
This library when consumed from a swift package that has C++ interop enabled fails to successfully link since the symbols seem to get mangled.
Modifications:
I've added conditional
extern "C"
markers in the shims file if and only iff C++ is detected.Result:
You should be able to consume and link this library in a target that has C++ interop enabled.