Revision: 16380
Author:   [email protected]
Date:     Wed Aug 28 08:35:04 2013 UTC
Log:      Fix compilation with recent MinGW64 versions.

Don't check for WIN32 define. Use V8_OS_* macros whenever
possible, and if not use _WIN32.

BUG=v8:2300
[email protected]

Review URL: https://codereview.chromium.org/23687003
http://code.google.com/p/v8/source/detail?r=16380

Modified:
 /branches/bleeding_edge/src/arm/disasm-arm.cc
 /branches/bleeding_edge/src/ast.h
 /branches/bleeding_edge/src/flag-definitions.h
 /branches/bleeding_edge/src/gdb-jit.cc
 /branches/bleeding_edge/src/ia32/regexp-macro-assembler-ia32.cc
 /branches/bleeding_edge/src/mips/disasm-mips.cc
 /branches/bleeding_edge/src/platform.h
 /branches/bleeding_edge/src/preparser.h
 /branches/bleeding_edge/src/v8dll-main.cc
 /branches/bleeding_edge/src/win32-headers.h
 /branches/bleeding_edge/src/x64/regexp-macro-assembler-x64.cc
 /branches/bleeding_edge/test/cctest/test-api.cc

=======================================
--- /branches/bleeding_edge/src/arm/disasm-arm.cc Thu Jul 25 15:04:38 2013 UTC +++ /branches/bleeding_edge/src/arm/disasm-arm.cc Wed Aug 28 08:35:04 2013 UTC
@@ -50,9 +50,6 @@
 #include <stdio.h>
 #include <stdarg.h>
 #include <string.h>
-#ifndef WIN32
-#include <stdint.h>
-#endif

 #include "v8.h"

=======================================
--- /branches/bleeding_edge/src/ast.h   Tue Aug 27 11:44:45 2013 UTC
+++ /branches/bleeding_edge/src/ast.h   Wed Aug 28 08:35:04 2013 UTC
@@ -123,10 +123,6 @@
   STATEMENT_NODE_LIST(V)                        \
   EXPRESSION_NODE_LIST(V)

-#ifdef WIN32
-#undef Yield
-#endif
-
 // Forward declarations
 class AstConstructionVisitor;
 template<class> class AstNodeFactory;
=======================================
--- /branches/bleeding_edge/src/flag-definitions.h Mon Aug 26 17:00:58 2013 UTC +++ /branches/bleeding_edge/src/flag-definitions.h Wed Aug 28 08:35:04 2013 UTC
@@ -620,7 +620,7 @@
 DEFINE_float(testing_float_flag, 2.5, "float-flag")
 DEFINE_string(testing_string_flag, "Hello, world!", "string-flag")
DEFINE_int(testing_prng_seed, 42, "Seed used for threading test randomness")
-#ifdef WIN32
+#ifdef _WIN32
 DEFINE_string(testing_serialization_file, "C:\\Windows\\Temp\\serdes",
               "file in which to testing_serialize heap")
 #else
