Debian Codegraph @

src/mpt/check/windows.hpp

raw
1 /* SPDX-License-Identifier: BSL-1.0 OR BSD-3-Clause */
2
3 #ifndef MPT_CHECK_WINDOWS_HPP
4 #define MPT_CHECK_WINDOWS_HPP
5
6 #include "mpt/base/detect_os.hpp"
7 #include "mpt/base/compiletime_warning.hpp"
8
9 #if MPT_OS_WINDOWS
10
11 #ifndef MPT_CHECK_WINDOWS_IGNORE_WARNING_NO_UNICODE
12 #if MPT_OS_WINDOWS_WINNT
13 #ifndef UNICODE
14 MPT_WARNING("windows.h uses MBCS TCHAR. Please #define UNICODE.")
15 #endif
16 #elif MPT_OS_WINDOWS_WIN9X
17 #ifdef UNICODE
18 MPT_WARNING("Targeting Win9x but windows.h uses UNICODE TCHAR. Please do not #define UNICODE.")
19 #endif
20 #endif
21 #endif
22
23 #ifndef MPT_CHECK_WINDOWS_IGNORE_WARNING_UNICODE_MISMATCH
24 #ifdef _UNICODE
25 #ifndef UNICODE
26 MPT_WARNING("_UNICODE is defined but UNICODE is not defined. Please enable UNICODE support in your compiler, or do not #define _UNICODE.")
27 #endif
28 #endif
29 #endif
30
31 #ifndef NOMINMAX
32 #ifndef MPT_CHECK_WINDOWS_IGNORE_WARNING_NO_NOMINMAX
33 MPT_WARNING("windows.h defines min and max which conflicts with C++. Please #define NOMINMAX.")
34 #endif
35 #endif
36
37 #endif // MPT_OS_WINDOWS
38
39 #endif // MPT_CHECK_WINDOWS_HPP