From 15501fd0d45eb401645f7e7c1d950e6567da0210 Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Tue, 15 Mar 2022 00:40:40 +0300 Subject: [PATCH] Use `DEBUG_CORE` instead of a more generic `DEBUG` when compiling with `--enable-debug` (#4728) `DEBUG` is unreliable because of bls/relic internals it seems --- configure.ac | 2 +- src/init.cpp | 2 +- src/span.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 74b6073381..3212daf74b 100644 --- a/configure.ac +++ b/configure.ac @@ -343,7 +343,7 @@ if test "x$enable_debug" = xyes; then [AX_CHECK_COMPILE_FLAG([-g],[[DEBUG_CXXFLAGS="$DEBUG_CXXFLAGS -g"]],,[[$CXXFLAG_WERROR]])], [[$CXXFLAG_WERROR]]) - AX_CHECK_PREPROC_FLAG([-DDEBUG],[[DEBUG_CPPFLAGS="$DEBUG_CPPFLAGS -DDEBUG"]],,[[$CXXFLAG_WERROR]]) + AX_CHECK_PREPROC_FLAG([-DDEBUG_CORE],[[DEBUG_CPPFLAGS="$DEBUG_CPPFLAGS -DDEBUG_CORE"]],,[[$CXXFLAG_WERROR]]) AX_CHECK_PREPROC_FLAG([-DDEBUG_LOCKORDER],[[DEBUG_CPPFLAGS="$DEBUG_CPPFLAGS -DDEBUG_LOCKORDER"]],,[[$CXXFLAG_WERROR]]) else # We always enable at at least -g1 debug info to support proper stacktraces in crash infos diff --git a/src/init.cpp b/src/init.cpp index 58f99ac769..83729830b2 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1187,7 +1187,7 @@ void InitLogging() fLogIPs = gArgs.GetBoolArg("-logips", DEFAULT_LOGIPS); std::string version_string = FormatFullVersion(); -#ifdef DEBUG +#ifdef DEBUG_CORE version_string += " (debug build)"; #else version_string += " (release build)"; diff --git a/src/span.h b/src/span.h index c423e49d8e..2134b4f6cf 100644 --- a/src/span.h +++ b/src/span.h @@ -10,7 +10,7 @@ #include #include -#ifdef DEBUG +#ifdef DEBUG_CORE #define CONSTEXPR_IF_NOT_DEBUG #define ASSERT_IF_DEBUG(x) assert((x)) #else