mirror of
https://github.com/AxioDL/tinyxml2.git
synced 2025-05-15 03:41:30 +00:00
Suppress C4127 in asserts
This commit is contained in:
parent
69242c4b9b
commit
4bcbf142a8
@ -523,15 +523,8 @@ char* XMLDocument::Identify( char* p, XMLNode** node )
|
|||||||
static const int cdataHeaderLen = 9;
|
static const int cdataHeaderLen = 9;
|
||||||
static const int elementHeaderLen = 1;
|
static const int elementHeaderLen = 1;
|
||||||
|
|
||||||
#if defined(_MSC_VER)
|
|
||||||
#pragma warning ( push )
|
|
||||||
#pragma warning ( disable : 4127 )
|
|
||||||
#endif
|
|
||||||
TIXMLASSERT( sizeof( XMLComment ) == sizeof( XMLUnknown ) ); // use same memory pool
|
TIXMLASSERT( sizeof( XMLComment ) == sizeof( XMLUnknown ) ); // use same memory pool
|
||||||
TIXMLASSERT( sizeof( XMLComment ) == sizeof( XMLDeclaration ) ); // use same memory pool
|
TIXMLASSERT( sizeof( XMLComment ) == sizeof( XMLDeclaration ) ); // use same memory pool
|
||||||
#if defined(_MSC_VER)
|
|
||||||
#pragma warning (pop)
|
|
||||||
#endif
|
|
||||||
XMLNode* returnNode = 0;
|
XMLNode* returnNode = 0;
|
||||||
if ( XMLUtil::StringEqual( p, xmlHeader, xmlHeaderLen ) ) {
|
if ( XMLUtil::StringEqual( p, xmlHeader, xmlHeaderLen ) ) {
|
||||||
TIXMLASSERT( sizeof( XMLDeclaration ) == _commentPool.ItemSize() );
|
TIXMLASSERT( sizeof( XMLDeclaration ) == _commentPool.ItemSize() );
|
||||||
|
@ -77,7 +77,8 @@ distribution.
|
|||||||
|
|
||||||
#if defined(DEBUG)
|
#if defined(DEBUG)
|
||||||
# if defined(_MSC_VER)
|
# if defined(_MSC_VER)
|
||||||
# define TIXMLASSERT( x ) if ( !(x)) { __debugbreak(); } //if ( !(x)) WinDebugBreak()
|
# // "(void)0," is for suppressing C4127 warning in "assert(false)", "assert(true)" and the like
|
||||||
|
# define TIXMLASSERT( x ) if ( !((void)0,(x))) { __debugbreak(); } //if ( !(x)) WinDebugBreak()
|
||||||
# elif defined (ANDROID_NDK)
|
# elif defined (ANDROID_NDK)
|
||||||
# include <android/log.h>
|
# include <android/log.h>
|
||||||
# define TIXMLASSERT( x ) if ( !(x)) { __android_log_assert( "assert", "grinliz", "ASSERT in '%s' at %d.", __FILE__, __LINE__ ); }
|
# define TIXMLASSERT( x ) if ( !(x)) { __android_log_assert( "assert", "grinliz", "ASSERT in '%s' at %d.", __FILE__, __LINE__ ); }
|
||||||
|
@ -295,6 +295,10 @@ int main( int argc, const char ** argv )
|
|||||||
mkdir( "resources/out/", S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
|
mkdir( "resources/out/", S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
{
|
||||||
|
TIXMLASSERT( true );
|
||||||
|
}
|
||||||
|
|
||||||
if ( argc > 1 ) {
|
if ( argc > 1 ) {
|
||||||
XMLDocument* doc = new XMLDocument();
|
XMLDocument* doc = new XMLDocument();
|
||||||
clock_t startTime = clock();
|
clock_t startTime = clock();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user