From b6963f0bc9f3155c378b2393a6f43eec64388ec9 Mon Sep 17 00:00:00 2001 From: Guenter Obiltschnig Date: Mon, 15 Oct 2012 09:29:26 +0000 Subject: [PATCH] WinCE fixes --- Foundation/Foundation_CE_vs90.vcproj | 142 +++++++++++------- Foundation/include/Poco/Config.h | 7 +- Foundation/include/Poco/NumericString.h | 2 + Foundation/include/Poco/zconf.h | 4 +- Foundation/src/gzguts.h | 4 +- Foundation/src/zconf.h | 4 +- Foundation/testsuite/TestSuite_CE_vs90.vcproj | 53 ++++++- Foundation/testsuite/src/PathTest.cpp | 3 +- Foundation/testsuite/src/RandomTest.cpp | 15 +- Foundation/testsuite/src/TuplesTest.cpp | 4 +- 10 files changed, 157 insertions(+), 81 deletions(-) diff --git a/Foundation/Foundation_CE_vs90.vcproj b/Foundation/Foundation_CE_vs90.vcproj index 0bc16ecde..532c19235 100644 --- a/Foundation/Foundation_CE_vs90.vcproj +++ b/Foundation/Foundation_CE_vs90.vcproj @@ -577,6 +577,10 @@ RelativePath=".\src\DeflatingStream.cpp" > + + @@ -765,6 +769,10 @@ RelativePath=".\include\Poco\DeflatingStream.h" > + + @@ -2934,14 +2942,6 @@ > - - - - + + @@ -5309,6 +5313,10 @@ RelativePath=".\src\UTF16Encoding.cpp" > + + @@ -5317,6 +5325,14 @@ RelativePath=".\src\UTF8String.cpp" > + + + + @@ -5337,6 +5353,10 @@ RelativePath=".\include\Poco\Latin1Encoding.h" > + + @@ -5373,6 +5393,10 @@ RelativePath=".\include\Poco\UTF16Encoding.h" > + + @@ -5381,6 +5405,14 @@ RelativePath=".\include\Poco\UTF8String.h" > + + + + @@ -5905,14 +5937,6 @@ RelativePath=".\src\Debugger.cpp" > - - - - @@ -6489,6 +6513,10 @@ RelativePath=".\include\Poco\Any.h" > + + @@ -6525,14 +6553,6 @@ RelativePath=".\include\Poco\Debugger.h" > - - - - @@ -6637,6 +6657,10 @@ RelativePath=".\include\Poco\NumericString.h" > + + @@ -6693,6 +6717,10 @@ RelativePath=".\include\Poco\UnWindows.h" > + + @@ -6703,42 +6731,42 @@ - - - - - + + + + + + + + + - - - - - - - - - + + + + + + diff --git a/Foundation/include/Poco/Config.h b/Foundation/include/Poco/Config.h index 90193cd42..978efafb2 100644 --- a/Foundation/include/Poco/Config.h +++ b/Foundation/include/Poco/Config.h @@ -43,7 +43,6 @@ // Define to enable Windows Unicode (UTF-8) support #define POCO_WIN32_UTF8 - // Define to enable C++11 support //#define POCO_ENABLE_CPP11 @@ -132,4 +131,10 @@ // #define POCO_NET_NO_IPv6 +// Windows CE has no locale support +#if defined(_WIN32_WCE) +#define POCO_NO_LOCALE +#endif + + #endif // Foundation_Config_INCLUDED diff --git a/Foundation/include/Poco/NumericString.h b/Foundation/include/Poco/NumericString.h index 853abee08..8f29e4f76 100644 --- a/Foundation/include/Poco/NumericString.h +++ b/Foundation/include/Poco/NumericString.h @@ -50,7 +50,9 @@ #endif #include #include +#if !defined(POCO_NO_LOCALE) #include +#endif namespace Poco { diff --git a/Foundation/include/Poco/zconf.h b/Foundation/include/Poco/zconf.h index 8a46a58b3..5e7b9cc93 100644 --- a/Foundation/include/Poco/zconf.h +++ b/Foundation/include/Poco/zconf.h @@ -421,7 +421,9 @@ typedef uLong FAR uLongf; #ifdef STDC # ifndef Z_SOLO -# include /* for off_t */ +# ifndef _WIN32_WCE +# include /* for off_t */ +# endif # endif #endif diff --git a/Foundation/src/gzguts.h b/Foundation/src/gzguts.h index ee3f281aa..8049d36a5 100644 --- a/Foundation/src/gzguts.h +++ b/Foundation/src/gzguts.h @@ -32,7 +32,9 @@ #endif #if defined(__TURBOC__) || defined(_MSC_VER) || defined(_WIN32) -# include +# if !defined(_WIN32_WCE) +# include +# endif #endif #ifdef NO_DEFLATE /* for compatibility with old definition */ diff --git a/Foundation/src/zconf.h b/Foundation/src/zconf.h index 8a46a58b3..5e7b9cc93 100644 --- a/Foundation/src/zconf.h +++ b/Foundation/src/zconf.h @@ -421,7 +421,9 @@ typedef uLong FAR uLongf; #ifdef STDC # ifndef Z_SOLO -# include /* for off_t */ +# ifndef _WIN32_WCE +# include /* for off_t */ +# endif # endif #endif diff --git a/Foundation/testsuite/TestSuite_CE_vs90.vcproj b/Foundation/testsuite/TestSuite_CE_vs90.vcproj index 12928b12e..39baa7482 100644 --- a/Foundation/testsuite/TestSuite_CE_vs90.vcproj +++ b/Foundation/testsuite/TestSuite_CE_vs90.vcproj @@ -590,6 +590,10 @@ RelativePath=".\src\AnyTest.cpp" > + + @@ -610,10 +614,6 @@ RelativePath=".\src\CoreTestSuite.cpp" > - - @@ -649,6 +649,7 @@ + @@ -681,6 +682,10 @@ RelativePath=".\src\AnyTest.h" > + + @@ -701,10 +706,6 @@ RelativePath=".\src\CoreTestSuite.h" > - - @@ -785,6 +786,10 @@ RelativePath=".\src\CountingStreamTest.cpp" > + + @@ -841,6 +846,10 @@ RelativePath=".\src\CountingStreamTest.h" > + + @@ -1835,6 +1844,34 @@ + + + + + + + + + + + + + + diff --git a/Foundation/testsuite/src/PathTest.cpp b/Foundation/testsuite/src/PathTest.cpp index e29b1155f..3f5ec1123 100644 --- a/Foundation/testsuite/src/PathTest.cpp +++ b/Foundation/testsuite/src/PathTest.cpp @@ -42,7 +42,6 @@ using Poco::Path; using Poco::PathSyntaxException; -using Poco::Random; using Poco::Environment; @@ -1458,7 +1457,7 @@ void PathTest::testAbsolute() void PathTest::testRobustness() { - Random r; + Poco::Random r; for (int i = 0; i < 256; ++i) { int len = r.next(1024); diff --git a/Foundation/testsuite/src/RandomTest.cpp b/Foundation/testsuite/src/RandomTest.cpp index c9a1d7085..6db3c5ab8 100644 --- a/Foundation/testsuite/src/RandomTest.cpp +++ b/Foundation/testsuite/src/RandomTest.cpp @@ -38,7 +38,6 @@ #include -using Poco::Random; using Poco::UInt32; @@ -54,8 +53,8 @@ RandomTest::~RandomTest() void RandomTest::testSequence1() { - Random rnd1; - Random rnd2; + Poco::Random rnd1; + Poco::Random rnd2; rnd1.seed(12345); rnd2.seed(12345); for (int i = 0; i < 100; ++i) @@ -67,8 +66,8 @@ void RandomTest::testSequence1() void RandomTest::testSequence2() { - Random rnd1; - Random rnd2; + Poco::Random rnd1; + Poco::Random rnd2; rnd1.seed(12345); rnd2.seed(54321); @@ -87,7 +86,7 @@ void RandomTest::testSequence2() void RandomTest::testDistribution1() { - Random rnd; + Poco::Random rnd; rnd.seed(123456); const int n = 11; int d[n] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; @@ -104,7 +103,7 @@ void RandomTest::testDistribution1() void RandomTest::testDistribution2() { - Random rnd; + Poco::Random rnd; rnd.seed(); const int n = 101; std::vector d(n, 0); @@ -127,7 +126,7 @@ void RandomTest::testDistribution2() void RandomTest::testDistribution3() { - Random rnd; + Poco::Random rnd; rnd.seed(); const int n = 101; std::vector d(n, 0); diff --git a/Foundation/testsuite/src/TuplesTest.cpp b/Foundation/testsuite/src/TuplesTest.cpp index 3a78d4279..073f4f8b6 100644 --- a/Foundation/testsuite/src/TuplesTest.cpp +++ b/Foundation/testsuite/src/TuplesTest.cpp @@ -557,8 +557,8 @@ void TuplesTest::testTupleOrder() void TuplesTest::testMemOverhead() { - Tuple small(0); - int sz = sizeof(small); + Tuple smallOne(0); + int sz = sizeof(smallOne); assert (sz == 4 || sz == 8); //depending on architecture and alignment Tuple notSoSmall(0); sz = sizeof(notSoSmall);