diff options
author | Johannes Kauffmann <19662702+JohannesKauffmann@users.noreply.github.com> | 2022-11-24 00:14:23 +0100 |
---|---|---|
committer | Jeremy Hayes <jeremy-lunarg@users.noreply.github.com> | 2022-11-29 14:58:29 -0700 |
commit | 728c689574fba7e53305b475cd57f196c1a21226 (patch) | |
tree | bdf67b318fa12ee76afe854a3ede5d44220abcef | |
parent | 12bb8602dd2ef450e064959eb44ae117a80f01c9 (diff) | |
download | glslang-728c689574fba7e53305b475cd57f196c1a21226.tar.gz |
Include: PoolAlloc: do not rely on CMake define
On Windows, _DEBUG is defined by CMake if CMAKE_BUILD_TYPE is Debug. But
on other platforms, this is not the case and thus in debug mode, the
guard checks are not enabled.
Instead, rely on the NDEBUG define, which is always defined in release
mode (Release, RelWithDebInfo and MinSizeRel). This works reliably on
all platforms: It is also used to enable or disable assertions.
-rw-r--r-- | glslang/Include/PoolAlloc.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/glslang/Include/PoolAlloc.h b/glslang/Include/PoolAlloc.h index 1f5cac76..15adbaf0 100644 --- a/glslang/Include/PoolAlloc.h +++ b/glslang/Include/PoolAlloc.h @@ -37,7 +37,7 @@ #ifndef _POOLALLOC_INCLUDED_ #define _POOLALLOC_INCLUDED_ -#ifdef _DEBUG +#ifndef NDEBUG # define GUARD_BLOCKS // define to enable guard block sanity checking #endif |