diff --git a/CMakeLists.txt b/CMakeLists.txt index 778253c..e84bedd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -136,12 +136,29 @@ endif () #------------------------------------------------------------------------ -# Memory Diagnostics -# Enable building with some memory diagnostics. -# -# NOTE: Currently only available in the Debug configuration build in -# Windows, but could be maybe extended to Unix, others... +# Diagnostics +# Enable building with logs, some memory diagnostics. +# +# - ensure that NDEBUG is applied by default, so that default builds +# don't spew debugging messages everywhere, except MSVC builds, +# where this is already expected behavior. +# - allow other diagnostic tools. #------------------------------------------------------------------------ +add_definitions( -DNDEBUG ) + +if (MSVC AND NOT CMAKE_BUILD_TYPE MATCHES Release) + option( ENABLE_DEBUG_LOG "Set ON to output debugging messages." ON ) +else () + option( ENABLE_DEBUG_LOG "Set ON to output debugging messages." OFF ) +endif () + +if ( ENABLE_DEBUG_LOG ) + remove_definitions ( -DNDEBUG ) + message(STATUS "*** Debug Logging is enabled.") +else () + message(STATUS "*** Debug Logging is NOT enabled.") +endif () + option( ENABLE_ALLOC_DEBUG "Set ON to output node allocation diagnostics." OFF ) option( ENABLE_MEMORY_DEBUG "Set ON to output some memory diagnostics." OFF ) diff --git a/src/lexer.c b/src/lexer.c index 3df32c2..8e8765d 100644 --- a/src/lexer.c +++ b/src/lexer.c @@ -322,10 +322,10 @@ static uint GetVersFromFPI(ctmbstr fpi) return 0; } -#if defined(_MSC_VER) -#ifndef EndBuf -# define EndBuf(a) ( a + strlen(a) ) -#endif +#ifndef NDEBUG +# ifndef EndBuf +# define EndBuf(a) ( a + strlen(a) ) +# endif /* Issue #377 - Output diminishing version bits */ typedef struct tagV2S { diff --git a/version.txt b/version.txt index bad155c..bfd15d9 100644 --- a/version.txt +++ b/version.txt @@ -1,2 +1,2 @@ -5.5.59 -2017.10.06 +5.5.60 +2017.10.07