summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/imports.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2019-05-09 21:04:23 -0400
committerMarek Olšák <[email protected]>2019-05-29 21:13:35 -0400
commitb5697c311b6f29dee40b96c48bad3279e3667c1e (patch)
treed0708cd5249ec8d3535bda8134f91ea79af2ffde /src/mesa/main/imports.c
parent0f1b68ebeeee196ced42d8ac66d231338b507bad (diff)
Change a few frequented uses of DEBUG to !NDEBUG
debugoptimized builds don't define NDEBUG, but they also don't define DEBUG. We want to enable cheap debug code for these builds. I only chose those occurences that I care about. Reviewed-by: Mathias Fröhlich <[email protected]>
Diffstat (limited to 'src/mesa/main/imports.c')
-rw-r--r--src/mesa/main/imports.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c
index 566aac1d385..f1bcd2fa1f7 100644
--- a/src/mesa/main/imports.c
+++ b/src/mesa/main/imports.c
@@ -102,7 +102,7 @@ _mesa_align_malloc(size_t bytes, unsigned long alignment)
buf = (ptr + alignment + sizeof(void *)) & ~(uintptr_t)(alignment - 1);
*(uintptr_t *)(buf - sizeof(void *)) = ptr;
-#ifdef DEBUG
+#ifndef NDEBUG
/* mark the non-aligned area */
while ( ptr < buf - sizeof(void *) ) {
*(unsigned long *)ptr = 0xcdcdcdcd;
@@ -151,7 +151,7 @@ _mesa_align_calloc(size_t bytes, unsigned long alignment)
buf = (ptr + alignment + sizeof(void *)) & ~(uintptr_t)(alignment - 1);
*(uintptr_t *)(buf - sizeof(void *)) = ptr;
-#ifdef DEBUG
+#ifndef NDEBUG
/* mark the non-aligned area */
while ( ptr < buf - sizeof(void *) ) {
*(unsigned long *)ptr = 0xcdcdcdcd;