summaryrefslogtreecommitdiff
path: root/lib/win32/emu_winver.h
blob: 92060150f030fdab6a47aa1eaf92a7de6ff9ba51 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef _EMU_WINVER_H
#define _EMU_WINVER_H

// set up to include the necessary parts of Windows headers

#define WIN32_LEAN_AND_MEAN

#ifndef __MSVCRT_VERSION__
#define __MSVCRT_VERSION__ 0x0601
#endif

// We need WINVER at least 0x0500 to use GetFileSizeEx on Cygwin/MinGW,
// and 0x0501 for FindFirstFile(W) for opendir/readdir.
//
// WIN32_WINNT versions 0x0600 (Vista) and higher enable WSAPoll() in
// winsock2.h, whose struct pollfd conflicts with ours below, so for
// now we just set it lower than that, to Windows XP (0x0501).

#ifdef WINVER
#	if WINVER != 0x0501
// provoke a redefinition warning to track down the offender
#		define WINVER 0x0501
#		error Must include emu.h before setting WINVER
#	endif
#endif
#define WINVER 0x0501

#ifdef _WIN32_WINNT
#	if _WIN32_WINNT != 0x0501
// provoke a redefinition warning to track down the offender
#		define _WIN32_WINNT 0x0501
#		error Must include emu.h before setting _WIN32_WINNT
#	endif
#endif
#define _WIN32_WINNT 0x0501

#endif // _EMU_WINVER_H