Skip to content

Commit

Permalink
Remove CC_TARGET_PLATFORM marco (#340)
Browse files Browse the repository at this point in the history
  • Loading branch information
PatriceJiang authored and drelaptop committed Jan 9, 2019
1 parent e20bf65 commit 4715b2d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 19 deletions.
8 changes: 4 additions & 4 deletions tinyxml2/tinyxml2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ distribution.
#include "tinyxml2.h"

#include <new> // yes, this one new style header, is in the Android SDK.
# if defined(ANDROID_NDK) || (CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY)
# if defined(ANDROID_NDK)
# include <stddef.h>
#else
# include <cstddef>
Expand Down Expand Up @@ -1587,7 +1587,7 @@ XMLError XMLDocument::LoadFile( const char* filename )
InitDocument();
FILE* fp = 0;

#if defined(_MSC_VER) && (_MSC_VER >= 1400 ) && (CC_TARGET_PLATFORM != CC_PLATFORM_MARMALADE)
#if defined(_MSC_VER) && (_MSC_VER >= 1400 )
errno_t err = fopen_s(&fp, filename, "rb" );
if ( !fp || err) {
#else
Expand Down Expand Up @@ -1641,7 +1641,7 @@ XMLError XMLDocument::LoadFile( FILE* fp )
XMLError XMLDocument::SaveFile( const char* filename, bool compact )
{
FILE* fp = 0;
#if defined(_MSC_VER) && (_MSC_VER >= 1400 ) && (CC_TARGET_PLATFORM != CC_PLATFORM_MARMALADE)
#if defined(_MSC_VER) && (_MSC_VER >= 1400 )
errno_t err = fopen_s(&fp, filename, "w" );
if ( !fp || err) {
#else
Expand Down Expand Up @@ -1768,7 +1768,7 @@ void XMLPrinter::Print( const char* format, ... )
else {
// This seems brutally complex. Haven't figured out a better
// way on windows.
#if defined _MSC_VER && (CC_TARGET_PLATFORM != CC_PLATFORM_MARMALADE)
#if defined _MSC_VER
int len = -1;
int expand = 1000;
while ( len < 0 ) {
Expand Down
4 changes: 2 additions & 2 deletions tinyxml2/tinyxml2.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ distribution.
#endif


#if defined(ANDROID_NDK) || defined(__BORLANDC__) || (CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY)
#if defined(ANDROID_NDK) || defined(__BORLANDC__)
# include <ctype.h>
# include <limits.h>
# include <stdio.h>
Expand Down Expand Up @@ -89,7 +89,7 @@ distribution.
#endif


#if (defined(_MSC_VER) && (_MSC_VER >= 1400 ) && (CC_TARGET_PLATFORM != CC_PLATFORM_MARMALADE))
#if (defined(_MSC_VER) && (_MSC_VER >= 1400 ))
// Microsoft visual studio, version 2005 and higher.
/*int _snprintf_s(
char *buffer,
Expand Down
14 changes: 1 addition & 13 deletions unzip/ioapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,7 @@ static voidpf ZCALLBACK fopen64_file_func (voidpf opaque, const void* filename,

if ((filename!=NULL) && (mode_fopen != NULL))
{
#if (CC_TARGET_PLATFORM == CC_PLATFORM_MARMALADE || CC_TARGET_PLATFORM == CC_PLATFORM_BADA || CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY || CC_TARGET_PLATFORM == CC_PLATFORM_NACL || CC_TARGET_PLATFORM == CC_PLATFORM_EMSCRIPTEN)
file = NULL;
#else
file = fopen64((const char*)filename, mode_fopen);
#endif
file = fopen64((const char*)filename, mode_fopen);
}

return file;
Expand Down Expand Up @@ -147,11 +143,7 @@ static long ZCALLBACK ftell_file_func (voidpf opaque, voidpf stream)
static ZPOS64_T ZCALLBACK ftell64_file_func (voidpf opaque, voidpf stream)
{
ZPOS64_T ret;
#if (CC_TARGET_PLATFORM == CC_PLATFORM_MARMALADE || CC_TARGET_PLATFORM == CC_PLATFORM_BADA || CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY || CC_TARGET_PLATFORM == CC_PLATFORM_NACL || CC_TARGET_PLATFORM == CC_PLATFORM_EMSCRIPTEN)
ret = 0;
#else
ret = ftello64((FILE *)stream);
#endif
return ret;
}

Expand Down Expand Up @@ -180,9 +172,6 @@ static long ZCALLBACK fseek_file_func (voidpf opaque, voidpf stream, uLong offs

static long ZCALLBACK fseek64_file_func (voidpf opaque, voidpf stream, ZPOS64_T offset, int origin)
{
#if (CC_TARGET_PLATFORM == CC_PLATFORM_MARMALADE || CC_TARGET_PLATFORM == CC_PLATFORM_BADA || CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY || CC_TARGET_PLATFORM == CC_PLATFORM_NACL || CC_TARGET_PLATFORM == CC_PLATFORM_EMSCRIPTEN)
return -1;
#else
int fseek_origin=0;
switch (origin)
{
Expand All @@ -200,7 +189,6 @@ static long ZCALLBACK fseek64_file_func (voidpf opaque, voidpf stream, ZPOS64_T
if(fseeko64((FILE *)stream, offset, fseek_origin) != 0)
return -1;
return 0;
#endif
}


Expand Down

0 comments on commit 4715b2d

Please sign in to comment.