Removed #include <malloc.h> for aligned_alloc(). Based on #28 by @jbeich

This commit is contained in:
Adam Sawicki 2018-06-04 14:12:15 +02:00
parent 6a0a85a5c0
commit 083532cf3a

View File

@ -2257,10 +2257,6 @@ remove them if not needed.
#include <mutex> // for std::mutex #include <mutex> // for std::mutex
#include <atomic> // for std::atomic #include <atomic> // for std::atomic
#if !defined(_WIN32) && !defined(__APPLE__)
#include <malloc.h> // for aligned_alloc()
#endif
#ifndef VMA_NULL #ifndef VMA_NULL
// Value used as null pointer. Define it to e.g.: nullptr, NULL, 0, (void*)0. // Value used as null pointer. Define it to e.g.: nullptr, NULL, 0, (void*)0.
#define VMA_NULL nullptr #define VMA_NULL nullptr
@ -2283,6 +2279,11 @@ void *aligned_alloc(size_t alignment, size_t size)
} }
#endif #endif
// If your compiler is not compatible with C++11 and definition of
// aligned_alloc() function is missing, uncommeting following line may help:
//#include <malloc.h>
// Normal assert to check for programmer's errors, especially in Debug configuration. // Normal assert to check for programmer's errors, especially in Debug configuration.
#ifndef VMA_ASSERT #ifndef VMA_ASSERT
#ifdef _DEBUG #ifdef _DEBUG