From 4c81c2b8b8bbe335f613428a81b25618f75fd1e3 Mon Sep 17 00:00:00 2001 From: rexy712 Date: Thu, 24 Sep 2020 05:11:20 -0700 Subject: [PATCH] fix build error with libc++ v8-v10 --- include/rexy/mpmc_queue.hpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/include/rexy/mpmc_queue.hpp b/include/rexy/mpmc_queue.hpp index a7d3464..8df0c75 100644 --- a/include/rexy/mpmc_queue.hpp +++ b/include/rexy/mpmc_queue.hpp @@ -48,8 +48,14 @@ namespace rexy{ using const_reference = const value_type&; private: - #ifdef __cpp_lib_hardware_interference_size - static constexpr size_t cacheline_size = std::hardware_destructive_interference_size; + #if defined(__cpp_lib_hardware_interference_size) + //libc++ bug + // https://bugs.llvm.org/show_bug.cgi?id=41423 + #if defined(_LIBCPP_VERSION) && _LIBCPP_VERSION >= 11000 + static constexpr size_t cacheline_size = std::hardware_destructive_interference_size; + #else + static constexpr size_t cacheline_size = 64; + #endif #else //Best guess static constexpr size_t cacheline_size = 64;