From 948732d6175cb7581368f9856a50acbc6f515dfd Mon Sep 17 00:00:00 2001 From: fape Date: Wed, 6 Feb 2013 14:49:04 +0100 Subject: [PATCH 1/2] marmalade tinyxml2 fixes --- cocos2dx/support/tinyxml2/tinyxml2.cpp | 6 +++--- cocos2dx/support/tinyxml2/tinyxml2.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cocos2dx/support/tinyxml2/tinyxml2.cpp b/cocos2dx/support/tinyxml2/tinyxml2.cpp index 6af1435130..36181af09a 100644 --- a/cocos2dx/support/tinyxml2/tinyxml2.cpp +++ b/cocos2dx/support/tinyxml2/tinyxml2.cpp @@ -1587,7 +1587,7 @@ XMLError XMLDocument::LoadFile( const char* filename ) InitDocument(); FILE* fp = 0; -#if defined(_MSC_VER) && (_MSC_VER >= 1400 ) +#if defined(_MSC_VER) && (_MSC_VER >= 1400 ) && (CC_TARGET_PLATFORM != CC_PLATFORM_MARMALADE) errno_t err = fopen_s(&fp, filename, "rb" ); if ( !fp || err) { #else @@ -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 ) +#if defined(_MSC_VER) && (_MSC_VER >= 1400 ) && (CC_TARGET_PLATFORM != CC_PLATFORM_MARMALADE) errno_t err = fopen_s(&fp, filename, "w" ); if ( !fp || err) { #else @@ -1768,7 +1768,7 @@ void XMLPrinter::Print( const char* format, ... ) else { // This seems brutally complex. Haven't figured out a better // way on windows. -#ifdef _MSC_VER +#if defined _MSC_VER && (CC_TARGET_PLATFORM != CC_PLATFORM_MARMALADE) int len = -1; int expand = 1000; while ( len < 0 ) { diff --git a/cocos2dx/support/tinyxml2/tinyxml2.h b/cocos2dx/support/tinyxml2/tinyxml2.h index ba1b249bae..e54cdb16c0 100644 --- a/cocos2dx/support/tinyxml2/tinyxml2.h +++ b/cocos2dx/support/tinyxml2/tinyxml2.h @@ -73,7 +73,7 @@ distribution. #endif -#if defined(_MSC_VER) && (_MSC_VER >= 1400 ) +#if (defined(_MSC_VER) && (_MSC_VER >= 1400 ) && (CC_TARGET_PLATFORM != CC_PLATFORM_MARMALADE)) // Microsoft visual studio, version 2005 and higher. /*int _snprintf_s( char *buffer, From 05eb3a59f5ca1f0a36b04e38685c7179bf630406 Mon Sep 17 00:00:00 2001 From: fape Date: Wed, 6 Feb 2013 15:50:09 +0100 Subject: [PATCH 2/2] include missing CCPlatformMacros.h --- cocos2dx/support/tinyxml2/tinyxml2.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cocos2dx/support/tinyxml2/tinyxml2.h b/cocos2dx/support/tinyxml2/tinyxml2.h index e54cdb16c0..8d2287e9e6 100644 --- a/cocos2dx/support/tinyxml2/tinyxml2.h +++ b/cocos2dx/support/tinyxml2/tinyxml2.h @@ -24,6 +24,8 @@ distribution. #ifndef TINYXML2_INCLUDED #define TINYXML2_INCLUDED +#include "platform/CCPlatformConfig.h" + #if defined(ANDROID_NDK) || defined(__BORLANDC__) # include # include