mirror of
https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator
synced 2024-11-05 04:10:06 +00:00
Changed implementation of vma_aligned_alloc to only use aligned_alloc when C++17 is enabled, where the function is defined.
See #285 May break on some platforms! If it affects you, please enable C++17 or later in your compiler or provide custom implementation of macro VMA_SYSTEM_ALIGNED_MALLOC (and VMA_SYSTEM_ALIGNED_FREE if needed) using the API of your system.
This commit is contained in:
parent
d6b705bf75
commit
db0f9b481a
@ -2745,11 +2745,17 @@ static void* vma_aligned_alloc(size_t alignment, size_t size)
|
||||
{
|
||||
return _aligned_malloc(size, alignment);
|
||||
}
|
||||
#else
|
||||
#elif __cplusplus >= 201703L // Compiler conforms to C++17.
|
||||
static void* vma_aligned_alloc(size_t alignment, size_t size)
|
||||
{
|
||||
return aligned_alloc(alignment, size);
|
||||
}
|
||||
#else
|
||||
static void* vma_aligned_alloc(size_t alignment, size_t size)
|
||||
{
|
||||
VMA_ASSERT(0 && "Could not implement aligned_alloc automatically. Please enable C++17 or later in your compiler or provide custom implementation of macro VMA_SYSTEM_ALIGNED_MALLOC (and VMA_SYSTEM_ALIGNED_FREE if needed) using the API of your system.");
|
||||
return VMA_NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32)
|
||||
|
Loading…
Reference in New Issue
Block a user