diff options
author | Davide Beatrici <davidebeatrici@gmail.com> | 2019-09-12 23:44:16 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-12 23:44:16 +0300 |
commit | a38d19a7595c3e672f5ed549400b36348e01e442 (patch) | |
tree | 34bd1c4db9b95748d263aea811e849dec7e5525c /src/win.h | |
parent | 713b92c3c233f8f38200c4a458e0196d3d39a3b0 (diff) | |
parent | 15831dbca85dd906edbad2bfff2b147527a456e2 (diff) |
Merge PR #3644: Don't include PCH headers directly, add missing includes
Diffstat (limited to 'src/win.h')
-rw-r--r-- | src/win.h | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/src/win.h b/src/win.h new file mode 100644 index 000000000..aaeb1a7db --- /dev/null +++ b/src/win.h @@ -0,0 +1,54 @@ +// Copyright 2005-2019 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_ |