Welcome to mirror list, hosted at ThFree Co, Russian Federation.

win.h « src - github.com/mumble-voip/mumble.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src/win.h
blob: be160cb25e40024a0d0759c94cde48306b25e54e (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// Copyright 2005-2020 The Mumble Developers. All rights reserved.
// Use of this source code is governed by a BSD-style license
// that can be found in the LICENSE file at the root of the
// Mumble source tree or at <https://www.mumble.info/LICENSE>.

// This header is meant to be included instead of <windows.h>.
// It takes care of including <windows.h> with the right settings and
// for MinGW compilers it defines stuff that is missing in MinGW’s headers.

#ifndef MUMBLE_WIN_H_
#define MUMBLE_WIN_H_

#ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
#endif

#ifndef UNICODE
# define UNICODE
#endif

#ifndef NOMINMAX
# define NOMINMAX
#endif

#ifdef __MINGW32__
// Our MinGW build targets Windows 7 for now.
// Set up the appropriate Windows macros such that
// MinGW's Windows headers expose all the functionality
// we need.
// This seems to be required only with MXE, with MSYS2
// the target is already Windows 7
# if (_WIN32_WINNT < 0x0601)
#  undef _WIN32_WINNT
#  define _WIN32_WINNT 0x0601
# endif
# if (NTDDI_VERSION < NTDDI_WIN7)
#  undef NTDDI_VERSION
#  define NTDDI_VERSION NTDDI_WIN7
# endif
#endif

#include <windows.h>

#ifdef __MINGW32__
// MinGW's <qos2.h> header does not provide everything we need,
// so define QOS_FLOWID (and PQOS_FLOWID) as well as QOS_NON_ADAPTIVE_FLOW
// ourselves to allow us to build with QoS support on MinGW.
typedef UINT32 QOS_FLOWID, *PQOS_FLOWID;
# ifndef QOS_NON_ADAPTIVE_FLOW
#  define QOS_NON_ADAPTIVE_FLOW 0x00000002
# endif
#endif

#endif // MUMBLE_WIN_H_