From f59e2d6a89519b8a72b277e7db874be24ca458bb Mon Sep 17 00:00:00 2001 From: Anton Indrawan Date: Tue, 18 Nov 2014 20:50:42 +0100 Subject: [PATCH 1/2] Compile TinyXml2 with the Dinkum C++ of QNX 6.5 and QNX 6.6. When we include c++ headers, we have to use explicit std:: --- tinyxml2.cpp | 2 +- tinyxml2.h | 2 +- xmltest.cpp | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tinyxml2.cpp b/tinyxml2.cpp index ef3b469..da26e77 100755 --- a/tinyxml2.cpp +++ b/tinyxml2.cpp @@ -24,7 +24,7 @@ distribution. #include "tinyxml2.h" #include // yes, this one new style header, is in the Android SDK. -# ifdef ANDROID_NDK +#if defined(ANDROID_NDK) || defined(__QNXNTO__) # include #else # include diff --git a/tinyxml2.h b/tinyxml2.h index 5940509..6d6a2e4 100755 --- a/tinyxml2.h +++ b/tinyxml2.h @@ -24,7 +24,7 @@ distribution. #ifndef TINYXML2_INCLUDED #define TINYXML2_INCLUDED -#if defined(ANDROID_NDK) || defined(__BORLANDC__) +#if defined(ANDROID_NDK) || defined(__BORLANDC__) || defined(__QNXNTO__) # include # include # include diff --git a/xmltest.cpp b/xmltest.cpp index 3564afb..11eb16c 100644 --- a/xmltest.cpp +++ b/xmltest.cpp @@ -296,12 +296,12 @@ int main( int argc, const char ** argv ) if ( argc > 1 ) { XMLDocument* doc = new XMLDocument(); - clock_t startTime = clock(); + clock_t startTime = std::clock(); doc->LoadFile( argv[1] ); - clock_t loadTime = clock(); + clock_t loadTime = std::clock(); int errorID = doc->ErrorID(); delete doc; doc = 0; - clock_t deleteTime = clock(); + clock_t deleteTime = std::clock(); printf( "Test file '%s' loaded. ErrorID=%d\n", argv[1], errorID ); if ( !errorID ) { @@ -1403,7 +1403,7 @@ int main( int argc, const char ** argv ) #if defined( _MSC_VER ) QueryPerformanceCounter( (LARGE_INTEGER*) &start ); #else - clock_t cstart = clock(); + clock_t cstart = std::clock(); #endif static const int COUNT = 10; for( int i=0; i Date: Thu, 20 Nov 2014 18:27:07 +0100 Subject: [PATCH 2/2] Compile TinyXml2 with the Dinkum C++ of QNX 6.5 and QNX 6.6. Processed review comment from leethomason --- xmltest.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/xmltest.cpp b/xmltest.cpp index 11eb16c..ea1a7b1 100644 --- a/xmltest.cpp +++ b/xmltest.cpp @@ -23,6 +23,7 @@ #endif using namespace tinyxml2; +using namespace std; int gPass = 0; int gFail = 0; @@ -296,12 +297,12 @@ int main( int argc, const char ** argv ) if ( argc > 1 ) { XMLDocument* doc = new XMLDocument(); - clock_t startTime = std::clock(); + clock_t startTime = clock(); doc->LoadFile( argv[1] ); - clock_t loadTime = std::clock(); + clock_t loadTime = clock(); int errorID = doc->ErrorID(); delete doc; doc = 0; - clock_t deleteTime = std::clock(); + clock_t deleteTime = clock(); printf( "Test file '%s' loaded. ErrorID=%d\n", argv[1], errorID ); if ( !errorID ) { @@ -1403,7 +1404,7 @@ int main( int argc, const char ** argv ) #if defined( _MSC_VER ) QueryPerformanceCounter( (LARGE_INTEGER*) &start ); #else - clock_t cstart = std::clock(); + clock_t cstart = clock(); #endif static const int COUNT = 10; for( int i=0; i