tests: Minor fixes for WinCE compilation

git-svn-id: http://pugixml.googlecode.com/svn/trunk@834 99668b35-9821-0410-8761-19e4c4f06640
This commit is contained in:
arseny.kapoulkine@gmail.com 2012-02-19 09:05:23 +00:00
parent be7bdafa45
commit 9133322c4c
5 changed files with 20 additions and 3 deletions

View File

@ -9,6 +9,10 @@
# pragma cpp_extensions on // enable some extensions to include windows.h # pragma cpp_extensions on // enable some extensions to include windows.h
# endif # endif
# if defined(_MSC_VER)
# pragma warning(disable: 4201) // nonstandard extension used: nameless struct/union
# endif
# ifdef _XBOX_VER # ifdef _XBOX_VER
# define NOD3D # define NOD3D
# include <xtl.h> # include <xtl.h>

View File

@ -3,9 +3,15 @@
#include <exception> #include <exception>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include <float.h> #include <float.h>
#include <assert.h> #include <assert.h>
#ifdef _WIN32_WCE
# undef DebugBreak
# include <windows.h>
#endif
test_runner* test_runner::_tests = 0; test_runner* test_runner::_tests = 0;
size_t test_runner::_memory_fail_threshold = 0; size_t test_runner::_memory_fail_threshold = 0;
jmp_buf test_runner::_failure_buffer; 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__) #if defined(__CELLOS_LV2__) && defined(PUGIXML_NO_EXCEPTIONS) && !defined(__SNC__)
#include <stdlib.h>
void std::exception::_Raise() const void std::exception::_Raise() const
{ {
abort(); abort();
} }
#endif #endif
#ifdef _WIN32_WCE
int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
#else
int main() int main()
#endif
{ {
#ifdef __BORLANDC__ #ifdef __BORLANDC__
_control87(MCW_EM | PC_53, MCW_EM | MCW_PC); _control87(MCW_EM | PC_53, MCW_EM | MCW_PC);

View File

@ -1,4 +1,5 @@
#define _SCL_SECURE_NO_WARNINGS #define _SCL_SECURE_NO_WARNINGS
#define _SCL_SECURE_NO_DEPRECATE
#include "test.hpp" #include "test.hpp"

View File

@ -1,5 +1,6 @@
#define _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS
#define _SCL_SECURE_NO_WARNINGS #define _SCL_SECURE_NO_WARNINGS
#define _SCL_SECURE_NO_DEPRECATE
#define _CRT_NONSTDC_NO_DEPRECATE 0 #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 #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); fd = mkstemp(path);
CHECK(fd != -1); CHECK(fd != -1);
#elif defined(__CELLOS_LV2__) #elif defined(__CELLOS_LV2__) || defined(_WIN32_WCE)
path[0] = 0; // no temporary file support path[0] = 0; // no temporary file support
#else #else
tmpnam(path); tmpnam(path);
@ -402,7 +403,9 @@ struct temp_file
~temp_file() ~temp_file()
{ {
#ifndef _WIN32_WCE
CHECK(unlink(path) == 0); CHECK(unlink(path) == 0);
#endif
#ifdef __unix #ifdef __unix
CHECK(close(fd) == 0); CHECK(close(fd) == 0);

View File

@ -1,5 +1,6 @@
#define _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS
#define _SCL_SECURE_NO_WARNINGS #define _SCL_SECURE_NO_WARNINGS
#define _SCL_SECURE_NO_DEPRECATE
#include "common.hpp" #include "common.hpp"