fix build when using libc++

This commit is contained in:
rexy712 2020-09-27 08:41:04 -07:00
parent 96de779f55
commit 78f664c2a5

View File

@ -23,6 +23,7 @@
#include <cstdlib> //size_t
#include <atomic> //atomic (duh)
#ifdef __cpp_lib_hardware_interference_size
#include <new> //hardware_destructive_interference_size
#endif
@ -48,8 +49,14 @@ namespace util{
using const_reference = const value_type&;
private:
#ifdef __cpp_lib_hardware_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;