1 // StdAfx.h 2 3 #ifndef ZIP7_INC_STDAFX_H 4 #define ZIP7_INC_STDAFX_H 5 6 #if defined(_MSC_VER) && _MSC_VER >= 1800 7 #pragma warning(disable : 4464) // relative include path contains '..' 8 #endif 9 10 #include "../../../../C/Compiler.h" 11 12 Z7_DIAGNOSCTIC_IGNORE_BEGIN_RESERVED_MACRO_IDENTIFIER 13 #ifndef _WIN32_WINNT 14 // #define _WIN32_WINNT 0x0400 15 #define _WIN32_WINNT 0x0500 16 // #define _WIN32_WINNT 0x0600 17 // #define _WIN32_WINNT 0x0A00 18 #endif 19 #ifndef WINVER 20 #define WINVER _WIN32_WINNT 21 #endif 22 // #define _WIN32_IE 0x400 // for debug 23 Z7_DIAGNOSCTIC_IGNORE_END_RESERVED_MACRO_IDENTIFIER 24 25 #include "../../../Common/Common.h" 26 #include "../../../Common/MyWindows.h" 27 28 #endif 29 30 /* 31 WINVER and _WIN32_WINNT 32 33 MSVC6 / 2003sdk: 34 { 35 <windows.h> doesn't set _WIN32_WINNT 36 if WINVER is not set <windows.h> sets WINVER to value: 37 0x0400 : MSVC6 38 0x0501 : Windows Server 2003 PSDK / 2003 R2 PSDK 39 } 40 41 SDK for Win7 (and later) 42 { 43 <windows.h> sets _WIN32_WINNT if it's not set. 44 <windows.h> sets WINVER if it's not set. 45 <windows.h> includes <sdkddkver.h> that does: 46 #if !defined(_WIN32_WINNT) && !defined(_CHICAGO_) 47 #define _WIN32_WINNT 0x0601 // in win7 sdk 48 #define _WIN32_WINNT 0x0A00 // in win10 sdk 49 #endif 50 #ifndef WINVER 51 #ifdef _WIN32_WINNT 52 #define WINVER _WIN32_WINNT 53 else 54 #define WINVER 0x0601 // in win7 sdk 55 #define WINVER 0x0A00 // in win10 sdk 56 endif 57 #endif 58 } 59 60 Some GUI structures defined by windows will be larger, 61 If (_WIN32_WINNT) value is larger. 62 63 Also if we send sizeof(win_gui_struct) to some windows function, 64 and we compile that code with big (_WIN32_WINNT) value, 65 the window function in old Windows can fail, if that old Windows 66 doesn't understand new big version of (win_gui_struct) compiled 67 with big (_WIN32_WINNT) value. 68 69 So it's better to define smallest (_WIN32_WINNT) value here. 70 In 7-Zip FM we use some functions that require (_WIN32_WINNT == 0x0500). 71 So it's simpler to define (_WIN32_WINNT == 0x0500) here. 72 If we define (_WIN32_WINNT == 0x0400) here, we need some manual 73 declarations for functions and macros that require (0x0500) functions. 74 Also libs must contain these (0x0500+) functions. 75 76 Some code in 7-zip FM uses also CommCtrl.h structures 77 that depend from (_WIN32_IE) value. But default 78 (_WIN32_IE) value from <windows.h> probably is OK for us. 79 So we don't set _WIN32_IE here. 80 default _WIN32_IE value set by <windows.h>: 81 0x501 2003sdk 82 0xa00 win10 sdk 83 */ 84