atomic_queue modifications for windows builds

This commit is contained in:
Paul Ferrand 2020-01-04 16:30:48 +01:00
parent 6b713b11c4
commit a29f07a27f

View file

@ -6,7 +6,7 @@
#include <atomic>
#if defined(__x86_64__)
#if defined(__x86_64__) || defined(_M_X64)
#include <emmintrin.h>
namespace atomic_queue {
constexpr int CACHE_LINE_SIZE = 64;
@ -30,8 +30,13 @@ static inline void spin_loop_pause() noexcept {
namespace atomic_queue {
#if defined(__GNUC__)
#define ATOMIC_QUEUE_LIKELY(expr) __builtin_expect(static_cast<bool>(expr), 1)
#define ATOMIC_QUEUE_UNLIKELY(expr) __builtin_expect(static_cast<bool>(expr), 0)
#else
#define ATOMIC_QUEUE_LIKELY(expr) expr
#define ATOMIC_QUEUE_UNLIKELY(expr) expr
#endif
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////