From 7f708dbd44ff4f64e23a65a2a8a85c318ab846f0 Mon Sep 17 00:00:00 2001 From: Adam Sawicki Date: Wed, 18 Dec 2019 10:54:28 +0100 Subject: [PATCH] Use NDEBUG instead of _DEBUG macro to detect debug build Closes #92 thanks @daemyung ! --- src/vk_mem_alloc.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/vk_mem_alloc.h b/src/vk_mem_alloc.h index 32258b4..97f7e6d 100644 --- a/src/vk_mem_alloc.h +++ b/src/vk_mem_alloc.h @@ -3584,20 +3584,20 @@ void *aligned_alloc(size_t alignment, size_t size) // Normal assert to check for programmer's errors, especially in Debug configuration. #ifndef VMA_ASSERT - #ifdef _DEBUG - #define VMA_ASSERT(expr) assert(expr) - #else + #ifdef NDEBUG #define VMA_ASSERT(expr) + #else + #define VMA_ASSERT(expr) assert(expr) #endif #endif // Assert that will be called very often, like inside data structures e.g. operator[]. // Making it non-empty can make program slow. #ifndef VMA_HEAVY_ASSERT - #ifdef _DEBUG - #define VMA_HEAVY_ASSERT(expr) //VMA_ASSERT(expr) - #else + #ifdef NDEBUG #define VMA_HEAVY_ASSERT(expr) + #else + #define VMA_HEAVY_ASSERT(expr) //VMA_ASSERT(expr) #endif #endif