Skip to content

Commit b2dea34

Browse files
committed
remove dead platforms
1 parent 111f462 commit b2dea34

2 files changed

Lines changed: 10 additions & 44 deletions

File tree

tinyxml2.cpp

Lines changed: 9 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ distribution.
2424
#include "tinyxml2.h"
2525

2626
#include <new> // yes, this one new style header, is in the Android SDK.
27-
#if defined(ANDROID_NDK) || defined(__BORLANDC__) || defined(__QNXNTO__) || defined(__CC_ARM)
27+
#if defined(ANDROID_NDK)
2828
# include <stddef.h>
2929
# include <stdarg.h>
3030
#else
@@ -40,9 +40,7 @@ distribution.
4040
# define __has_cpp_attribute(x) 0
4141
#endif
4242

43-
#if defined(_MSC_VER)
44-
# define TIXML_FALLTHROUGH (void(0))
45-
#elif (__cplusplus >= 201703L && __has_cpp_attribute(fallthrough))
43+
#if (__cplusplus >= 201703L && __has_cpp_attribute(fallthrough))
4644
# define TIXML_FALLTHROUGH [[fallthrough]]
4745
#elif __has_cpp_attribute(clang::fallthrough)
4846
# define TIXML_FALLTHROUGH [[clang::fallthrough]]
@@ -53,15 +51,8 @@ distribution.
5351
#endif
5452

5553

56-
#if defined(_MSC_VER) && (_MSC_VER >= 1400 ) && (!defined WINCE)
57-
// Microsoft Visual Studio, version 2005 and higher. Not WinCE.
58-
/*int _snprintf_s(
59-
char *buffer,
60-
size_t sizeOfBuffer,
61-
size_t count,
62-
const char *format [,
63-
argument] ...
64-
);*/
54+
#if defined(_MSC_VER) && (_MSC_VER >= 1400)
55+
// Microsoft Visual Studio, version 2005 and higher.
6556
static inline int TIXML_SNPRINTF( char* buffer, size_t size, const char* format, ... )
6657
{
6758
va_list va;
@@ -80,33 +71,11 @@ distribution.
8071
#define TIXML_VSCPRINTF _vscprintf
8172
#define TIXML_SSCANF sscanf_s
8273
#elif defined _MSC_VER
83-
// Microsoft Visual Studio 2003 and earlier or WinCE
74+
// Microsoft Visual Studio 2003 and earlier.
8475
#define TIXML_SNPRINTF _snprintf
8576
#define TIXML_VSNPRINTF _vsnprintf
8677
#define TIXML_SSCANF sscanf
87-
#if (_MSC_VER < 1400 ) && (!defined WINCE)
88-
// Microsoft Visual Studio 2003 and not WinCE.
89-
#define TIXML_VSCPRINTF _vscprintf // VS2003's C runtime has this, but VC6 C runtime or WinCE SDK doesn't have.
90-
#else
91-
// Microsoft Visual Studio 2003 and earlier or WinCE.
92-
static inline int TIXML_VSCPRINTF( const char* format, va_list va )
93-
{
94-
int len = 512;
95-
for (;;) {
96-
len = len*2;
97-
char* str = new char[len]();
98-
const int required = _vsnprintf(str, len, format, va);
99-
delete[] str;
100-
if ( required != -1 ) {
101-
TIXMLASSERT( required >= 0 );
102-
len = required;
103-
break;
104-
}
105-
}
106-
TIXMLASSERT( len >= 0 );
107-
return len;
108-
}
109-
#endif
78+
#define TIXML_VSCPRINTF _vscprintf
11079
#else
11180
// GCC version 3 and higher
11281
//#warning( "Using sn* functions." )
@@ -121,7 +90,7 @@ distribution.
12190
#define TIXML_SSCANF sscanf
12291
#endif
12392

124-
#if defined(_WIN64)
93+
#if defined(_MSC_VER)
12594
#define TIXML_FSEEK _fseeki64
12695
#define TIXML_FTELL _ftelli64
12796
#elif defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__) || defined(__CYGWIN__)
@@ -2257,7 +2226,7 @@ void XMLDocument::Clear()
22572226
delete [] _charBuffer;
22582227
_charBuffer = 0;
22592228
_parsingDepth = 0;
2260-
2229+
22612230
#if 0
22622231
_textPool.Trace( "text" );
22632232
_elementPool.Trace( "element" );
@@ -2332,7 +2301,7 @@ static FILE* callfopen( const char* filepath, const char* mode )
23322301
{
23332302
TIXMLASSERT( filepath );
23342303
TIXMLASSERT( mode );
2335-
#if defined(_MSC_VER) && (_MSC_VER >= 1400 ) && (!defined WINCE)
2304+
#if defined(_MSC_VER) && (_MSC_VER >= 1400)
23362305
FILE* fp = 0;
23372306
const errno_t err = fopen_s( &fp, filepath, mode );
23382307
if ( err ) {

tinyxml2.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,12 @@ distribution.
2424
#ifndef TINYXML2_INCLUDED
2525
#define TINYXML2_INCLUDED
2626

27-
#if defined(ANDROID_NDK) || defined(__BORLANDC__) || defined(__QNXNTO__)
27+
#if defined(ANDROID_NDK)
2828
# include <ctype.h>
2929
# include <limits.h>
3030
# include <stdio.h>
3131
# include <stdlib.h>
3232
# include <string.h>
33-
# if defined(__PS3__)
34-
# include <stddef.h>
35-
# endif
3633
#else
3734
# include <cctype>
3835
# include <climits>

0 commit comments

Comments
 (0)