Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix compiler error in CoreFoundation when building in C++ mode (#5081)
`__CFAllocatorRespectsHintZeroWhenAllocating` has two declarations in different headers: `ForFoundationOnly.h` and `ForSwiftFoundationOnly.h`. One of the declarations was under `extern "C"` block, the other one wasn't. Clang accepts this in C language mode, but it is a hard compiler error in C++ language mode due to a linkage mismatch. This was blocking clients from using CoreFoundation in Swift projects that enable C++ interoperability. This change makes sure that both declarations of `__CFAllocatorRespectsHintZeroWhenAllocating` are under `extern "C"` blocks.
- Loading branch information