mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
When compiling with C++ interop enabled, we enable extra safety checks to prevent library authors from accidentally exposing ABI-fragile C++ symbols in resilient Swift interfaces. The heuristic we use is overly strict, and it prevents the compiler from being able to typecheck various modules from their interfaces when C++ interop is enabled. Darwin and System are two of such modules. The underlying challenge is that there isn't a good distinction between C structs and C++ structs: whenever parsing a header file in C++ language mode, Clang assumes that every struct is a C++ struct. This relaxes the heuristic to allow exposing C-like structs in resilient interfaces. rdar://140203932
4 lines
57 B
Plaintext
4 lines
57 B
Plaintext
module MyCLibrary {
|
|
header "my_c_header.h"
|
|
export *
|
|
} |