File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -455,12 +455,21 @@ void operator delete[](void* p, std::nothrow_t const&) TEST_NOEXCEPT {
455
455
# define USE_ALIGNED_ALLOC
456
456
# endif
457
457
458
+ # if defined(__APPLE__)
459
+ # if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && \
460
+ __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101500 )
461
+ # define TEST_HAS_NO_C11_ALIGNED_ALLOC
462
+ # endif
463
+ # elif defined(__ANDROID__) && __ANDROID_API__ < 28
464
+ # define TEST_HAS_NO_C11_ALIGNED_ALLOC
465
+ # endif
466
+
458
467
inline void * allocate_aligned_impl (std::size_t size, std::align_val_t align) {
459
468
const std::size_t alignment = static_cast <std::size_t >(align);
460
469
void * ret = nullptr ;
461
470
# ifdef USE_ALIGNED_ALLOC
462
471
ret = _aligned_malloc (size, alignment);
463
- # elif TEST_STD_VER >= 17
472
+ # elif TEST_STD_VER >= 17 && !defined(TEST_HAS_NO_C11_ALIGNED_ALLOC)
464
473
size_t rounded_size = (size + alignment - 1 ) & ~(alignment - 1 );
465
474
ret = aligned_alloc (alignment, size > rounded_size ? size : rounded_size);
466
475
# else
You can’t perform that action at this time.
0 commit comments