Skip to content

Commit

Permalink
[core] prefer to use std::atomic if available
Browse files Browse the repository at this point in the history
  • Loading branch information
gou4shi1 authored and maxsharabayko committed Apr 14, 2022
1 parent fec9a40 commit 1f8c1e9
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions srtcore/atomic.h
Expand Up @@ -63,10 +63,8 @@

#if defined(ATOMIC_USE_SRT_SYNC_MUTEX) && (ATOMIC_USE_SRT_SYNC_MUTEX == 1)
// NOTE: Defined at the top level.
#elif defined(__APPLE__) && (__cplusplus >= 201103L)
// NOTE: Does support c++11 std::atomic, but the compiler may or
// may not support GCC atomic intrinsics. So go ahead and use the
// std::atomic implementation.
#elif __cplusplus >= 201103L
// NOTE: Prefer to use the c++11 std::atomic.
#define ATOMIC_USE_CPP11_ATOMIC
#elif (defined(__clang__) && defined(__clang_major__) && (__clang_major__ > 5)) \
|| defined(__xlc__)
Expand Down Expand Up @@ -98,8 +96,6 @@
#elif defined(_MSC_VER)
#define ATOMIC_USE_MSVC_INTRINSICS
#include "atomic_msvc.h"
#elif __cplusplus >= 201103L
#define ATOMIC_USE_CPP11_ATOMIC
#else
#error Unsupported compiler / system.
#endif
Expand Down

0 comments on commit 1f8c1e9

Please sign in to comment.