[_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:
Karoy Lorentey committed 2023-07-07 18:21:46 -07:00
1 parent 8bdc853bea
commit 15824c718b
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