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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1999 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
sgjesse@chromium.org 2009-05-19 09:59:41 +00:00
parent 8987c93a12
commit e3464bca9d
2 changed files with 12 additions and 1 deletions

View File

@ -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 int int32_t;
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

View File

@ -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__