diff --git a/include/proxsuite/linalg/veg/memory/alloc.hpp b/include/proxsuite/linalg/veg/memory/alloc.hpp index 4c9056847..aee6c76ab 100644 --- a/include/proxsuite/linalg/veg/memory/alloc.hpp +++ b/include/proxsuite/linalg/veg/memory/alloc.hpp @@ -165,13 +165,13 @@ aligned_alloc(usize align, usize size) noexcept -> void* #if defined(_WIN32) return _aligned_malloc((size + mask) & ~mask, align); #elif defined(__APPLE__) -#ifdef PROXSUITE_WITH_CPP_17 +#if defined(PROXSUITE_WITH_CPP_17) && defined(_LIBCPP_HAS_ALIGNED_ALLOC) return alignment::aligned_alloc(align, (size + mask) & ~mask); #else return alignment::detail::aligned_alloc(align, (size + mask) & ~mask); #endif #else -#ifdef PROXSUITE_WITH_CPP_17 +#if defined(PROXSUITE_WITH_CPP_17) && defined(_LIBCPP_HAS_ALIGNED_ALLOC) return std::aligned_alloc(align, (size + mask) & ~mask); #else return alignment::detail::aligned_alloc(align, (size + mask) & ~mask); diff --git a/include/proxsuite/linalg/veg/memory/placement.hpp b/include/proxsuite/linalg/veg/memory/placement.hpp index 0ec1708cf..cb1afbc8a 100644 --- a/include/proxsuite/linalg/veg/memory/placement.hpp +++ b/include/proxsuite/linalg/veg/memory/placement.hpp @@ -41,7 +41,7 @@ #if VEG_HAS_BUILTIN(__builtin_launder) || __GNUC__ >= 7 #define VEG_LAUNDER(p) (__builtin_launder(p)) -#elif defined(VEG_WITH_CXX17_SUPPORT) +#elif defined(VEG_WITH_CXX17_SUPPORT) && __GNUC__ >= 6 #include #define VEG_LAUNDER(p) (::std::launder(p)) #else