Use GNUC atomics from GCC 4.9

GCC began to offer full support for the C11 standard starting with version 4.9,
including support for the _Atomic keyword.

https://gcc.gnu.org/gcc-4.9/changes.html
This commit is contained in:
Björn Svensson 2024-05-24 11:53:51 +02:00 committed by fengbojiang
parent 486200e57f
commit c4dfb94e98
2 changed files with 2 additions and 2 deletions

View File

@ -264,7 +264,7 @@
#endif
#if !defined(__cplusplus) && !__has_extension(c_atomic) && \
!__has_extension(cxx_atomic) && !__GNUC_PREREQ__(4, 7)
!__has_extension(cxx_atomic) && !__GNUC_PREREQ__(4, 9)
/*
* No native support for _Atomic(). Place object in structure to prevent
* most forms of direct non-atomic access.

View File

@ -37,7 +37,7 @@
#if defined(__clang__) && (__has_extension(c_atomic) || __has_extension(cxx_atomic))
#define __CLANG_ATOMICS
#elif __GNUC_PREREQ__(4, 7)
#elif __GNUC_PREREQ__(4, 9)
#define __GNUC_ATOMICS
#elif defined(__GNUC__)
#define __SYNC_ATOMICS