diff options
author | Jonathan Liu <net147@gmail.com> | 2012-03-03 20:58:32 +1100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-03 17:37:13 +0100 |
commit | 1a03bd56a5f1a10e901166d87fe52ca2c7a18a25 (patch) | |
tree | 565f603db5c002fe40a079c5d774822b1a99710a /src/3rdparty/v8/src/platform-win32.cc | |
parent | cc89ca11297ead816d21e5d7ac1af591f606bc60 (diff) | |
download | qtjsbackend-1a03bd56a5f1a10e901166d87fe52ca2c7a18a25.tar.gz |
[V8] Fix MinGW-w64 compilation
This is a backport of the following patches:
- https://chromiumcodereview.appspot.com/9169007/
- https://chromiumcodereview.appspot.com/9428027/
- https://chromiumcodereview.appspot.com/9584047/
- https://chromiumcodereview.appspot.com/9581045/
Change-Id: Idbef0c2707a05f99721316220d07e60bf6b6670a
Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
Diffstat (limited to 'src/3rdparty/v8/src/platform-win32.cc')
-rw-r--r-- | src/3rdparty/v8/src/platform-win32.cc | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/3rdparty/v8/src/platform-win32.cc b/src/3rdparty/v8/src/platform-win32.cc index 8771c43..ba69bdc 100644 --- a/src/3rdparty/v8/src/platform-win32.cc +++ b/src/3rdparty/v8/src/platform-win32.cc @@ -58,21 +58,26 @@ int localtime_s(tm* out_tm, const time_t* time) { } -// Not sure this the correct interpretation of _mkgmtime -time_t _mkgmtime(tm* timeptr) { - return mktime(timeptr); -} - - int fopen_s(FILE** pFile, const char* filename, const char* mode) { *pFile = fopen(filename, mode); return *pFile != NULL ? 0 : 1; } +#ifndef __MINGW64_VERSION_MAJOR + +// Not sure this the correct interpretation of _mkgmtime +time_t _mkgmtime(tm* timeptr) { + return mktime(timeptr); +} + + #define _TRUNCATE 0 #define STRUNCATE 80 +#endif // __MINGW64_VERSION_MAJOR + + int _vsnprintf_s(char* buffer, size_t sizeOfBuffer, size_t count, const char* format, va_list argptr) { ASSERT(count == _TRUNCATE); @@ -107,11 +112,16 @@ int strncpy_s(char* dest, size_t dest_size, const char* source, size_t count) { } +#ifndef __MINGW64_VERSION_MAJOR + inline void MemoryBarrier() { int barrier = 0; __asm__ __volatile__("xchgl %%eax,%0 ":"=r" (barrier)); } +#endif // __MINGW64_VERSION_MAJOR + + #endif // __MINGW32__ // Generate a pseudo-random number in the range 0-2^31-1. Usually |