mirror of
https://github.com/apple/swift-atomics
synced 2026-11-28 04:54:21 +00:00
[_AtomicsShims] Don’t define atomic operations when this header is compiled as C++
`_Atomic(_sa_dword)` trips up C++. This is likely due to real issues, but it seems pointless to try to fix it — rather than heroically trying to keep this header working, we can simply force the use of native builtins on Swift 5.9 and later. (I planned to do that anyway, as a major step towards deleting `_AtomicsShims` altogether.)
This commit is contained in:
1 file changed
+3
@@ -13,6 +13,8 @@
|
||||
#ifndef SWIFTATOMIC_HEADER_INCLUDED
|
||||
#define SWIFTATOMIC_HEADER_INCLUDED 1
|
||||
|
||||
#ifndef __cplusplus
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <assert.h>
|
||||
@@ -237,4 +239,5 @@ SWIFTATOMIC_DEFINE_TYPE(DoubleWord, _sa_dword)
|
||||
SWIFTATOMIC_SWIFTCC SWIFTATOMIC_SHIMS_EXPORT void _sa_retain_n(void *object, uint32_t n);
|
||||
SWIFTATOMIC_SWIFTCC SWIFTATOMIC_SHIMS_EXPORT void _sa_release_n(void *object, uint32_t n);
|
||||
|
||||
#endif // __cplusplus
|
||||
#endif //SWIFTATOMIC_HEADER_INCLUDED
|
||||
Reference in new issue
Block a user