diff --git a/include/v8.h b/include/v8.h index 9f59e4e6b0..a4b73fd1d7 100644 --- a/include/v8.h +++ b/include/v8.h @@ -41,6 +41,10 @@ #include #ifdef _WIN32 +// When compiling on MinGW stdint.h is available. +#ifdef __MINGW32__ +#include +#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 diff --git a/src/platform-win32.cc b/src/platform-win32.cc index 6c4e67a7f2..52068a0f3d 100644 --- a/src/platform-win32.cc +++ b/src/platform-win32.cc @@ -58,6 +58,12 @@ #include // For LocalOffset() implementation. #include // 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 // For SymLoadModule64 and al. #endif // __MINGW32__