Use fallback aligned_alloc for older glibc++

This function was introduced in C++17, then backported to older versions
of glibc++ library, but is not available in older releases (it's missing
from Ubuntu 12.04 derived SteamRT for example).
This commit is contained in:
Patryk Obara 2019-08-15 13:23:13 +02:00
parent 188a365ed4
commit ff9ac65fe2

View File

@ -3302,7 +3302,7 @@ void *aligned_alloc(size_t alignment, size_t size)
return memalign(alignment, size); return memalign(alignment, size);
} }
#elif defined(__APPLE__) || defined(__ANDROID__) #elif defined(__APPLE__) || defined(__ANDROID__) || (defined(__GLIBCXX__) && !defined(_GLIBCXX_HAVE_ALIGNED_ALLOC))
#include <cstdlib> #include <cstdlib>
void *aligned_alloc(size_t alignment, size_t size) void *aligned_alloc(size_t alignment, size_t size)
{ {