summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2017-01-09 16:11:04 +0100
committerTor Andersson <tor.andersson@artifex.com>2017-01-09 17:46:26 +0100
commit50b39c939345c36eb5e95c8a71ccdb8cd24c9aad (patch)
treecc5db7cd564628a7217ffa16967230c1353296aa
parent18d95a4ee602435899eae941ed0215fa1f71a01b (diff)
downloadmupdf-50b39c939345c36eb5e95c8a71ccdb8cd24c9aad.tar.xz
Be consistent in use of DEBUG/NDEBUG macros.
Only use NDEBUG as it's the one that most environments already set, so is likely to lead to the least amount of confusion if compiling with a custom build system.
-rw-r--r--Makerules8
-rw-r--r--include/mupdf/fitz/context.h2
-rw-r--r--include/mupdf/fitz/system.h2
-rw-r--r--source/fitz/memento.c2
4 files changed, 7 insertions, 7 deletions
diff --git a/Makerules b/Makerules
index 8a17d779..fa98685a 100644
--- a/Makerules
+++ b/Makerules
@@ -22,7 +22,7 @@ LDREMOVEUNREACH = -Wl,--gc-sections
endif
ifeq "$(build)" "debug"
-CFLAGS += -pipe -g -DDEBUG
+CFLAGS += -pipe -g
LDFLAGS += -g
else ifeq "$(build)" "release"
CFLAGS += -pipe -O2 -DNDEBUG -fomit-frame-pointer
@@ -31,19 +31,19 @@ else ifeq "$(build)" "small"
CFLAGS += -pipe -Os -DNDEBUG -fomit-frame-pointer
LDFLAGS += $(LDREMOVEUNREACH) -Wl,-s
else ifeq "$(build)" "sanitize"
-CFLAGS += -pipe -g -DDEBUG -fsanitize=address -fno-omit-frame-pointer
+CFLAGS += -pipe -g -fsanitize=address -fno-omit-frame-pointer
LDFLAGS += -fsanitize=address
else ifeq "$(build)" "profile"
CFLAGS += -pipe -O2 -DNDEBUG -pg
LDFLAGS += -pg
else ifeq "$(build)" "coverage"
-CFLAGS += -pipe -g -DDEBUG -pg -fprofile-arcs -ftest-coverage
+CFLAGS += -pipe -g -pg -fprofile-arcs -ftest-coverage
LIBS += -lgcov
else ifeq "$(build)" "native"
CFLAGS += -pipe -O2 -DNDEBUG -fomit-frame-pointer -march=native -mfpmath=sse
LDFLAGS += $(LDREMOVEUNREACH) -Wl,-s
else ifeq "$(build)" "memento"
-CFLAGS += -pipe -g -DMEMENTO -DDEBUG
+CFLAGS += -pipe -g -DMEMENTO
LDFLAGS += -g -d -rdynamic
ifeq "$(HAVE_LIBDL)" "yes"
CFLAGS += -DHAVE_LIBDL
diff --git a/include/mupdf/fitz/context.h b/include/mupdf/fitz/context.h
index b9363ebd..ba4255e3 100644
--- a/include/mupdf/fitz/context.h
+++ b/include/mupdf/fitz/context.h
@@ -571,7 +571,7 @@ extern fz_alloc_context fz_alloc_default;
/* Default locks */
extern fz_locks_context fz_locks_default;
-#if defined(MEMENTO) || defined(DEBUG)
+#if defined(MEMENTO) || !defined(NDEBUG)
#define FITZ_DEBUG_LOCKING
#endif
diff --git a/include/mupdf/fitz/system.h b/include/mupdf/fitz/system.h
index b49d9110..4be26ed5 100644
--- a/include/mupdf/fitz/system.h
+++ b/include/mupdf/fitz/system.h
@@ -225,7 +225,7 @@ typedef int fz_off_t;
#ifdef __ANDROID__
#include <android/log.h>
int fz_android_fprintf(FILE *file, const char *fmt, ...);
-#ifdef DEBUG
+#ifndef NDEBUG
/* Capture fprintf for stdout/stderr to the android logging
* stream. Only do this in debug builds as this implies a
* delay */
diff --git a/source/fitz/memento.c b/source/fitz/memento.c
index 68698f0d..db83c9e6 100644
--- a/source/fitz/memento.c
+++ b/source/fitz/memento.c
@@ -831,7 +831,7 @@ void Memento_breakpoint(void)
{
/* A handy externally visible function for breakpointing */
#if 0 /* Enable this to force automatic breakpointing */
-#ifdef DEBUG
+#ifndef NDEBUG
#ifdef _MSC_VER
__asm int 3;
#endif