Index: src/platform-win32.cc |
=================================================================== |
--- src/platform-win32.cc (revision 11315) |
+++ src/platform-win32.cc (working copy) |
@@ -51,6 +51,22 @@ |
// the Microsoft Visual Studio C++ CRT. |
#ifdef __MINGW32__ |
+ |
+#ifndef __MINGW64_VERSION_MAJOR |
+ |
+#define _TRUNCATE 0 |
+#define STRUNCATE 80 |
+ |
+inline void MemoryBarrier() { |
+ int barrier = 0; |
+ __asm__ __volatile__("xchgl %%eax,%0 ":"=r" (barrier)); |
+} |
+ |
+#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; |
@@ -64,13 +80,6 @@ |
return *pFile != NULL ? 0 : 1; |
} |
- |
-#ifndef __MINGW64_VERSION_MAJOR |
-#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); |
@@ -104,17 +113,8 @@ |
return 0; |
} |
+#endif // MINGW_HAS_SECURE_API |
-#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 |