From ff9ac65fe2253952bfa86a6ce73b0c44b7ccecb3 Mon Sep 17 00:00:00 2001 From: Patryk Obara Date: Thu, 15 Aug 2019 13:23:13 +0200 Subject: [PATCH] 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). --- src/vk_mem_alloc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vk_mem_alloc.h b/src/vk_mem_alloc.h index 623f860..325375f 100644 --- a/src/vk_mem_alloc.h +++ b/src/vk_mem_alloc.h @@ -3302,7 +3302,7 @@ void *aligned_alloc(size_t alignment, size_t size) return memalign(alignment, size); } -#elif defined(__APPLE__) || defined(__ANDROID__) +#elif defined(__APPLE__) || defined(__ANDROID__) || (defined(__GLIBCXX__) && !defined(_GLIBCXX_HAVE_ALIGNED_ALLOC)) #include void *aligned_alloc(size_t alignment, size_t size) {