Update tinyxml to v2.0.2.
This commit is contained in:
parent
fc54e6acc4
commit
d035470963
|
@ -1855,26 +1855,18 @@ 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.
|
||||||
|
#if defined(_MSC_VER) && (_MSC_VER >= 1400 )
|
||||||
|
vsnprintf_s( p, len+1, _TRUNCATE, format, va );
|
||||||
|
#else
|
||||||
vsnprintf( p, len+1, format, va );
|
vsnprintf( p, len+1, format, va );
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue