Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 1 | // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef V8_BASE_WIN32_HEADERS_H_ |
| 6 | #define V8_BASE_WIN32_HEADERS_H_ |
| 7 | |
| 8 | #ifndef WIN32_LEAN_AND_MEAN |
| 9 | // WIN32_LEAN_AND_MEAN implies NOCRYPT and NOGDI. |
| 10 | #define WIN32_LEAN_AND_MEAN |
| 11 | #endif |
| 12 | #ifndef NOMINMAX |
| 13 | #define NOMINMAX |
| 14 | #endif |
| 15 | #ifndef NOKERNEL |
| 16 | #define NOKERNEL |
| 17 | #endif |
| 18 | #ifndef NOUSER |
| 19 | #define NOUSER |
| 20 | #endif |
| 21 | #ifndef NOSERVICE |
| 22 | #define NOSERVICE |
| 23 | #endif |
| 24 | #ifndef NOSOUND |
| 25 | #define NOSOUND |
| 26 | #endif |
| 27 | #ifndef NOMCX |
| 28 | #define NOMCX |
| 29 | #endif |
Ben Murdoch | 61f157c | 2016-09-16 13:49:30 +0100 | [diff] [blame] | 30 | // Require Windows Vista or higher (this is required for the |
| 31 | // QueryThreadCycleTime function to be present). |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 32 | #ifndef _WIN32_WINNT |
Ben Murdoch | 61f157c | 2016-09-16 13:49:30 +0100 | [diff] [blame] | 33 | #define _WIN32_WINNT 0x0600 |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 34 | #endif |
| 35 | |
| 36 | #include <windows.h> |
| 37 | |
| 38 | #include <mmsystem.h> // For timeGetTime(). |
| 39 | #include <signal.h> // For raise(). |
| 40 | #include <time.h> // For LocalOffset() implementation. |
| 41 | #ifdef __MINGW32__ |
| 42 | // Require Windows XP or higher when compiling with MinGW. This is for MinGW |
| 43 | // header files to expose getaddrinfo. |
| 44 | #undef _WIN32_WINNT |
| 45 | #define _WIN32_WINNT 0x501 |
| 46 | #endif // __MINGW32__ |
| 47 | #if !defined(__MINGW32__) || defined(__MINGW64_VERSION_MAJOR) |
| 48 | #include <dbghelp.h> // For SymLoadModule64 and al. |
| 49 | #include <errno.h> // For STRUNCATE |
| 50 | #endif // !defined(__MINGW32__) || defined(__MINGW64_VERSION_MAJOR) |
| 51 | #include <limits.h> // For INT_MAX and al. |
| 52 | #include <tlhelp32.h> // For Module32First and al. |
| 53 | |
| 54 | // These additional WIN32 includes have to be right here as the #undef's below |
| 55 | // makes it impossible to have them elsewhere. |
| 56 | #include <winsock2.h> |
| 57 | #include <ws2tcpip.h> |
| 58 | #ifndef __MINGW32__ |
| 59 | #include <wspiapi.h> |
| 60 | #endif // __MINGW32__ |
| 61 | #include <process.h> // For _beginthreadex(). |
| 62 | #include <stdlib.h> |
| 63 | |
| 64 | #undef VOID |
| 65 | #undef DELETE |
| 66 | #undef IN |
| 67 | #undef THIS |
| 68 | #undef CONST |
| 69 | #undef NAN |
| 70 | #undef UNKNOWN |
| 71 | #undef NONE |
| 72 | #undef ANY |
| 73 | #undef IGNORE |
| 74 | #undef STRICT |
| 75 | #undef GetObject |
| 76 | #undef CreateSemaphore |
| 77 | #undef Yield |
| 78 | #undef RotateRight32 |
Ben Murdoch | da12d29 | 2016-06-02 14:46:10 +0100 | [diff] [blame] | 79 | #undef RotateLeft32 |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 80 | #undef RotateRight64 |
Ben Murdoch | da12d29 | 2016-06-02 14:46:10 +0100 | [diff] [blame] | 81 | #undef RotateLeft64 |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 82 | |
| 83 | #endif // V8_BASE_WIN32_HEADERS_H_ |