Author: [email protected]
Date: Tue May 19 02:59:41 2009
New Revision: 1999

Modified:
    branches/bleeding_edge/include/v8.h
    branches/bleeding_edge/src/platform-win32.cc

Log:
Fix compilation on MinGW

On MinGW _WIN32_WINNT needs to be 0x501 (Windows XP) instead of 0x500  
(Windows 2000) for some TCP/IP API's to be present.

MinGW uses stdint.h whereas Visual C++ does not.
Review URL: http://codereview.chromium.org/113576

Modified: branches/bleeding_edge/include/v8.h
==============================================================================
--- branches/bleeding_edge/include/v8.h (original)
+++ branches/bleeding_edge/include/v8.h Tue May 19 02:59:41 2009
@@ -41,6 +41,10 @@
  #include <stdio.h>

  #ifdef _WIN32
+// When compiling on MinGW stdint.h is available.
+#ifdef __MINGW32__
+#include <stdint.h>
+#else  // __MINGW32__
  typedef signed char int8_t;
  typedef unsigned char uint8_t;
  typedef short int16_t;  // NOLINT
@@ -49,7 +53,8 @@
  typedef unsigned int uint32_t;
  typedef __int64 int64_t;
  typedef unsigned __int64 uint64_t;
-// intptr_t is defined in crtdefs.h through stdio.h.
+// intptr_t and friends are defined in crtdefs.h through stdio.h.
+#endif  // __MINGW32__

  // Setup for Windows DLL export/import. When building the V8 DLL the
  // BUILDING_V8_SHARED needs to be defined. When building a program which  
uses

Modified: branches/bleeding_edge/src/platform-win32.cc
==============================================================================
--- branches/bleeding_edge/src/platform-win32.cc        (original)
+++ branches/bleeding_edge/src/platform-win32.cc        Tue May 19 02:59:41 2009
@@ -58,6 +58,12 @@

  #include <time.h>  // For LocalOffset() implementation.
  #include <mmsystem.h>  // For timeGetTime().
+#ifdef __MINGW32__
+// Require Windows XP or higher when compiling with MinGW. This is for  
MinGW
+// header files to expose getaddrinfo.
+#undef _WIN32_WINNT
+#define _WIN32_WINNT 0x501
+#endif  // __MINGW32__
  #ifndef __MINGW32__
  #include <dbghelp.h>  // For SymLoadModule64 and al.
  #endif  // __MINGW32__

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

Reply via email to