Update tinyxml to v2.0.2.

This commit is contained in:
XhmikosR 2014-03-17 09:51:27 +02:00
parent fc54e6acc4
commit d035470963
2 changed files with 9 additions and 17 deletions

View File

@ -1855,27 +1855,19 @@ void XMLPrinter::Print( const char* format, ... )
vfprintf( _fp, format, va ); vfprintf( _fp, format, va );
} }
else { else {
// This seems brutally complex. Haven't figured out a better #if defined(_MSC_VER) && (_MSC_VER >= 1400 )
// way on windows. int len = _vscprintf( format, va );
#ifdef _MSC_VER
int len = -1;
int expand = 1000;
while ( len < 0 ) {
len = vsnprintf_s( _accumulator.Mem(), _accumulator.Capacity(), _TRUNCATE, format, va );
if ( len < 0 ) {
expand *= 3/2;
_accumulator.PushArr( expand );
}
}
char* p = _buffer.PushArr( len ) - 1;
memcpy( p, _accumulator.Mem(), len+1 );
#else #else
int len = vsnprintf( 0, 0, format, va ); int len = vsnprintf( 0, 0, format, va );
#endif
// Close out and re-start the va-args // Close out and re-start the va-args
va_end( va ); va_end( va );
va_start( va, format ); va_start( va, format );
char* p = _buffer.PushArr( len ) - 1; char* p = _buffer.PushArr( len ) - 1; // back up over the null terminator.
vsnprintf( p, len+1, format, va ); #if defined(_MSC_VER) && (_MSC_VER >= 1400 )
vsnprintf_s( p, len+1, _TRUNCATE, format, va );
#else
vsnprintf( p, len+1, format, va );
#endif #endif
} }
va_end( va ); va_end( va );

View File

@ -121,7 +121,7 @@ inline int TIXML_SNPRINTF( char* buffer, size_t size, const char* format, ... )
*/ */
static const int TIXML2_MAJOR_VERSION = 2; static const int TIXML2_MAJOR_VERSION = 2;
static const int TIXML2_MINOR_VERSION = 0; static const int TIXML2_MINOR_VERSION = 0;
static const int TIXML2_PATCH_VERSION = 0; static const int TIXML2_PATCH_VERSION = 2;
namespace tinyxml2 namespace tinyxml2
{ {