From f5a529cfd4a9f1920c0b1d75375258dab2d71be1 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 30 Dec 2008 14:54:55 +0000 Subject: Rename NDEBUG flag to BOX_RELEASE_BUILD, as other projects use NDEBUG as well (e.g. wxWidgets) and it causes conflicts which are difficult to resolve. --- bin/bbackupctl/bbackupctl.cpp | 2 +- bin/bbackupd/BackupDaemon.cpp | 4 ++-- bin/bbackupquery/bbackupquery.cpp | 4 ++-- bin/bbstored/BackupStoreContext.cpp | 2 +- infrastructure/buildenv-testmain-template.cpp | 4 ++-- infrastructure/makebuildenv.pl.in | 3 +-- infrastructure/msvc/2003/bbackupctl.vcproj | 4 ++-- infrastructure/msvc/2003/bbackupd.vcproj | 4 ++-- infrastructure/msvc/2003/boxquery.vcproj | 4 ++-- infrastructure/msvc/2003/common.vcproj | 4 ++-- infrastructure/msvc/2003/win32test.vcproj | 2 +- infrastructure/msvc/2005/bbackupctl.vcproj | 2 +- infrastructure/msvc/2005/bbackupd.vcproj | 2 +- infrastructure/msvc/2005/boxquery.vcproj | 2 +- infrastructure/msvc/2005/common.vcproj | 2 +- infrastructure/msvc/2005/win32test.vcproj | 2 +- lib/backupclient/BackupStoreFile.h | 2 +- lib/backupclient/BackupStoreFileDiff.cpp | 20 ++++++++++---------- lib/backupclient/BackupStoreFileEncodeStream.cpp | 2 +- lib/backupstore/BackupStoreCheck.h | 4 ++-- lib/backupstore/BackupStoreCheckData.cpp | 2 +- lib/backupstore/BackupStoreInfo.cpp | 2 +- lib/backupstore/StoreStructure.h | 2 +- lib/common/Box.h | 2 +- lib/common/DebugAssertFailed.cpp | 4 ++-- lib/common/DebugMemLeakFinder.cpp | 4 ++-- lib/common/DebugPrintf.cpp | 4 ++-- lib/common/FdGetLine.h | 2 +- lib/common/IOStreamGetLine.h | 2 +- lib/common/Timer.cpp | 10 +++++----- lib/common/Utils.cpp | 2 +- lib/compress/CompressStream.cpp | 2 +- lib/raidfile/RaidFileUtil.cpp | 4 ++-- lib/raidfile/RaidFileWrite.cpp | 2 +- lib/server/Daemon.cpp | 2 +- lib/server/Protocol.cpp | 2 +- lib/server/SSLLib.cpp | 2 +- lib/server/SSLLib.h | 2 +- lib/server/ServerStream.h | 2 +- lib/server/SocketStreamTLS.cpp | 2 +- test/backupdiff/testbackupdiff.cpp | 2 +- test/common/testcommon.cpp | 8 ++++---- 42 files changed, 70 insertions(+), 71 deletions(-) diff --git a/bin/bbackupctl/bbackupctl.cpp b/bin/bbackupctl/bbackupctl.cpp index f55c689c..0340f400 100644 --- a/bin/bbackupctl/bbackupctl.cpp +++ b/bin/bbackupctl/bbackupctl.cpp @@ -356,7 +356,7 @@ int main(int argc, const char *argv[]) MAINHELPER_END -#if defined WIN32 && ! defined NDEBUG +#if defined WIN32 && ! defined BOX_RELEASE_BUILD closelog(); #endif diff --git a/bin/bbackupd/BackupDaemon.cpp b/bin/bbackupd/BackupDaemon.cpp index f192f763..7ddaba40 100644 --- a/bin/bbackupd/BackupDaemon.cpp +++ b/bin/bbackupd/BackupDaemon.cpp @@ -1522,12 +1522,12 @@ void BackupDaemon::SetupLocations(BackupClientContext &rClientContext, const Con #endif // HAVE_STRUCT_MNTENT_MNT_DIR // Check sorting and that things are as we expect ASSERT(mountPoints.size() > 0); -#ifndef NDEBUG +#ifndef BOX_RELEASE_BUILD { std::set::reverse_iterator i(mountPoints.rbegin()); ASSERT(*i == "/"); } -#endif // n NDEBUG +#endif // n BOX_RELEASE_BUILD #endif // n HAVE_STRUCT_STATFS_F_MNTONNAME || n HAVE_STRUCT_STATVFS_F_MNTONNAME #endif // HAVE_MOUNTS diff --git a/bin/bbackupquery/bbackupquery.cpp b/bin/bbackupquery/bbackupquery.cpp index 31c28046..bbe8dd14 100644 --- a/bin/bbackupquery/bbackupquery.cpp +++ b/bin/bbackupquery/bbackupquery.cpp @@ -94,7 +94,7 @@ int main(int argc, const char *argv[]) #endif // Really don't want trace statements happening, even in debug mode - #ifndef NDEBUG + #ifndef BOX_RELEASE_BUILD BoxDebugTraceOn = false; #endif @@ -114,7 +114,7 @@ int main(int argc, const char *argv[]) Logging::SetProgramName("bbackupquery"); - #ifdef NDEBUG + #ifdef BOX_RELEASE_BUILD int masterLevel = Log::NOTICE; // need an int to do math with #else int masterLevel = Log::INFO; // need an int to do math with diff --git a/bin/bbstored/BackupStoreContext.cpp b/bin/bbstored/BackupStoreContext.cpp index f8108beb..990be05d 100644 --- a/bin/bbstored/BackupStoreContext.cpp +++ b/bin/bbstored/BackupStoreContext.cpp @@ -33,7 +33,7 @@ // Maximum number of directories to keep in the cache // When the cache is bigger than this, everything gets // deleted. -#ifdef NDEBUG +#ifdef BOX_RELEASE_BUILD #define MAX_CACHE_SIZE 32 #else #define MAX_CACHE_SIZE 2 diff --git a/infrastructure/buildenv-testmain-template.cpp b/infrastructure/buildenv-testmain-template.cpp index 0099b0d0..b646a27b 100644 --- a/infrastructure/buildenv-testmain-template.cpp +++ b/infrastructure/buildenv-testmain-template.cpp @@ -43,7 +43,7 @@ int test(int argc, const char *argv[]); -#ifdef NDEBUG +#ifdef BOX_RELEASE_BUILD #define MODE_TEXT "release" #else #define MODE_TEXT "debug" @@ -167,7 +167,7 @@ int main(int argc, char * const * argv) Logging::SetProgramName(BOX_MODULE); #ifdef HAVE_GETOPT_H - #ifdef NDEBUG + #ifdef BOX_RELEASE_BUILD int logLevel = Log::NOTICE; // need an int to do math with #else int logLevel = Log::INFO; // need an int to do math with diff --git a/infrastructure/makebuildenv.pl.in b/infrastructure/makebuildenv.pl.in index 8b91b972..5ed4a0ab 100755 --- a/infrastructure/makebuildenv.pl.in +++ b/infrastructure/makebuildenv.pl.in @@ -457,7 +457,6 @@ __E if (-d "$module/testfiles") { print TESTFILE <<__E; -echo Killing any running daemons... kill_process bbackupd kill_process bbstored __E @@ -560,7 +559,7 @@ DEFAULT_CXXFLAGS = @CPPFLAGS@ $default_cxxflags @CXXFLAGS_STRICT@ \\ LDFLAGS = @LDFLAGS@ @LDADD_RDYNAMIC@ .ifdef RELEASE -CXXFLAGS = -DNDEBUG $release_flags \$(DEFAULT_CXXFLAGS) +CXXFLAGS = -DBOX_RELEASE_BUILD $release_flags \$(DEFAULT_CXXFLAGS) OUTBASE = ../../release OUTDIR = ../../release/$mod DEPENDMAKEFLAGS = -D RELEASE diff --git a/infrastructure/msvc/2003/bbackupctl.vcproj b/infrastructure/msvc/2003/bbackupctl.vcproj index b2249ff8..02f7482e 100644 --- a/infrastructure/msvc/2003/bbackupctl.vcproj +++ b/infrastructure/msvc/2003/bbackupctl.vcproj @@ -20,7 +20,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories=""$(ProjectDir)..\..\..\..\db-4.2.52.NC\build_win32";"$(ProjectDir)..\..\..\lib\backupclient";"$(ProjectDir)..\..\..\lib\server";"$(ProjectDir)..\..\..\lib\crypto";"$(ProjectDir)..\..\..\..\openssl\include";"$(ProjectDir)..\..\..\lib\compress";"$(ProjectDir)..\..\..\..\zlib\include";"$(ProjectDir)..\..\..\lib\win32";"$(ProjectDir)..\..\..\lib\common\"" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PLATFORM_DISABLE_MEM_LEAK_TESTING;NDEBUG " + PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PLATFORM_DISABLE_MEM_LEAK_TESTING;BOX_RELEASE_BUILD " MinimalRebuild="TRUE" BasicRuntimeChecks="3" RuntimeLibrary="1" @@ -72,7 +72,7 @@ EnableFiberSafeOptimizations="TRUE" OptimizeForProcessor="1" AdditionalIncludeDirectories=""$(ProjectDir)..\..\..\lib\backupclient";"$(ProjectDir)..\..\..\lib\server";"$(ProjectDir)..\..\..\lib\crypto";"$(ProjectDir)..\..\..\..\openssl\include";"$(ProjectDir)..\..\..\lib\compress";"$(ProjectDir)..\..\..\..\zlib\include";"$(ProjectDir)..\..\..\lib\win32";"$(ProjectDir)..\..\..\lib\common\"" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;PLATFORM_DISABLE_MEM_LEAK_TESTING" + PreprocessorDefinitions="WIN32;BOX_RELEASE_BUILD;_CONSOLE;PLATFORM_DISABLE_MEM_LEAK_TESTING" RuntimeLibrary="0" BufferSecurityCheck="FALSE" UsePrecompiledHeader="0" diff --git a/infrastructure/msvc/2003/bbackupd.vcproj b/infrastructure/msvc/2003/bbackupd.vcproj index 182c10a2..f34db0cc 100644 --- a/infrastructure/msvc/2003/bbackupd.vcproj +++ b/infrastructure/msvc/2003/bbackupd.vcproj @@ -20,7 +20,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories=""$(SolutionDir)..\..\..\..\db-4.2.52.NC\build_win32";"$(SolutionDir)..\..\..\..\boost_1_31_0";"$(SolutionDir)..\..\..\..\openssl\include";"$(SolutionDir)..\..\..\..\zlib\include";"$(SolutionDir)..\..\..\lib\backupclient";"$(SolutionDir)..\..\..\lib\server";"$(SolutionDir)..\..\..\lib\crypto";"$(SolutionDir)..\..\..\lib\compress";"$(SolutionDir)..\..\..\lib\win32";"$(SolutionDir)..\..\..\lib\common\"" - PreprocessorDefinitions="BOOST_REGEX_NO_LIB;WIN32;_DEBUG;_CONSOLE;PLATFORM_DISABLE_MEM_LEAK_TESTING;NDEBUG " + PreprocessorDefinitions="BOOST_REGEX_NO_LIB;WIN32;_DEBUG;_CONSOLE;PLATFORM_DISABLE_MEM_LEAK_TESTING;BOX_RELEASE_BUILD " MinimalRebuild="TRUE" BasicRuntimeChecks="3" RuntimeLibrary="1" @@ -73,7 +73,7 @@ EnableFiberSafeOptimizations="TRUE" OptimizeForProcessor="1" AdditionalIncludeDirectories=""$(ProjectDir)..\..\..\lib\backupclient";"$(ProjectDir)..\..\..\lib\server";"$(ProjectDir)..\..\..\lib\crypto";"$(ProjectDir)..\..\..\..\openssl\include";"$(ProjectDir)..\..\..\lib\compress";"$(ProjectDir)..\..\..\..\zlib\include";"$(ProjectDir)..\..\..\lib\win32";"$(ProjectDir)..\..\..\lib\common\";"$(SolutionDir)..\..\..\..\boost_1_31_0"" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;PLATFORM_DISABLE_MEM_LEAK_TESTING;BOOST_REGEX_NO_LIB" + PreprocessorDefinitions="WIN32;BOX_RELEASE_BUILD;_CONSOLE;PLATFORM_DISABLE_MEM_LEAK_TESTING;BOOST_REGEX_NO_LIB" RuntimeLibrary="0" BufferSecurityCheck="FALSE" UsePrecompiledHeader="0" diff --git a/infrastructure/msvc/2003/boxquery.vcproj b/infrastructure/msvc/2003/boxquery.vcproj index 8d8cf20c..6ac09024 100644 --- a/infrastructure/msvc/2003/boxquery.vcproj +++ b/infrastructure/msvc/2003/boxquery.vcproj @@ -21,7 +21,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories=""$(ProjectDir)..\..\..\lib\backupclient";"$(ProjectDir)..\..\..\lib\server";"$(ProjectDir)..\..\..\lib\crypto";"$(ProjectDir)..\..\..\..\openssl\include";"$(ProjectDir)..\..\..\lib\compress";"$(ProjectDir)..\..\..\..\zlib\include";"$(ProjectDir)..\..\..\lib\win32";"$(ProjectDir)..\..\..\lib\common\";"$(SolutionDir)..\..\..\..\boost_1_31_0"" - PreprocessorDefinitions="BOOST_REGEX_NO_LIB;WIN32;_DEBUG;_CONSOLE;PLATFORM_DISABLE_MEM_LEAK_TESTING;NDEBUG " + PreprocessorDefinitions="BOOST_REGEX_NO_LIB;WIN32;_DEBUG;_CONSOLE;PLATFORM_DISABLE_MEM_LEAK_TESTING;BOX_RELEASE_BUILD " MinimalRebuild="TRUE" BasicRuntimeChecks="3" RuntimeLibrary="1" @@ -73,7 +73,7 @@ EnableFiberSafeOptimizations="TRUE" OptimizeForProcessor="1" AdditionalIncludeDirectories=""$(ProjectDir)..\..\..\lib\backupclient";"$(ProjectDir)..\..\..\lib\server";"$(ProjectDir)..\..\..\lib\crypto";"$(ProjectDir)..\..\..\..\openssl\include";"$(ProjectDir)..\..\..\lib\compress";"$(ProjectDir)..\..\..\..\zlib\include";"$(ProjectDir)..\..\..\lib\win32";"$(ProjectDir)..\..\..\lib\common\";"$(SolutionDir)..\..\..\..\boost_1_31_0"" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;PLATFORM_DISABLE_MEM_LEAK_TESTING;BOOST_REGEX_NO_LIB" + PreprocessorDefinitions="WIN32;BOX_RELEASE_BUILD;_CONSOLE;PLATFORM_DISABLE_MEM_LEAK_TESTING;BOOST_REGEX_NO_LIB" RuntimeLibrary="0" BufferSecurityCheck="FALSE" UsePrecompiledHeader="0" diff --git a/infrastructure/msvc/2003/common.vcproj b/infrastructure/msvc/2003/common.vcproj index bdae0bb8..fb18b76a 100644 --- a/infrastructure/msvc/2003/common.vcproj +++ b/infrastructure/msvc/2003/common.vcproj @@ -20,7 +20,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories=""$(ProjectDir)..\..\..\lib\backupclient";"$(ProjectDir)..\..\..\lib\server";"$(ProjectDir)..\..\..\lib\crypto";"$(ProjectDir)..\..\..\..\openssl\include";"$(ProjectDir)..\..\..\lib\compress";"$(ProjectDir)..\..\..\..\zlib\include";"$(ProjectDir)..\..\..\lib\win32";"$(ProjectDir)..\..\..\lib\common\";"$(SolutionDir)..\..\..\..\boost_1_31_0\"" - PreprocessorDefinitions="BOOST_REGEX_NO_LIB;WIN32;_DEBUG;_LIB;PLATFORM_DISABLE_MEM_LEAK_TESTING;NDEBUG " + PreprocessorDefinitions="BOOST_REGEX_NO_LIB;WIN32;_DEBUG;_LIB;PLATFORM_DISABLE_MEM_LEAK_TESTING;BOX_RELEASE_BUILD " MinimalRebuild="TRUE" BasicRuntimeChecks="3" RuntimeLibrary="1" @@ -64,7 +64,7 @@ EnableFiberSafeOptimizations="TRUE" OptimizeForProcessor="1" AdditionalIncludeDirectories=""$(ProjectDir)..\..\..\lib\backupclient";"$(ProjectDir)..\..\..\lib\server";"$(ProjectDir)..\..\..\lib\crypto";"$(ProjectDir)..\..\..\..\openssl\include";"$(ProjectDir)..\..\..\lib\compress";"$(ProjectDir)..\..\..\..\zlib\include";"$(ProjectDir)..\..\..\lib\win32";"$(ProjectDir)..\..\..\lib\common\";"$(SolutionDir)..\..\..\..\boost_1_31_0\"" - PreprocessorDefinitions="BOOST_REGEX_NO_LIB;WIN32;NDEBUG;_LIB;PLATFORM_DISABLE_MEM_LEAK_TESTING" + PreprocessorDefinitions="BOOST_REGEX_NO_LIB;WIN32;BOX_RELEASE_BUILD;_LIB;PLATFORM_DISABLE_MEM_LEAK_TESTING" RuntimeLibrary="0" BufferSecurityCheck="FALSE" UsePrecompiledHeader="0" diff --git a/infrastructure/msvc/2003/win32test.vcproj b/infrastructure/msvc/2003/win32test.vcproj index e758be34..2ef7164e 100644 --- a/infrastructure/msvc/2003/win32test.vcproj +++ b/infrastructure/msvc/2003/win32test.vcproj @@ -72,7 +72,7 @@ EnableFiberSafeOptimizations="TRUE" OptimizeForProcessor="1" AdditionalIncludeDirectories=""$(ProjectDir)..\..\..\bin\bbackupd";"$(ProjectDir)..\..\..\lib\backupclient";"$(ProjectDir)..\..\..\lib\server";"$(ProjectDir)..\..\..\lib\crypto";"$(ProjectDir)..\..\..\..\openssl\include";"$(ProjectDir)..\..\..\lib\compress";"$(ProjectDir)..\..\..\..\zlib\include";"$(ProjectDir)..\..\..\lib\win32";"$(ProjectDir)..\..\..\lib\common\"" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;PLATFORM_DISABLE_MEM_LEAK_TESTING" + PreprocessorDefinitions="WIN32;BOX_RELEASE_BUILD;_CONSOLE;PLATFORM_DISABLE_MEM_LEAK_TESTING" RuntimeLibrary="0" BufferSecurityCheck="FALSE" UsePrecompiledHeader="0" diff --git a/infrastructure/msvc/2005/bbackupctl.vcproj b/infrastructure/msvc/2005/bbackupctl.vcproj index 620ca6e6..216a284b 100644 --- a/infrastructure/msvc/2005/bbackupctl.vcproj +++ b/infrastructure/msvc/2005/bbackupctl.vcproj @@ -123,7 +123,7 @@ Name="VCCLCompilerTool" EnableFiberSafeOptimizations="true" AdditionalIncludeDirectories=""$(ProjectDir)..\..\..\lib\backupclient";"$(ProjectDir)..\..\..\lib\server";"$(ProjectDir)..\..\..\lib\crypto";"$(ProjectDir)..\..\..\..\openssl\inc32";"$(ProjectDir)..\..\..\lib\compress";"$(ProjectDir)..\..\..\..\zlib\include";"$(ProjectDir)..\..\..\lib\win32";"$(ProjectDir)..\..\..\lib\common\"" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;PLATFORM_DISABLE_MEM_LEAK_TESTING;_CRT_SECURE_NO_DEPRECATE;PCRE_STATIC" + PreprocessorDefinitions="WIN32;BOX_RELEASE_BUILD;_CONSOLE;PLATFORM_DISABLE_MEM_LEAK_TESTING;_CRT_SECURE_NO_DEPRECATE;PCRE_STATIC" RuntimeLibrary="0" BufferSecurityCheck="false" UsePrecompiledHeader="0" diff --git a/infrastructure/msvc/2005/bbackupd.vcproj b/infrastructure/msvc/2005/bbackupd.vcproj index 8a1d71e3..ac8eb86a 100644 --- a/infrastructure/msvc/2005/bbackupd.vcproj +++ b/infrastructure/msvc/2005/bbackupd.vcproj @@ -124,7 +124,7 @@ Name="VCCLCompilerTool" EnableFiberSafeOptimizations="true" AdditionalIncludeDirectories=""$(ProjectDir)..\..\..\lib\backupclient";"$(ProjectDir)..\..\..\lib\server";"$(ProjectDir)..\..\..\lib\crypto";"$(SolutionDir)..\..\..\..\openssl\inc32";"$(ProjectDir)..\..\..\lib\compress";"$(ProjectDir)..\..\..\..\zlib\include";"$(ProjectDir)..\..\..\lib\win32";"$(ProjectDir)..\..\..\lib\common\"" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;PLATFORM_DISABLE_MEM_LEAK_TESTING;_CRT_SECURE_NO_DEPRECATE;PCRE_STATIC" + PreprocessorDefinitions="WIN32;BOX_RELEASE_BUILD;_CONSOLE;PLATFORM_DISABLE_MEM_LEAK_TESTING;_CRT_SECURE_NO_DEPRECATE;PCRE_STATIC" RuntimeLibrary="0" BufferSecurityCheck="false" UsePrecompiledHeader="0" diff --git a/infrastructure/msvc/2005/boxquery.vcproj b/infrastructure/msvc/2005/boxquery.vcproj index 24136106..776c0ac9 100644 --- a/infrastructure/msvc/2005/boxquery.vcproj +++ b/infrastructure/msvc/2005/boxquery.vcproj @@ -123,7 +123,7 @@ Name="VCCLCompilerTool" EnableFiberSafeOptimizations="true" AdditionalIncludeDirectories=""$(ProjectDir)..\..\..\lib\backupclient";"$(ProjectDir)..\..\..\lib\server";"$(ProjectDir)..\..\..\lib\crypto";"$(ProjectDir)..\..\..\..\openssl\include";"$(ProjectDir)..\..\..\lib\compress";"$(ProjectDir)..\..\..\..\zlib\include";"$(ProjectDir)..\..\..\lib\win32";"$(ProjectDir)..\..\..\lib\common\"" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;PLATFORM_DISABLE_MEM_LEAK_TESTING;PCRE_STATIC" + PreprocessorDefinitions="WIN32;BOX_RELEASE_BUILD;_CONSOLE;PLATFORM_DISABLE_MEM_LEAK_TESTING;PCRE_STATIC" RuntimeLibrary="0" BufferSecurityCheck="false" UsePrecompiledHeader="0" diff --git a/infrastructure/msvc/2005/common.vcproj b/infrastructure/msvc/2005/common.vcproj index a732ca36..256bce06 100644 --- a/infrastructure/msvc/2005/common.vcproj +++ b/infrastructure/msvc/2005/common.vcproj @@ -111,7 +111,7 @@ Name="VCCLCompilerTool" EnableFiberSafeOptimizations="true" AdditionalIncludeDirectories=""$(ProjectDir)..\..\..\lib\backupclient";"$(ProjectDir)..\..\..\lib\common\";"$(ProjectDir)..\..\..\lib\compress";"$(ProjectDir)..\..\..\lib\crypto";"$(ProjectDir)..\..\..\lib\server";"$(ProjectDir)..\..\..\lib\win32";"$(ProjectDir)..\..\..\..\openssl\inc32";"$(ProjectDir)..\..\..\..\zlib\include";"$(ProjectDir)..\..\..\..\pcre\pcre-6.7\"" - PreprocessorDefinitions="WIN32;NDEBUG;_LIB;PLATFORM_DISABLE_MEM_LEAK_TESTING;_CRT_SECURE_NO_DEPRECATE;PCRE_STATIC" + PreprocessorDefinitions="WIN32;BOX_RELEASE_BUILD;_LIB;PLATFORM_DISABLE_MEM_LEAK_TESTING;_CRT_SECURE_NO_DEPRECATE;PCRE_STATIC" RuntimeLibrary="0" BufferSecurityCheck="false" UsePrecompiledHeader="0" diff --git a/infrastructure/msvc/2005/win32test.vcproj b/infrastructure/msvc/2005/win32test.vcproj index 62d812f3..0f97c302 100644 --- a/infrastructure/msvc/2005/win32test.vcproj +++ b/infrastructure/msvc/2005/win32test.vcproj @@ -123,7 +123,7 @@ Name="VCCLCompilerTool" EnableFiberSafeOptimizations="true" AdditionalIncludeDirectories=""$(ProjectDir)..\..\..\bin\bbackupd";"$(ProjectDir)..\..\..\lib\backupclient";"$(ProjectDir)..\..\..\lib\common\";"$(ProjectDir)..\..\..\lib\compress";"$(ProjectDir)..\..\..\lib\crypto";"$(ProjectDir)..\..\..\lib\server";"$(ProjectDir)..\..\..\lib\win32";"$(ProjectDir)..\..\..\..\openssl\inc32";"$(ProjectDir)..\..\..\..\zlib\include"" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;PLATFORM_DISABLE_MEM_LEAK_TESTING;_CRT_SECURE_NO_DEPRECATE;PCRE_STATIC" + PreprocessorDefinitions="WIN32;BOX_RELEASE_BUILD;_CONSOLE;PLATFORM_DISABLE_MEM_LEAK_TESTING;_CRT_SECURE_NO_DEPRECATE;PCRE_STATIC" RuntimeLibrary="0" BufferSecurityCheck="false" UsePrecompiledHeader="0" diff --git a/lib/backupclient/BackupStoreFile.h b/lib/backupclient/BackupStoreFile.h index d7a71318..7bd75fa5 100644 --- a/lib/backupclient/BackupStoreFile.h +++ b/lib/backupclient/BackupStoreFile.h @@ -215,7 +215,7 @@ public: static BackupStoreFileStats msStats; // For debug -#ifndef NDEBUG +#ifndef BOX_RELEASE_BUILD static bool TraceDetailsOfDiffProcess; #endif diff --git a/lib/backupclient/BackupStoreFileDiff.cpp b/lib/backupclient/BackupStoreFileDiff.cpp index da0324fd..87cf7cff 100644 --- a/lib/backupclient/BackupStoreFileDiff.cpp +++ b/lib/backupclient/BackupStoreFileDiff.cpp @@ -40,7 +40,7 @@ using namespace BackupStoreFileCreation; // By default, don't trace out details of the diff as we go along -- would fill up logs significantly. // But it's useful for the test. -#ifndef NDEBUG +#ifndef BOX_RELEASE_BUILD bool BackupStoreFile::TraceDetailsOfDiffProcess = false; #endif @@ -436,7 +436,7 @@ static void FindMostUsedSizes(BlocksAvailableEntry *pIndex, int64_t NumBlocks, i } // trace the size table in debug builds -#ifndef NDEBUG +#ifndef BOX_RELEASE_BUILD if(BackupStoreFile::TraceDetailsOfDiffProcess) { for(int t = 0; t < BACKUP_FILE_DIFF_MAX_BLOCK_SIZES; ++t) @@ -728,7 +728,7 @@ static void SearchForMatchingBlocks(IOStream &rFile, std::map throw; } -#ifndef NDEBUG +#ifndef BOX_RELEASE_BUILD if(BackupStoreFile::TraceDetailsOfDiffProcess) { // Trace out the found blocks in debug mode @@ -810,7 +810,7 @@ static bool SecondStageMatch(BlocksAvailableEntry *pFirstInHashList, RollingChec ASSERT(pFirstInHashList != 0); ASSERT(pIndex != 0); -#ifndef NDEBUG +#ifndef BOX_RELEASE_BUILD uint16_t DEBUG_Hash = fastSum.GetComponentForHashing(); #endif uint32_t Checksum = fastSum.GetChecksum(); @@ -916,7 +916,7 @@ static void GenerateRecipe(BackupStoreFileEncodeStream::Recipe &rRecipe, BlocksA instruction.mSpaceBefore = SizeOfInputFile; rRecipe.push_back(instruction); - #ifndef NDEBUG + #ifndef BOX_RELEASE_BUILD if(BackupStoreFile::TraceDetailsOfDiffProcess) { BOX_TRACE("Diff: Default recipe generated, " << @@ -936,7 +936,7 @@ static void GenerateRecipe(BackupStoreFileEncodeStream::Recipe &rRecipe, BlocksA ASSERT(i != rFoundBlocks.end()); // check logic // Counting for debug tracing -#ifndef NDEBUG +#ifndef BOX_RELEASE_BUILD int64_t debug_NewBytesFound = 0; int64_t debug_OldBlocksUsed = 0; #endif @@ -963,7 +963,7 @@ static void GenerateRecipe(BackupStoreFileEncodeStream::Recipe &rRecipe, BlocksA instruction.mSpaceBefore = i->first - loc; // Move location forward to match loc += instruction.mSpaceBefore; -#ifndef NDEBUG +#ifndef BOX_RELEASE_BUILD debug_NewBytesFound += instruction.mSpaceBefore; #endif } @@ -989,7 +989,7 @@ static void GenerateRecipe(BackupStoreFileEncodeStream::Recipe &rRecipe, BlocksA instruction.mBlocks += 1; } -#ifndef NDEBUG +#ifndef BOX_RELEASE_BUILD debug_OldBlocksUsed++; #endif @@ -1005,14 +1005,14 @@ static void GenerateRecipe(BackupStoreFileEncodeStream::Recipe &rRecipe, BlocksA { RESET_INSTRUCTION instruction.mSpaceBefore = SizeOfInputFile - loc; -#ifndef NDEBUG +#ifndef BOX_RELEASE_BUILD debug_NewBytesFound += instruction.mSpaceBefore; #endif rRecipe.push_back(instruction); } // dump out the recipe -#ifndef NDEBUG +#ifndef BOX_RELEASE_BUILD BOX_TRACE("Diff: " << debug_NewBytesFound << " new bytes found, " << debug_OldBlocksUsed << " old blocks used"); diff --git a/lib/backupclient/BackupStoreFileEncodeStream.cpp b/lib/backupclient/BackupStoreFileEncodeStream.cpp index 3b45e6c0..b2d44697 100644 --- a/lib/backupclient/BackupStoreFileEncodeStream.cpp +++ b/lib/backupclient/BackupStoreFileEncodeStream.cpp @@ -236,7 +236,7 @@ void BackupStoreFileEncodeStream::Setup(const char *Filename, { throw std::bad_alloc(); } -#ifndef NDEBUG +#ifndef BOX_RELEASE_BUILD // In debug builds, make sure that the reallocation code is exercised. mEncodedBuffer.Allocate(mAllocatedBufferSize / 4); #else diff --git a/lib/backupstore/BackupStoreCheck.h b/lib/backupstore/BackupStoreCheck.h index 3f48312a..1d5c1b1e 100644 --- a/lib/backupstore/BackupStoreCheck.h +++ b/lib/backupstore/BackupStoreCheck.h @@ -48,7 +48,7 @@ The following problems can be fixed: // Size of blocks in the list of IDs -#ifdef NDEBUG +#ifdef BOX_RELEASE_BUILD #define BACKUPSTORECHECK_BLOCK_SIZE (64*1024) #else #define BACKUPSTORECHECK_BLOCK_SIZE 8 @@ -150,7 +150,7 @@ private: return (pBlock->mFlags[Index / Flags__NumItemsPerEntry] >> ((Index % Flags__NumItemsPerEntry) * Flags__NumFlags)) & Flags__MASK; } -#ifndef NDEBUG +#ifndef BOX_RELEASE_BUILD void DumpObjectInfo(); #define DUMP_OBJECT_INFO DumpObjectInfo(); #else diff --git a/lib/backupstore/BackupStoreCheckData.cpp b/lib/backupstore/BackupStoreCheckData.cpp index aeb96173..fed0c3f1 100644 --- a/lib/backupstore/BackupStoreCheckData.cpp +++ b/lib/backupstore/BackupStoreCheckData.cpp @@ -174,7 +174,7 @@ BackupStoreCheck::IDBlock *BackupStoreCheck::LookupID(BackupStoreCheck_ID_t ID, } -#ifndef NDEBUG +#ifndef BOX_RELEASE_BUILD // -------------------------------------------------------------------------- // // Function diff --git a/lib/backupstore/BackupStoreInfo.cpp b/lib/backupstore/BackupStoreInfo.cpp index 70d51a12..1d55fdf0 100644 --- a/lib/backupstore/BackupStoreInfo.cpp +++ b/lib/backupstore/BackupStoreInfo.cpp @@ -55,7 +55,7 @@ typedef struct END_STRUCTURE_PACKING_FOR_WIRE #endif -#ifdef NDEBUG +#ifdef BOX_RELEASE_BUILD #define NUM_DELETED_DIRS_BLOCK 256 #else #define NUM_DELETED_DIRS_BLOCK 2 diff --git a/lib/backupstore/StoreStructure.h b/lib/backupstore/StoreStructure.h index 094c0deb..ffbe83dd 100644 --- a/lib/backupstore/StoreStructure.h +++ b/lib/backupstore/StoreStructure.h @@ -12,7 +12,7 @@ #include -#ifdef NDEBUG +#ifdef BOX_RELEASE_BUILD #define STORE_ID_SEGMENT_LENGTH 8 #define STORE_ID_SEGMENT_MASK 0xff #else diff --git a/lib/common/Box.h b/lib/common/Box.h index 6b50ade1..1124a062 100644 --- a/lib/common/Box.h +++ b/lib/common/Box.h @@ -37,7 +37,7 @@ #include "CommonException.h" #include "Logging.h" -#ifndef NDEBUG +#ifndef BOX_RELEASE_BUILD extern bool AssertFailuresToSyslog; #define ASSERT_FAILS_TO_SYSLOG_ON {AssertFailuresToSyslog = true;} diff --git a/lib/common/DebugAssertFailed.cpp b/lib/common/DebugAssertFailed.cpp index cceab0ef..e498d641 100644 --- a/lib/common/DebugAssertFailed.cpp +++ b/lib/common/DebugAssertFailed.cpp @@ -7,7 +7,7 @@ // // -------------------------------------------------------------------------- -#ifndef NDEBUG +#ifndef BOX_RELEASE_BUILD #include "Box.h" @@ -33,5 +33,5 @@ void BoxDebugAssertFailed(const char *cond, const char *file, int line) } -#endif // NDEBUG +#endif // BOX_RELEASE_BUILD diff --git a/lib/common/DebugMemLeakFinder.cpp b/lib/common/DebugMemLeakFinder.cpp index 90372a72..230d7163 100644 --- a/lib/common/DebugMemLeakFinder.cpp +++ b/lib/common/DebugMemLeakFinder.cpp @@ -8,7 +8,7 @@ // -------------------------------------------------------------------------- -#ifndef NDEBUG +#ifndef BOX_RELEASE_BUILD #include "Box.h" @@ -548,4 +548,4 @@ void operator delete(void *ptr) throw () internal_delete(ptr); } -#endif // NDEBUG +#endif // BOX_RELEASE_BUILD diff --git a/lib/common/DebugPrintf.cpp b/lib/common/DebugPrintf.cpp index 8d75f458..1335d473 100644 --- a/lib/common/DebugPrintf.cpp +++ b/lib/common/DebugPrintf.cpp @@ -7,7 +7,7 @@ // // -------------------------------------------------------------------------- -#ifndef NDEBUG +#ifndef BOX_RELEASE_BUILD #include "Box.h" @@ -80,4 +80,4 @@ int BoxDebugTrace(const char *format, ...) } -#endif // NDEBUG +#endif // BOX_RELEASE_BUILD diff --git a/lib/common/FdGetLine.h b/lib/common/FdGetLine.h index a18007a3..df43c3c9 100644 --- a/lib/common/FdGetLine.h +++ b/lib/common/FdGetLine.h @@ -12,7 +12,7 @@ #include -#ifdef NDEBUG +#ifdef BOX_RELEASE_BUILD #define FDGETLINE_BUFFER_SIZE 1024 #elif defined WIN32 // need enough space for at least one unicode character diff --git a/lib/common/IOStreamGetLine.h b/lib/common/IOStreamGetLine.h index cf152e5a..9a5d1818 100644 --- a/lib/common/IOStreamGetLine.h +++ b/lib/common/IOStreamGetLine.h @@ -14,7 +14,7 @@ #include "IOStream.h" -#ifdef NDEBUG +#ifdef BOX_RELEASE_BUILD #define IOSTREAMGETLINE_BUFFER_SIZE 1024 #else #define IOSTREAMGETLINE_BUFFER_SIZE 4 diff --git a/lib/common/Timer.cpp b/lib/common/Timer.cpp index b4629ed2..cac86512 100644 --- a/lib/common/Timer.cpp +++ b/lib/common/Timer.cpp @@ -347,7 +347,7 @@ Timer::Timer(size_t timeoutSecs, const std::string& rName) , mTimerHandle(INVALID_HANDLE_VALUE) #endif { - #ifndef NDEBUG + #ifndef BOX_RELEASE_BUILD if (timeoutSecs == 0) { BOX_TRACE(TIMER_ID "initialised for " << timeoutSecs << @@ -476,7 +476,7 @@ void Timer::Stop() Timer::~Timer() { - #ifndef NDEBUG + #ifndef BOX_RELEASE_BUILD BOX_TRACE(TIMER_ID "destroyed"); #endif @@ -503,7 +503,7 @@ Timer::Timer(const Timer& rToCopy) , mTimerHandle(INVALID_HANDLE_VALUE) #endif { - #ifndef NDEBUG + #ifndef BOX_RELEASE_BUILD if (mExpired) { BOX_TRACE(TIMER_ID "initialised from timer " << &rToCopy << ", " @@ -544,7 +544,7 @@ Timer::Timer(const Timer& rToCopy) Timer& Timer::operator=(const Timer& rToCopy) { - #ifndef NDEBUG + #ifndef BOX_RELEASE_BUILD if (rToCopy.mExpired) { BOX_TRACE(TIMER_ID "initialised from timer " << &rToCopy << ", " @@ -595,7 +595,7 @@ Timer& Timer::operator=(const Timer& rToCopy) void Timer::OnExpire() { - #ifndef NDEBUG + #ifndef BOX_RELEASE_BUILD BOX_TRACE(TIMER_ID "fired"); #endif diff --git a/lib/common/Utils.cpp b/lib/common/Utils.cpp index c259edeb..408eaa57 100644 --- a/lib/common/Utils.cpp +++ b/lib/common/Utils.cpp @@ -58,7 +58,7 @@ void SplitString(const std::string &String, char SplitOn, std::vector