xref: /aosp_15_r20/external/lzma/CPP/7zip/UI/FileManager/StdAfx.h (revision f6dc9357d832569d4d1f5d24eacdb3935a1ae8e6)
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 "../../../Common/Common.h"
11 
12 #endif
13 
14 /*
15 WINVER and _WIN32_WINNT
16 
17 MSVC6 / 2003sdk:
18 {
19   <windows.h> doesn't set _WIN32_WINNT
20   if WINVER is not set <windows.h> sets WINVER to value:
21     0x0400 : MSVC6
22     0x0501 : Windows Server 2003 PSDK / 2003 R2 PSDK
23 }
24 
25 SDK for Win7 (and later)
26 {
27   <windows.h> sets _WIN32_WINNT if it's not set.
28   <windows.h> sets WINVER if it's not set.
29 <windows.h> includes <sdkddkver.h> that does:
30 #if !defined(_WIN32_WINNT) && !defined(_CHICAGO_)
31   #define _WIN32_WINNT 0x0601  // in win7 sdk
32   #define _WIN32_WINNT 0x0A00  // in win10 sdk
33 #endif
34 #ifndef WINVER
35  #ifdef _WIN32_WINNT
36   #define WINVER _WIN32_WINNT
37  else
38   #define WINVER 0x0601 // in win7 sdk
39   #define WINVER 0x0A00 // in win10 sdk
40  endif
41 #endif
42 }
43 
44 Some GUI structures defined by windows will be larger,
45 If (_WIN32_WINNT) value is larger.
46 
47 Also if we send sizeof(win_gui_struct) to some windows function,
48 and we compile that code with big (_WIN32_WINNT) value,
49 the window function in old Windows can fail, if that old Windows
50 doesn't understand new big version of (win_gui_struct) compiled
51 with big (_WIN32_WINNT) value.
52 
53 So it's better to define smallest (_WIN32_WINNT) value here.
54 In 7-Zip FM we use some functions that require (_WIN32_WINNT == 0x0500).
55 So it's simpler to define (_WIN32_WINNT == 0x0500) here.
56 If we define (_WIN32_WINNT == 0x0400) here, we need some manual
57 declarations for functions and macros that require (0x0500) functions.
58 Also libs must contain these (0x0500+) functions.
59 
60 Some code in 7-zip FM uses also CommCtrl.h structures
61 that depend from (_WIN32_IE) value. But default
62 (_WIN32_IE) value from <windows.h> probably is OK for us.
63 So we don't set _WIN32_IE here.
64 default _WIN32_IE value set by <windows.h>:
65   0x501 2003sdk
66   0xa00 win10 sdk
67 */
68