Merge pull request #649 from PeterMatula/rename-DEBUG-define
rename DEBUG define to TINYXML2_DEBUG
This commit is contained in:
@@ -27,7 +27,7 @@ set(GENERIC_LIB_SOVERSION "6")
|
||||
################################
|
||||
# Add definitions
|
||||
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DTINYXML2_DEBUG")
|
||||
|
||||
################################
|
||||
# Add targets
|
||||
|
||||
@@ -135,7 +135,7 @@ def cmakeRule2( line ):
|
||||
fileProcess( "CMakeLists.txt", cmakeRule2 )
|
||||
|
||||
print( "Release note:" )
|
||||
print( '1. Build. g++ -Wall -DDEBUG tinyxml2.cpp xmltest.cpp -o gccxmltest.exe' )
|
||||
print( '1. Build. g++ -Wall -DTINYXML2_DEBUG tinyxml2.cpp xmltest.cpp -o gccxmltest.exe' )
|
||||
print( '2. Commit. git commit -am"setting the version to ' + versionStr + '"' )
|
||||
print( '3. Tag. git tag ' + versionStr )
|
||||
print( ' OR git tag -a ' + versionStr + ' -m [tag message]' )
|
||||
|
||||
@@ -2037,7 +2037,7 @@ void XMLDocument::Clear()
|
||||
DeleteNode(_unlinked[0]); // Will remove from _unlinked as part of delete.
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
#ifdef TINYXML2_DEBUG
|
||||
const bool hadError = Error();
|
||||
#endif
|
||||
ClearError();
|
||||
@@ -2052,7 +2052,7 @@ void XMLDocument::Clear()
|
||||
_attributePool.Trace( "attribute" );
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG
|
||||
#ifdef TINYXML2_DEBUG
|
||||
if ( !hadError ) {
|
||||
TIXMLASSERT( _elementPool.CurrentAllocs() == _elementPool.Untracked() );
|
||||
TIXMLASSERT( _attributePool.CurrentAllocs() == _attributePool.Untracked() );
|
||||
|
||||
10
tinyxml2.h
10
tinyxml2.h
@@ -47,15 +47,15 @@ distribution.
|
||||
*/
|
||||
/*
|
||||
gcc:
|
||||
g++ -Wall -DDEBUG tinyxml2.cpp xmltest.cpp -o gccxmltest.exe
|
||||
g++ -Wall -DTINYXML2_DEBUG tinyxml2.cpp xmltest.cpp -o gccxmltest.exe
|
||||
|
||||
Formatting, Artistic Style:
|
||||
AStyle.exe --style=1tbs --indent-switches --break-closing-brackets --indent-preprocessor tinyxml2.cpp tinyxml2.h
|
||||
*/
|
||||
|
||||
#if defined( _DEBUG ) || defined (__DEBUG__)
|
||||
# ifndef DEBUG
|
||||
# define DEBUG
|
||||
# ifndef TINYXML2_DEBUG
|
||||
# define TINYXML2_DEBUG
|
||||
# endif
|
||||
#endif
|
||||
|
||||
@@ -79,7 +79,7 @@ distribution.
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(DEBUG)
|
||||
#if defined(TINYXML2_DEBUG)
|
||||
# if defined(_MSC_VER)
|
||||
# // "(void)0," is for suppressing C4127 warning in "assert(false)", "assert(true)" and the like
|
||||
# define TIXMLASSERT( x ) if ( !((void)0,(x))) { __debugbreak(); }
|
||||
@@ -395,7 +395,7 @@ public:
|
||||
}
|
||||
--_currentAllocs;
|
||||
Item* item = static_cast<Item*>( mem );
|
||||
#ifdef DEBUG
|
||||
#ifdef TINYXML2_DEBUG
|
||||
memset( item, 0xfe, sizeof( *item ) );
|
||||
#endif
|
||||
item->next = _root;
|
||||
|
||||
@@ -137,7 +137,7 @@
|
||||
buildSettings = {
|
||||
CONFIGURATION_BUILD_DIR = "$(SYMROOT)/Debug";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
"GCC_PREPROCESSOR_DEFINITIONS[arch=*]" = DEBUG;
|
||||
"GCC_PREPROCESSOR_DEFINITIONS[arch=*]" = TINYXML2_DEBUG;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SYMROOT = build;
|
||||
};
|
||||
|
||||
12
xmltest.cpp
12
xmltest.cpp
@@ -292,7 +292,7 @@ bool example_4()
|
||||
|
||||
int main( int argc, const char ** argv )
|
||||
{
|
||||
#if defined( _MSC_VER ) && defined( DEBUG )
|
||||
#if defined( _MSC_VER ) && defined( TINYXML2_DEBUG )
|
||||
_CrtMemCheckpoint( &startMemState );
|
||||
// Enable MS Visual C++ debug heap memory leaks dump on exit
|
||||
_CrtSetDbgFlag(_CrtSetDbgFlag(_CRTDBG_REPORT_FLAG) | _CRTDBG_LEAK_CHECK_DF);
|
||||
@@ -1861,7 +1861,7 @@ int main( int argc, const char ** argv )
|
||||
}
|
||||
|
||||
{
|
||||
// If this doesn't assert in DEBUG, all is well.
|
||||
// If this doesn't assert in TINYXML2_DEBUG, all is well.
|
||||
tinyxml2::XMLDocument doc;
|
||||
tinyxml2::XMLElement *pRoot = doc.NewElement("Root");
|
||||
doc.DeleteNode(pRoot);
|
||||
@@ -1876,7 +1876,7 @@ int main( int argc, const char ** argv )
|
||||
}
|
||||
|
||||
{
|
||||
// If this doesn't assert in DEBUG, all is well.
|
||||
// If this doesn't assert in TINYXML2_DEBUG, all is well.
|
||||
XMLDocument doc;
|
||||
XMLElement* unlinkedRoot = doc.NewElement( "Root" );
|
||||
XMLElement* linkedRoot = doc.NewElement( "Root" );
|
||||
@@ -1886,7 +1886,7 @@ int main( int argc, const char ** argv )
|
||||
}
|
||||
|
||||
{
|
||||
// Should not assert in DEBUG
|
||||
// Should not assert in TINYXML2_DEBUG
|
||||
XMLPrinter printer;
|
||||
}
|
||||
|
||||
@@ -2266,7 +2266,7 @@ int main( int argc, const char ** argv )
|
||||
delete[] mem;
|
||||
|
||||
static const char* note =
|
||||
#ifdef DEBUG
|
||||
#ifdef TINYXML2_DEBUG
|
||||
"DEBUG";
|
||||
#else
|
||||
"Release";
|
||||
@@ -2280,7 +2280,7 @@ int main( int argc, const char ** argv )
|
||||
printf("\nParsing dream.xml (%s): %.3f milli-seconds\n", note, duration);
|
||||
}
|
||||
|
||||
#if defined( _MSC_VER ) && defined( DEBUG )
|
||||
#if defined( _MSC_VER ) && defined( TINYXML2_DEBUG )
|
||||
{
|
||||
_CrtMemCheckpoint( &endMemState );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user