diff --git a/Makefile b/Makefile index 04e3fc7a..2d261bc7 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ CXX ?= g++ LD ?= ld CFLAGS ?= -O2 -g3 -Wall -Werror -Wextra -ffunction-sections -fPIC -fvisibility=hidden -XCFLAGS ?= -DNDEBUG=1 -DMDBX_DEBUG=0 -DLIBMDBX_EXPORTS=1 +XCFLAGS ?= -DNDEBUG=1 -DLIBMDBX_EXPORTS=1 CFLAGS += -D_GNU_SOURCE=1 -std=gnu11 -pthread $(XCFLAGS) CXXFLAGS = -std=c++11 $(filter-out -std=gnu11,$(CFLAGS)) TESTDB ?= $(shell [ -d /dev/shm ] && echo /dev/shm || echo /tmp)/mdbx-test.db diff --git a/dll.vcxproj b/dll.vcxproj index c0743890..5464c158 100644 --- a/dll.vcxproj +++ b/dll.vcxproj @@ -99,7 +99,7 @@ - WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBMDBX_EXPORTS;MDBX_BUILD_DLL;MDBX_AVOID_CRT;%(PreprocessorDefinitions);MDBX_DEBUG=1 + WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBMDBX_EXPORTS;MDBX_BUILD_DLL;MDBX_AVOID_CRT;%(PreprocessorDefinitions) MultiThreadedDebugDLL EnableAllWarnings ProgramDatabase @@ -162,7 +162,7 @@ EnableAllWarnings - WIN64;_DEBUG;_WINDOWS;_USRDLL;LIBMDBX_EXPORTS;MDBX_BUILD_DLL;MDBX_AVOID_CRT;%(PreprocessorDefinitions);MDBX_DEBUG=1 + WIN64;_DEBUG;_WINDOWS;_USRDLL;LIBMDBX_EXPORTS;MDBX_BUILD_DLL;MDBX_AVOID_CRT;%(PreprocessorDefinitions) MultiThreadedDebugDLL true true diff --git a/src/bits.h b/src/bits.h index 6163f5ad..8657ae47 100644 --- a/src/bits.h +++ b/src/bits.h @@ -15,10 +15,16 @@ /* *INDENT-OFF* */ /* clang-format off */ +/* In case the MDBX_DEBUG is undefined set it corresponding to NDEBUG */ #ifndef MDBX_DEBUG +#ifdef NDEBUG # define MDBX_DEBUG 0 +#else +# define MDBX_DEBUG 1 +#endif #endif +/* Undefine the NDEBUG if debugging is enforced by MDBX_DEBUG */ #if MDBX_DEBUG # undef NDEBUG #endif