diff options
Diffstat (limited to 'src/3rdparty/v8/src/platform-win32.cc')
-rw-r--r-- | src/3rdparty/v8/src/platform-win32.cc | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/src/3rdparty/v8/src/platform-win32.cc b/src/3rdparty/v8/src/platform-win32.cc index 2473949..ba57803 100644 --- a/src/3rdparty/v8/src/platform-win32.cc +++ b/src/3rdparty/v8/src/platform-win32.cc @@ -27,6 +27,17 @@ // Platform specific code for Win32. +// Secure API functions are not available using MinGW with msvcrt.dll +// on Windows XP. Make sure MINGW_HAS_SECURE_API is not defined to +// disable definition of secure API functions in standard headers that +// would conflict with our own implementation. +#ifdef __MINGW32__ +#include <_mingw.h> +#ifdef MINGW_HAS_SECURE_API +#undef MINGW_HAS_SECURE_API +#endif // MINGW_HAS_SECURE_API +#endif // __MINGW32__ + #define V8_WIN32_HEADERS_FULL #include "win32-headers.h" @@ -65,8 +76,6 @@ inline void MemoryBarrier() { #endif // __MINGW64_VERSION_MAJOR -#ifndef MINGW_HAS_SECURE_API - int localtime_s(tm* out_tm, const time_t* time) { tm* posix_local_time_struct = localtime(time); if (posix_local_time_struct == NULL) return 1; @@ -113,8 +122,6 @@ int strncpy_s(char* dest, size_t dest_size, const char* source, size_t count) { return 0; } -#endif // MINGW_HAS_SECURE_API - #endif // __MINGW32__ // Generate a pseudo-random number in the range 0-2^31-1. Usually @@ -201,7 +208,7 @@ UNARY_MATH_FUNCTION(tan, CreateTranscendentalFunction(TranscendentalCache::TAN)) UNARY_MATH_FUNCTION(log, CreateTranscendentalFunction(TranscendentalCache::LOG)) UNARY_MATH_FUNCTION(sqrt, CreateSqrtFunction()) -#undef MATH_FUNCTION +#undef UNARY_MATH_FUNCTION void MathSetup() { @@ -798,6 +805,9 @@ void OS::StrNCpy(Vector<char> dest, const char* src, size_t n) { } +#undef _TRUNCATE +#undef STRUNCATE + // We keep the lowest and highest addresses mapped as a quick way of // determining that pointers are outside the heap (used mostly in assertions // and verification). The estimate is conservative, i.e., not all addresses in @@ -1199,6 +1209,11 @@ TLHELP32_FUNCTION_LIST(DLL_FUNC_LOADED) // application is closed. } +#undef DBGHELP_FUNCTION_LIST +#undef TLHELP32_FUNCTION_LIST +#undef DLL_FUNC_VAR +#undef DLL_FUNC_TYPE + // Load the symbols for generating stack traces. static bool LoadSymbols(HANDLE process_handle) { |