From: Tim Kientzle Date: Mon, 25 Apr 2016 03:39:15 +0000 (-0700) Subject: Define NTDDI_VERSION on Windows, default to Windows Server 2003 instead of WinXP X-Git-Tag: v3.2.0~10^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8f8bf1f92a67cf1f21e467051d7e9277520e5c7f;p=thirdparty%2Flibarchive.git Define NTDDI_VERSION on Windows, default to Windows Server 2003 instead of WinXP --- diff --git a/CMakeLists.txt b/CMakeLists.txt index eedcd23e3..93df46652 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -216,22 +216,35 @@ ENDIF(ENABLE_TEST) IF(WIN32) IF(WINDOWS_VERSION STREQUAL "WIN8") + SET(NTDDI_VERSION 0x06020000) + SET(_WIN32_WINNT 0x0602) SET(WINVER 0x0602) ELSEIF(WINDOWS_VERSION STREQUAL "WIN7") + SET(NTDDI_VERSION 0x06010000) + SET(_WIN32_WINNT 0x0601) SET(WINVER 0x0601) ELSEIF(WINDOWS_VERSION STREQUAL "WS08") + SET(NTDDI_VERSION 0x06000100) + SET(_WIN32_WINNT 0x0600) SET(WINVER 0x0600) ELSEIF(WINDOWS_VERSION STREQUAL "VISTA") + SET(NTDDI_VERSION 0x06000000) + SET(_WIN32_WINNT 0x0600) SET(WINVER 0x0600) ELSEIF(WINDOWS_VERSION STREQUAL "WS03") + SET(NTDDI_VERSION 0x05020000) + SET(_WIN32_WINNT 0x0502) SET(WINVER 0x0502) ELSEIF(WINDOWS_VERSION STREQUAL "WINXP") + SET(NTDDI_VERSION 0x05010000) + SET(_WIN32_WINNT 0x0501) SET(WINVER 0x0501) ELSE(WINDOWS_VERSION STREQUAL "WIN8") - # The default is to use Windows 2000 API. - SET(WINVER 0x0500) + # Default to Windows Server 2003 API if we don't recognize the specifier + SET(NTDDI_VERSION 0x05020000) + SET(_WIN32_WINNT 0x0502) + SET(WINVER 0x0502) ENDIF(WINDOWS_VERSION STREQUAL "WIN8") - SET(_WIN32_WINNT ${WINVER}) ENDIF(WIN32) IF(MSVC) diff --git a/build/cmake/config.h.in b/build/cmake/config.h.in index 94fbb59f5..64f4d4df1 100644 --- a/build/cmake/config.h.in +++ b/build/cmake/config.h.in @@ -1171,7 +1171,11 @@ typedef uint64_t uintmax_t; /* Define for large files, on AIX-style hosts. */ #cmakedefine _LARGE_FILES ${_LARGE_FILES} -/* Define for Windows to use Windows 2000+ APIs. */ +/* Define to control Windows SDK version */ +#ifndef NTDDI_VERSION +#cmakedefine NTDDI_VERSION ${NTDDI_VERSION} +#endif // NTDDI_VERSION + #ifndef _WIN32_WINNT #cmakedefine _WIN32_WINNT ${_WIN32_WINNT} #endif // _WIN32_WINNT diff --git a/configure.ac b/configure.ac index d352991cb..851007d7a 100644 --- a/configure.ac +++ b/configure.ac @@ -243,8 +243,9 @@ AM_CONDITIONAL([STATIC_BSDCPIO], [ test "$static_bsdcpio" = yes ]) # Set up defines needed before including any headers case $host in *mingw* | *cygwin* ) - AC_DEFINE([_WIN32_WINNT], 0x0500, [Define to '0x0500' for Windows 2000 APIs.]) - AC_DEFINE([WINVER], 0x0500, [Define to '0x0500' for Windows 2000 APIs.]) + AC_DEFINE([_WIN32_WINNT], 0x0502, [Define to '0x0502' for Windows Server 2003 APIs.]) + AC_DEFINE([WINVER], 0x0502, [Define to '0x0502' for Windows Server 2003 APIs.]) + AC_DEFINE([NTDDI_VERSION], 0x05020000, [Define to '0x05020000' for Windows Server 2003 APIs.]) ;; esac