summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorarseny.kapoulkine@gmail.com <arseny.kapoulkine@gmail.com@99668b35-9821-0410-8761-19e4c4f06640>2012-02-19 09:05:23 +0000
committerarseny.kapoulkine@gmail.com <arseny.kapoulkine@gmail.com@99668b35-9821-0410-8761-19e4c4f06640>2012-02-19 09:05:23 +0000
commit9133322c4c39141a80f79f24755566128bb98c13 (patch)
tree79724d4f39d40013cb598f09ba64f2a897893cc7
parentbe7bdafa4504b0d54e7defbbf1d89c4fe7a935d4 (diff)
tests: Minor fixes for WinCE compilation
git-svn-id: http://pugixml.googlecode.com/svn/trunk@834 99668b35-9821-0410-8761-19e4c4f06640
-rw-r--r--tests/allocator.cpp4
-rw-r--r--tests/main.cpp12
-rw-r--r--tests/test.cpp1
-rw-r--r--tests/test_document.cpp5
-rw-r--r--tests/test_dom_traverse.cpp1
5 files changed, 20 insertions, 3 deletions
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 <xtl.h>
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 <exception>
#include <stdio.h>
+#include <stdlib.h>
#include <float.h>
#include <assert.h>
+#ifdef _WIN32_WCE
+# undef DebugBreak
+# include <windows.h>
+#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 <stdlib.h>
-
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 <string.h> // because Borland's STL is braindead, we have to include <string.h> _before_ <string> 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"