Precomp.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. /* Precomp.h -- precompilation file
  2. 2024-01-25 : Igor Pavlov : Public domain */
  3. #ifndef ZIP7_INC_PRECOMP_H
  4. #define ZIP7_INC_PRECOMP_H
  5. /*
  6. this file must be included before another *.h files and before <windows.h>.
  7. this file is included from the following files:
  8. C\*.c
  9. C\Util\*\Precomp.h <- C\Util\*\*.c
  10. CPP\Common\Common.h <- *\StdAfx.h <- *\*.cpp
  11. this file can set the following macros:
  12. Z7_LARGE_PAGES 1
  13. Z7_LONG_PATH 1
  14. Z7_WIN32_WINNT_MIN 0x0500 (or higher) : we require at least win2000+ for 7-Zip
  15. _WIN32_WINNT 0x0500 (or higher)
  16. WINVER _WIN32_WINNT
  17. UNICODE 1
  18. _UNICODE 1
  19. */
  20. #include "Compiler.h"
  21. #ifdef _MSC_VER
  22. // #pragma warning(disable : 4206) // nonstandard extension used : translation unit is empty
  23. #if _MSC_VER >= 1912
  24. // #pragma warning(disable : 5039) // pointer or reference to potentially throwing function passed to 'extern "C"' function under - EHc.Undefined behavior may occur if this function throws an exception.
  25. #endif
  26. #endif
  27. /*
  28. // for debug:
  29. #define UNICODE 1
  30. #define _UNICODE 1
  31. #define _WIN32_WINNT 0x0500 // win2000
  32. #ifndef WINVER
  33. #define WINVER _WIN32_WINNT
  34. #endif
  35. */
  36. #ifdef _WIN32
  37. /*
  38. this "Precomp.h" file must be included before <windows.h>,
  39. if we want to define _WIN32_WINNT before <windows.h>.
  40. */
  41. #ifndef Z7_LARGE_PAGES
  42. #ifndef Z7_NO_LARGE_PAGES
  43. #define Z7_LARGE_PAGES 1
  44. #endif
  45. #endif
  46. #ifndef Z7_LONG_PATH
  47. #ifndef Z7_NO_LONG_PATH
  48. #define Z7_LONG_PATH 1
  49. #endif
  50. #endif
  51. #ifndef Z7_DEVICE_FILE
  52. #ifndef Z7_NO_DEVICE_FILE
  53. // #define Z7_DEVICE_FILE 1
  54. #endif
  55. #endif
  56. // we don't change macros if included after <windows.h>
  57. #ifndef _WINDOWS_
  58. #ifndef Z7_WIN32_WINNT_MIN
  59. #if defined(_M_ARM64) || defined(__aarch64__)
  60. // #define Z7_WIN32_WINNT_MIN 0x0a00 // win10
  61. #define Z7_WIN32_WINNT_MIN 0x0600 // vista
  62. #elif defined(_M_ARM) && defined(_M_ARMT) && defined(_M_ARM_NT)
  63. // #define Z7_WIN32_WINNT_MIN 0x0602 // win8
  64. #define Z7_WIN32_WINNT_MIN 0x0600 // vista
  65. #elif defined(_M_X64) || defined(_M_AMD64) || defined(__x86_64__) || defined(_M_IA64)
  66. #define Z7_WIN32_WINNT_MIN 0x0503 // win2003
  67. // #elif defined(_M_IX86) || defined(__i386__)
  68. // #define Z7_WIN32_WINNT_MIN 0x0500 // win2000
  69. #else // x86 and another(old) systems
  70. #define Z7_WIN32_WINNT_MIN 0x0500 // win2000
  71. // #define Z7_WIN32_WINNT_MIN 0x0502 // win2003 // for debug
  72. #endif
  73. #endif // Z7_WIN32_WINNT_MIN
  74. #ifndef Z7_DO_NOT_DEFINE_WIN32_WINNT
  75. #ifdef _WIN32_WINNT
  76. // #error Stop_Compiling_Bad_WIN32_WINNT
  77. #else
  78. #ifndef Z7_NO_DEFINE_WIN32_WINNT
  79. Z7_DIAGNOSTIC_IGNORE_BEGIN_RESERVED_MACRO_IDENTIFIER
  80. #define _WIN32_WINNT Z7_WIN32_WINNT_MIN
  81. Z7_DIAGNOSTIC_IGNORE_END_RESERVED_MACRO_IDENTIFIER
  82. #endif
  83. #endif // _WIN32_WINNT
  84. #ifndef WINVER
  85. #define WINVER _WIN32_WINNT
  86. #endif
  87. #endif // Z7_DO_NOT_DEFINE_WIN32_WINNT
  88. #ifndef _MBCS
  89. #ifndef Z7_NO_UNICODE
  90. // UNICODE and _UNICODE are used by <windows.h> and by 7-zip code.
  91. #ifndef UNICODE
  92. #define UNICODE 1
  93. #endif
  94. #ifndef _UNICODE
  95. Z7_DIAGNOSTIC_IGNORE_BEGIN_RESERVED_MACRO_IDENTIFIER
  96. #define _UNICODE 1
  97. Z7_DIAGNOSTIC_IGNORE_END_RESERVED_MACRO_IDENTIFIER
  98. #endif
  99. #endif // Z7_NO_UNICODE
  100. #endif // _MBCS
  101. #endif // _WINDOWS_
  102. // #include "7zWindows.h"
  103. #endif // _WIN32
  104. #endif