mirror of
https://github.com/apple/swift-nio
synced 2026-11-24 04:37:54 +00:00
Motivation:
On c++ compile, we get 'error: unknown type name '_Bool' DECLARE_ATOMIC_OPERATIONS(_Bool, _Bool)'
The c++ compile is happening when SwiftPM builds a module
with swiftSettings: [.interoperabilityMode(.Cxx)] set and
where nio is a dependency.
Modifications:
* Sources/CNIOAtomics/include/CNIOAtomics.h
Conditionally, if __cplusplus, use bool type instead of
_Bool (a c-type only) for booleans.
Result:
Compiles where previous it error'd.
After your change, what will change.
No change other than now it compiles under c++.
Co-authored-by: Cory Benfield <lukasa@apple.com>