blob: b61ce717e5c0939ef529ca72cd838b51db76b551 [file] [log] [blame]
Ben Murdochb8a8cc12014-11-26 15:28:44 +00001// 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 Murdoch61f157c2016-09-16 13:49:30 +010030// Require Windows Vista or higher (this is required for the
31// QueryThreadCycleTime function to be present).
Ben Murdochb8a8cc12014-11-26 15:28:44 +000032#ifndef _WIN32_WINNT
Ben Murdoch61f157c2016-09-16 13:49:30 +010033#define _WIN32_WINNT 0x0600
Ben Murdochb8a8cc12014-11-26 15:28:44 +000034#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 Murdochda12d292016-06-02 14:46:10 +010079#undef RotateLeft32
Ben Murdochb8a8cc12014-11-26 15:28:44 +000080#undef RotateRight64
Ben Murdochda12d292016-06-02 14:46:10 +010081#undef RotateLeft64
Ben Murdochb8a8cc12014-11-26 15:28:44 +000082
83#endif // V8_BASE_WIN32_HEADERS_H_