From 9133322c4c39141a80f79f24755566128bb98c13 Mon Sep 17 00:00:00 2001 From: "arseny.kapoulkine@gmail.com" Date: Sun, 19 Feb 2012 09:05:23 +0000 Subject: tests: Minor fixes for WinCE compilation git-svn-id: http://pugixml.googlecode.com/svn/trunk@834 99668b35-9821-0410-8761-19e4c4f06640 --- tests/allocator.cpp | 4 ++++ tests/main.cpp | 12 ++++++++++-- tests/test.cpp | 1 + tests/test_document.cpp | 5 ++++- tests/test_dom_traverse.cpp | 1 + 5 files changed, 20 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/allocator.cpp b/tests/allocator.cpp index fcd8f2d..6b0dd64 100644 --- a/tests/allocator.cpp +++ b/tests/allocator.cpp @@ -9,6 +9,10 @@ # pragma cpp_extensions on // enable some extensions to include windows.h # endif +# if defined(_MSC_VER) +# pragma warning(disable: 4201) // nonstandard extension used: nameless struct/union +# endif + # ifdef _XBOX_VER # define NOD3D # include diff --git a/tests/main.cpp b/tests/main.cpp index 67fa190..21e9e6a 100644 --- a/tests/main.cpp +++ b/tests/main.cpp @@ -3,9 +3,15 @@ #include #include +#include #include #include +#ifdef _WIN32_WCE +# undef DebugBreak +# include +#endif + test_runner* test_runner::_tests = 0; size_t test_runner::_memory_fail_threshold = 0; jmp_buf test_runner::_failure_buffer; @@ -112,15 +118,17 @@ static bool run_test(test_runner* test) } #if defined(__CELLOS_LV2__) && defined(PUGIXML_NO_EXCEPTIONS) && !defined(__SNC__) -#include - void std::exception::_Raise() const { abort(); } #endif +#ifdef _WIN32_WCE +int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) +#else int main() +#endif { #ifdef __BORLANDC__ _control87(MCW_EM | PC_53, MCW_EM | MCW_PC); diff --git a/tests/test.cpp b/tests/test.cpp index 33c7fb5..eb901db 100644 --- a/tests/test.cpp +++ b/tests/test.cpp @@ -1,4 +1,5 @@ #define _SCL_SECURE_NO_WARNINGS +#define _SCL_SECURE_NO_DEPRECATE #include "test.hpp" diff --git a/tests/test_document.cpp b/tests/test_document.cpp index a49efcd..8b6ab8f 100644 --- a/tests/test_document.cpp +++ b/tests/test_document.cpp @@ -1,5 +1,6 @@ #define _CRT_SECURE_NO_WARNINGS #define _SCL_SECURE_NO_WARNINGS +#define _SCL_SECURE_NO_DEPRECATE #define _CRT_NONSTDC_NO_DEPRECATE 0 #include // because Borland's STL is braindead, we have to include _before_ in order to get memcpy @@ -393,7 +394,7 @@ struct temp_file fd = mkstemp(path); CHECK(fd != -1); - #elif defined(__CELLOS_LV2__) + #elif defined(__CELLOS_LV2__) || defined(_WIN32_WCE) path[0] = 0; // no temporary file support #else tmpnam(path); @@ -402,7 +403,9 @@ struct temp_file ~temp_file() { + #ifndef _WIN32_WCE CHECK(unlink(path) == 0); + #endif #ifdef __unix CHECK(close(fd) == 0); diff --git a/tests/test_dom_traverse.cpp b/tests/test_dom_traverse.cpp index d62cce0..173c430 100644 --- a/tests/test_dom_traverse.cpp +++ b/tests/test_dom_traverse.cpp @@ -1,5 +1,6 @@ #define _CRT_SECURE_NO_WARNINGS #define _SCL_SECURE_NO_WARNINGS +#define _SCL_SECURE_NO_DEPRECATE #include "common.hpp" -- cgit v1.2.3