Skip to content

Commit 1f8c1e9

Browse files
gou4shi1maxsharabayko
authored andcommitted
[core] prefer to use std::atomic if available
1 parent fec9a40 commit 1f8c1e9

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

srtcore/atomic.h

+2-6
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,8 @@
6363

6464
#if defined(ATOMIC_USE_SRT_SYNC_MUTEX) && (ATOMIC_USE_SRT_SYNC_MUTEX == 1)
6565
// NOTE: Defined at the top level.
66-
#elif defined(__APPLE__) && (__cplusplus >= 201103L)
67-
// NOTE: Does support c++11 std::atomic, but the compiler may or
68-
// may not support GCC atomic intrinsics. So go ahead and use the
69-
// std::atomic implementation.
66+
#elif __cplusplus >= 201103L
67+
// NOTE: Prefer to use the c++11 std::atomic.
7068
#define ATOMIC_USE_CPP11_ATOMIC
7169
#elif (defined(__clang__) && defined(__clang_major__) && (__clang_major__ > 5)) \
7270
|| defined(__xlc__)
@@ -98,8 +96,6 @@
9896
#elif defined(_MSC_VER)
9997
#define ATOMIC_USE_MSVC_INTRINSICS
10098
#include "atomic_msvc.h"
101-
#elif __cplusplus >= 201103L
102-
#define ATOMIC_USE_CPP11_ATOMIC
10399
#else
104100
#error Unsupported compiler / system.
105101
#endif

0 commit comments

Comments
 (0)