Revision: 10793
Author:   yang...@chromium.org
Date:     Wed Feb 22 04:26:36 2012
Log:      Fix compilation with MinGW-w64.

BUG=v8:1943
TEST=

Review URL: https://chromiumcodereview.appspot.com/9428027
Patch from Jonathan Liu <net...@gmail.com>.
http://code.google.com/p/v8/source/detail?r=10793

Modified:
 /branches/bleeding_edge/AUTHORS
 /branches/bleeding_edge/SConstruct
 /branches/bleeding_edge/src/globals.h
 /branches/bleeding_edge/src/platform-win32.cc
 /branches/bleeding_edge/src/win32-headers.h
 /branches/bleeding_edge/src/x64/cpu-x64.cc

=======================================
--- /branches/bleeding_edge/AUTHORS     Wed Feb 22 03:35:17 2012
+++ /branches/bleeding_edge/AUTHORS     Wed Feb 22 04:26:36 2012
@@ -28,6 +28,7 @@
 Jay Freeman <sau...@saurik.com>
 Joel Stanley <joel.s...@gmail.com>
 John Jozwiak <jjozw...@codeaurora.org>
+Jonathan Liu <net...@gmail.com>
 Kun Zhang <zha...@codeaurora.org>
 Martyn Capewell <martyn.capew...@arm.com>
 Matt Hanselman <mjhansel...@gmail.com>
=======================================
--- /branches/bleeding_edge/SConstruct  Wed Feb 22 03:38:31 2012
+++ /branches/bleeding_edge/SConstruct  Wed Feb 22 04:26:36 2012
@@ -1,4 +1,4 @@
-# Copyright 2011 the V8 project authors. All rights reserved.
+# Copyright 2012 the V8 project authors. All rights reserved.
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions are
 # met:
@@ -300,7 +300,7 @@
                        '-Wnon-virtual-dtor']
     },
     'os:win32': {
-      'WARNINGFLAGS': ['-pedantic', '-Wno-long-long']
+ 'WARNINGFLAGS': ['-pedantic', '-Wno-long-long', '-Wno-pedantic-ms-format']
     },
     'os:linux': {
       'WARNINGFLAGS': ['-pedantic'],
=======================================
--- /branches/bleeding_edge/src/globals.h       Tue Nov 29 02:56:11 2011
+++ /branches/bleeding_edge/src/globals.h       Wed Feb 22 04:26:36 2012
@@ -1,4 +1,4 @@
-// Copyright 2011 the V8 project authors. All rights reserved.
+// Copyright 2012 the V8 project authors. All rights reserved.
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
 // met:
@@ -191,6 +191,11 @@
 #define V8_PTR_PREFIX ""
 #endif  // V8_HOST_ARCH_64_BIT

+#ifdef __MINGW64__
+#undef V8_PTR_PREFIX
+#define V8_PTR_PREFIX "I64"
+#endif  // __MINGW64__
+
 // The following macro works on both 32 and 64-bit platforms.
 // Usage: instead of writing 0x1234567890123456
 //      write V8_2PART_UINT64_C(0x12345678,90123456);
=======================================
--- /branches/bleeding_edge/src/platform-win32.cc       Tue Feb  7 00:00:36 2012
+++ /branches/bleeding_edge/src/platform-win32.cc       Wed Feb 22 04:26:36 2012
@@ -56,23 +56,28 @@
   *out_tm = *posix_local_time_struct;
   return 0;
 }
-
-
-// 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);
=======================================
--- /branches/bleeding_edge/src/win32-headers.h Tue Jan 10 00:37:45 2012
+++ /branches/bleeding_edge/src/win32-headers.h Wed Feb 22 04:26:36 2012
@@ -1,4 +1,4 @@
-// Copyright 2010 the V8 project authors. All rights reserved.
+// Copyright 2012 the V8 project authors. All rights reserved.
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
 // met:
@@ -64,10 +64,10 @@
 #undef _WIN32_WINNT
 #define _WIN32_WINNT 0x501
 #endif  // __MINGW32__
-#ifndef __MINGW32__
+#if !defined(__MINGW32__) || defined(__MINGW64_VERSION_MAJOR)
 #include <dbghelp.h>  // For SymLoadModule64 and al.
 #include <errno.h>  // For STRUNCATE
-#endif  // __MINGW32__
+#endif  // !defined(__MINGW32__) || defined(__MINGW64_VERSION_MAJOR)
 #include <limits.h>  // For INT_MAX and al.
 #include <tlhelp32.h>  // For Module32First and al.

=======================================
--- /branches/bleeding_edge/src/x64/cpu-x64.cc  Fri Jan 13 05:09:52 2012
+++ /branches/bleeding_edge/src/x64/cpu-x64.cc  Wed Feb 22 04:26:36 2012
@@ -1,4 +1,4 @@
-// Copyright 2011 the V8 project authors. All rights reserved.
+// Copyright 2012 the V8 project authors. All rights reserved.
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
 // met:
@@ -27,7 +27,7 @@

 // CPU specific code for x64 independent of OS goes here.

-#ifdef __GNUC__
+#if defined(__GNUC__) && !defined(__MINGW64__)
 #include "third_party/valgrind/valgrind.h"
 #endif

--
v8-dev mailing list
v8-dev@googlegroups.com
http://groups.google.com/group/v8-dev

Reply via email to