Revision: 11357
Author:   [email protected]
Date:     Tue Apr 17 07:53:06 2012
Log:      Fix MinGW-w64 GCC 4.7 compilation

Contributed by [email protected]

BUGS=
TEST=

Review URL: https://chromiumcodereview.appspot.com/10019012
http://code.google.com/p/v8/source/detail?r=11357

Modified:
 /branches/bleeding_edge/src/platform-win32.cc
 /branches/bleeding_edge/test/cctest/test-disasm-x64.cc

=======================================
--- /branches/bleeding_edge/src/platform-win32.cc       Fri Apr 13 07:08:31 2012
+++ /branches/bleeding_edge/src/platform-win32.cc       Tue Apr 17 07:53:06 2012
@@ -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;
@@ -63,13 +79,6 @@
   *pFile = fopen(filename, mode);
   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) {
@@ -104,16 +113,7 @@
   return 0;
 }

-
-#ifndef __MINGW64_VERSION_MAJOR
-
-inline void MemoryBarrier() {
-  int barrier = 0;
-  __asm__ __volatile__("xchgl %%eax,%0 ":"=r" (barrier));
-}
-
-#endif  // __MINGW64_VERSION_MAJOR
-
+#endif  // MINGW_HAS_SECURE_API

 #endif  // __MINGW32__

=======================================
--- /branches/bleeding_edge/test/cctest/test-disasm-x64.cc Mon Dec 5 00:58:01 2011 +++ /branches/bleeding_edge/test/cctest/test-disasm-x64.cc Tue Apr 17 07:53:06 2012
@@ -264,6 +264,7 @@
   ExternalReference after_break_target =
       ExternalReference(Debug_Address::AfterBreakTarget(),
                         assm.isolate());
+  USE(after_break_target);
 #endif  // ENABLE_DEBUGGER_SUPPORT
   __ jmp(ic, RelocInfo::CODE_TARGET);
   __ nop();

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to