=======================================
--- /branches/bleeding_edge/src/gdb-jit.cc      Mon Jul 29 12:12:39 2013 UTC
+++ /branches/bleeding_edge/src/gdb-jit.cc      Wed Aug 28 08:35:04 2013 UTC
@@ -1872,7 +1872,7 @@
 static void RegisterCodeEntry(JITCodeEntry* entry,
                               bool dump_if_enabled,
                               const char* name_hint) {
-#if defined(DEBUG) && !defined(WIN32)
+#if defined(DEBUG) && !V8_OS_WIN
   static int file_num = 0;
   if (FLAG_gdbjit_dump && dump_if_enabled) {
     static const int kMaxFileNameSize = 64;
=======================================
--- /branches/bleeding_edge/src/ia32/regexp-macro-assembler-ia32.cc Fri Jul 5 09:52:11 2013 UTC +++ /branches/bleeding_edge/src/ia32/regexp-macro-assembler-ia32.cc Wed Aug 28 08:35:04 2013 UTC
@@ -711,7 +711,7 @@
   // position registers.
   __ mov(Operand(ebp, kInputStartMinusOne), eax);

-#ifdef WIN32
+#if V8_OS_WIN
   // Ensure that we write to each stack page, in order. Skipping a page
   // on Windows can cause segmentation faults. Assuming page size is 4k.
   const int kPageSize = 4096;
@@ -721,7 +721,7 @@
       i += kRegistersPerPage) {
     __ mov(register_location(i), eax);  // One write every page.
   }
-#endif  // WIN32
+#endif  // V8_OS_WIN

   Label load_char_start_regexp, start_regexp;
   // Load newline if index is at start, previous character otherwise.
=======================================
--- /branches/bleeding_edge/src/mips/disasm-mips.cc Fri Jun 28 15:34:48 2013 UTC +++ /branches/bleeding_edge/src/mips/disasm-mips.cc Wed Aug 28 08:35:04 2013 UTC
@@ -50,9 +50,6 @@
 #include <stdio.h>
 #include <stdarg.h>
 #include <string.h>
-#ifndef WIN32
-#include <stdint.h>
-#endif

 #include "v8.h"

=======================================
--- /branches/bleeding_edge/src/platform.h      Mon Aug 26 09:37:39 2013 UTC
+++ /branches/bleeding_edge/src/platform.h      Wed Aug 28 08:35:04 2013 UTC
@@ -44,6 +44,12 @@
 #ifndef V8_PLATFORM_H_
 #define V8_PLATFORM_H_

+#include <cstdarg>
+
+#include "lazy-instance.h"
+#include "utils.h"
+#include "v8globals.h"
+
 #ifdef __sun
 # ifndef signbit
 namespace std {
@@ -55,19 +61,12 @@
 // GCC specific stuff
 #ifdef __GNUC__

-// Needed for va_list on at least MinGW and Android.
-#include <stdarg.h>
-
 #define __GNUC_VERSION__ (__GNUC__ * 10000 + __GNUC_MINOR__ * 100)

 #endif  // __GNUC__

-
-// Windows specific stuff.
-#ifdef WIN32
-
 // Microsoft Visual C++ specific stuff.
-#ifdef _MSC_VER
+#if V8_CC_MSVC

 #include "win32-headers.h"
 #include "win32-math.h"
@@ -76,7 +75,7 @@

 inline int lrint(double flt) {
   int intgr;
-#if defined(V8_TARGET_ARCH_IA32)
+#if V8_TARGET_ARCH_IA32
   __asm {
     fld flt
     fistp intgr
@@ -91,18 +90,12 @@
   return intgr;
 }

-#endif  // _MSC_VER
+#endif  // V8_CC_MSVC

-#ifndef __CYGWIN__
 // Random is missing on both Visual Studio and MinGW.
+#if V8_CC_MSVC || V8_CC_MINGW
 int random();
-#endif
-
-#endif  // WIN32
-
-#include "lazy-instance.h"
-#include "utils.h"
-#include "v8globals.h"
+#endif  // V8_CC_MSVC || V8_CC_MINGW

 namespace v8 {
 namespace internal {
=======================================
--- /branches/bleeding_edge/src/preparser.h     Fri Jul 19 09:57:35 2013 UTC
+++ /branches/bleeding_edge/src/preparser.h     Wed Aug 28 08:35:04 2013 UTC
@@ -104,11 +104,6 @@
 };


-#ifdef WIN32
-#undef Yield
-#endif
-
-
 class PreParser {
  public:
   enum PreParseResult {
=======================================
--- /branches/bleeding_edge/src/v8dll-main.cc   Wed May  4 11:10:49 2011 UTC
+++ /branches/bleeding_edge/src/v8dll-main.cc   Wed Aug 28 08:35:04 2013 UTC
@@ -30,8 +30,8 @@
 #undef USING_V8_SHARED
 #include "../include/v8.h"

-#ifdef WIN32
-#include <windows.h>  // NOLINT
+#if V8_OS_WIN
+#include "win32-headers.h"

 extern "C" {
 BOOL WINAPI DllMain(HANDLE hinstDLL,
@@ -41,4 +41,4 @@
   return TRUE;
 }
 }
-#endif
+#endif  // V8_OS_WIN
=======================================
--- /branches/bleeding_edge/src/win32-headers.h Wed Jul 31 07:51:46 2013 UTC
+++ /branches/bleeding_edge/src/win32-headers.h Wed Aug 28 08:35:04 2013 UTC
@@ -96,3 +96,4 @@
 #undef GetObject
 #undef CreateMutex
 #undef CreateSemaphore
+#undef Yield
=======================================
--- /branches/bleeding_edge/src/x64/regexp-macro-assembler-x64.cc Fri Aug 2 09:53:11 2013 UTC +++ /branches/bleeding_edge/src/x64/regexp-macro-assembler-x64.cc Wed Aug 28 08:35:04 2013 UTC
@@ -761,7 +761,7 @@
   // position registers.
   __ movq(Operand(rbp, kInputStartMinusOne), rax);

-#ifdef WIN32
+#if V8_OS_WIN
// Ensure that we have written to each stack page, in order. Skipping a page
   // on Windows can cause segmentation faults. Assuming page size is 4k.
   const int kPageSize = 4096;
@@ -771,7 +771,7 @@
       i += kRegistersPerPage) {
     __ movq(register_location(i), rax);  // One write every page.
   }
-#endif  // WIN32
+#endif  // V8_OS_WIN

   // Initialize code object pointer.
   __ Move(code_object_pointer(), masm_.CodeObject());
=======================================
--- /branches/bleeding_edge/test/cctest/test-api.cc Tue Aug 27 14:13:40 2013 UTC +++ /branches/bleeding_edge/test/cctest/test-api.cc Wed Aug 28 08:35:04 2013 UTC
@@ -25,17 +25,17 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-#include <limits.h>
-
-#ifndef WIN32
-#include <signal.h>  // kill
-#include <unistd.h>  // getpid
-#endif  // WIN32
+#include <climits>
+#include <csignal>
 #include <string>
 #include <map>

 #include "v8.h"

+#if V8_OS_POSIX
+#include <unistd.h>  // NOLINT
+#endif
+
 #include "api.h"
 #include "arguments.h"
 #include "cctest.h"
@@ -20031,7 +20031,7 @@
 }


-#ifndef WIN32
+#if V8_OS_POSIX
 class ThreadInterruptTest {
  public:
   ThreadInterruptTest() : sem_(NULL), sem_value_(0) { }
@@ -20273,4 +20273,4 @@
   v8::V8::SetFailedAccessCheckCallbackFunction(NULL);
 }

-#endif  // WIN32
+#endif  // V8_OS_POSIX

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to