forked from ValveSoftware/GameNetworkingSockets
-
Notifications
You must be signed in to change notification settings - Fork 15
/
winlite.h
78 lines (74 loc) · 1.69 KB
/
winlite.h
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
//========= Copyright 1996-2005, Valve Corporation, All rights reserved. ============//
//
// Purpose: includes windows.h, with a minimal includes set, and clearing problematic defines
//
//=============================================================================//
#pragma once
#ifdef _WIN32
#ifndef WINLITE_H
#define WINLITE_H
//
// Prevent tons of unused windows definitions
//
#undef ARRAYSIZE
#ifndef _WIN32_WINNT
#if !defined(_SERVER)
#define _WIN32_WINNT 0x0501 // XP
#else
#define _WIN32_WINNT 0x0600 // Vista / Server 2008
#endif
#ifndef _WIN32_IE
#define _WIN32_IE 0x0500
#else
#if ( _WIN32_IE < 0x0500 )
#error _WIN32_IE must exceed 5.0
#endif
#endif
#endif
#ifndef NOMINMAX
#define NOMINMAX
#endif
#define NOSERVICE
#define NOMCX
#define NOIME
#define NOSOUND
#define NOCOMM
#define NORPC
#define NOCRYPT
// if we include windows.h before winsock2, we get winsock1, and that breaks
// the parts of the code where we need to use winsock2 - so include winsock2
// first...
#include <winsock2.h>
#include <windows.h>
#include <dbghelp.h>
#undef PostMessage
#undef GetCurrentTime
#undef CreateEvent
#undef CreateMutex
#ifndef DONT_PROTECT_SENDMESSAGE
#undef SendMessage
#endif
#undef ShellExecute
#undef PropertySheet
#ifndef DONT_PROTECT_MESSAGEBOX
#undef MessageBox
#endif
#undef PlaySound
#undef CreateFont
#undef SetPort
#undef GetClassName
#undef Yield
#undef GetMessage
#undef DeleteFile
#undef StartService
#undef CopyFile
#undef MoveFile
#undef END_INTERFACE
#ifndef ALLOW_ARRAYSIZE // use this is you are writing code that doesn't consume tier0
#undef ARRAYSIZE
#define ARRAYSIZE Dont_Use_ARRAYSIZE_Use_V_ARRAYSIZE
#endif
#undef min
#undef max
#endif // WINLITE_H
#endif // _WIN32