Reviewers: Lasse Reichstein, Description: 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. Please review this at http://codereview.chromium.org/113576 SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/ Affected files: M include/v8.h M src/platform-win32.cc Index: include/v8.h =================================================================== --- include/v8.h (revision 1993) +++ include/v8.h (working copy) @@ -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 Index: src/platform-win32.cc =================================================================== --- src/platform-win32.cc (revision 1993) +++ src/platform-win32.cc (working copy) @@ -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 -~----------~----~----~----~------~----~------~--~---
