PLaSK library

Loading...
Searching...
No Matches
minimal_windows.h
Go to the documentation of this file.
1#ifndef PLASK__UTILS_MINIMAL_WINDOWS_H
2#define PLASK__UTILS_MINIMAL_WINDOWS_H
3
4// This file includes minimal possible version of windows.h.
5
6// push_macro and pop_macro pragmas are not standard, but are supported by all compilers: MSVC, gcc, clang, intel
7
8#if defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
9#pragma push_macro("NOMINMAX")
10#pragma push_macro("STRICT")
11#pragma push_macro("WIN32_LEAN_AND_MEAN")
12#pragma push_macro("NOCOMM")
13#ifndef NOMINMAX
14 #define NOMINMAX //prevents windows.h from defining min, max macros, see http://stackoverflow.com/questions/1904635/warning-c4003-and-errors-c2589-and-c2059-on-x-stdnumeric-limitsintmax
15#endif
16#ifndef STRICT
17 #define STRICT
18#endif
19#ifndef WIN32_LEAN_AND_MEAN
20 #define WIN32_LEAN_AND_MEAN
21#endif
22#ifndef NOCOMM
23 #define NOCOMM
24#endif
25
26/*#ifndef _WIN32_WINNT
27# define _WIN32_WINNT 0x502
28#endif*/
29
30#include <windows.h>
31
32//#ifdef copysign
33// #undef copysign
34//#endif
35
36#pragma pop_macro("NOMINMAX")
37#pragma pop_macro("STRICT")
38#pragma pop_macro("WIN32_LEAN_AND_MEAN")
39#pragma pop_macro("NOCOMM")
40
41//#define BOOST_USE_WINDOWS_H // this should be uncommented in case of conflicts of boost definitions with definitions in windows.h
42#endif
43
44#endif // __PLASK__MINIMAL_WINDOWS_H
45