You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by wr...@apache.org on 2020/09/03 19:44:33 UTC

svn commit: r1881421 - in /apr/apr/trunk: CMakeLists.txt README.cmake include/apr.h.in include/apr.hw include/apr.hwc

Author: wrowe
Date: Thu Sep  3 19:44:33 2020
New Revision: 1881421

URL: http://svn.apache.org/viewvc?rev=1881421&view=rev
Log:
Clean up _WIN32_WINNT

 - Fix _WIN32_WINNT for Windows.h to provide all type declarations,
   function prototypes and others from Windows 10 / Windows Server 2019.
   NOTE: This has nothing whatsoever to do with which functions APR chooses
   to use, chooses to load a runtime (apr_arch_misc.h) or which minimum 
   version of Windows APR will require.

 - New in Windows 10/Server 2019 are case sensitive directory trees. The
   patch normalizes the case of the relevant Windows header file names
   in #include statements to the files shipping in the SDK's.

 - drops inaccurately mapped CMake flag MIN_WINDOWS_VER from apr 2.0 branch,
   which never not a feature toggle to APR itself.

 - drops winsock.h entirely. WINDOWS_WCE is ended entirely 2 years ago, and
   a later commit to trunk should remove WCE toggles throught the sources.


Modified:
    apr/apr/trunk/CMakeLists.txt
    apr/apr/trunk/README.cmake
    apr/apr/trunk/include/apr.h.in
    apr/apr/trunk/include/apr.hw
    apr/apr/trunk/include/apr.hwc

Modified: apr/apr/trunk/CMakeLists.txt
URL: http://svn.apache.org/viewvc/apr/apr/trunk/CMakeLists.txt?rev=1881421&r1=1881420&r2=1881421&view=diff
==============================================================================
--- apr/apr/trunk/CMakeLists.txt (original)
+++ apr/apr/trunk/CMakeLists.txt Thu Sep  3 19:44:33 2020
@@ -55,8 +55,6 @@ OPTION(APR_HAVE_IPV6        "IPv6 suppor
 OPTION(INSTALL_PDB          "Install .pdb files (if generated)"  ON)
 OPTION(APR_BUILD_TESTAPR    "Build the test suite"         OFF)
 OPTION(TEST_STATIC_LIBS     "Test programs use APR static libraries instead of shared libraries?" OFF)
-SET(MIN_WINDOWS_VER         "Windows7"
-    CACHE STRING "Minimum Windows version")
 SET(LIBXML2_ICONV_INCLUDE_DIR   ""
     CACHE STRING "Directory with iconv include files for libxml2")
 SET(LIBXML2_ICONV_LIBRARIES     ""
@@ -99,16 +97,6 @@ ELSE(APU_USE_XMLLITE)
   SET(apu_use_xmllite_10 1)
 ENDIF()
 
-IF("${MIN_WINDOWS_VER}" STREQUAL "")
-  SET(win32_winnt_str "0x0601")
-ELSEIF(${MIN_WINDOWS_VER} STREQUAL "Vista")
-  MESSAGE(FATAL_ERROR "Minimum supported Windows version is Windows 7/Windows Server 2008 R2")
-ELSEIF(${MIN_WINDOWS_VER} STREQUAL "Windows7")
-  SET(win32_winnt_str "0x0601")
-ELSE()
-  SET(win32_winnt_str ${MIN_WINDOWS_VER})
-ENDIF()
-
 CONFIGURE_FILE(include/apr.hwc
                ${PROJECT_BINARY_DIR}/apr.h)
 # "COPYONLY" just because anything else isn't implemented ;)
@@ -653,7 +641,6 @@ MESSAGE(STATUS "  DBD ODBC driver ......
 MESSAGE(STATUS "  Use Expat ....................... : ${APU_USE_EXPAT}")
 MESSAGE(STATUS "  Use LibXml2 ..................... : ${APU_USE_LIBXML2}")
 MESSAGE(STATUS "  Use XmlLite ..................... : ${APU_USE_XMLLITE}")
-MESSAGE(STATUS "  Minimum Windows version ......... : ${MIN_WINDOWS_VER}")
 MESSAGE(STATUS "  Library files for XML ........... : ${XMLLIB_LIBRARIES}")
 MESSAGE(STATUS "  Build test suite ................ : ${APR_BUILD_TESTAPR}")
 IF(TEST_STATIC_LIBS)

Modified: apr/apr/trunk/README.cmake
URL: http://svn.apache.org/viewvc/apr/apr/trunk/README.cmake?rev=1881421&r1=1881420&r2=1881421&view=diff
==============================================================================
--- apr/apr/trunk/README.cmake (original)
+++ apr/apr/trunk/README.cmake Thu Sep  3 19:44:33 2020
@@ -95,15 +95,6 @@ How to build
                               static and dynamic libraries, separate builds
                               will be required, one with TEST_STATIC_LIBS
                               set to ON.
-       MIN_WINDOWS_VER        Minimum Windows version supported by this build
-                              (This controls the setting of _WIN32_WINNT.)
-                              "Vista" or "Windows7" or a numeric value like
-                              "0x0601"
-                              Default: "Vista"
-                              For desktop/server equivalence or other values,
-                              refer to
-                              http://msdn.microsoft.com/en-us/library/windows/
-                              desktop/aa383745(v=vs.85).aspx
        INSTALL_PDB            Install .pdb files if generated.
                               Default: ON
 

Modified: apr/apr/trunk/include/apr.h.in
URL: http://svn.apache.org/viewvc/apr/apr/trunk/include/apr.h.in?rev=1881421&r1=1881420&r2=1881421&view=diff
==============================================================================
--- apr/apr/trunk/include/apr.h.in (original)
+++ apr/apr/trunk/include/apr.h.in Thu Sep  3 19:44:33 2020
@@ -122,19 +122,21 @@
  */
 
 #if APR_HAVE_WINDOWS_H && defined(WIN32)
-/* If windows.h was already included, our preferences don't matter.
- * If not, include a restricted set of windows headers to our tastes.
+/* Has Windows.h already been included?  If so, our preferences don't matter,
+ * but we will still need the winsock things no matter what was included.
+ * If not, include a restricted set of Windows headers to our tastes.
+ * Note: _WIN32_WINNT is not an APR toggle, and should be set to the current API
+ * level; it is not a minimum, it is a maximum. Newly added functions to Win32
+ * are maintained in apr_arch_misc.h for runtime (not build time) determination.
  */
 #ifndef _WINDOWS_
 
 #ifndef WIN32_LEAN_AND_MEAN
 #define WIN32_LEAN_AND_MEAN
 #endif
-
 #ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x0501
+#define _WIN32_WINNT 0x0A00
 #endif
-
 #ifndef NOUSER
 #define NOUSER
 #endif
@@ -145,32 +147,26 @@
 #define NOIME
 #endif
 
-/* Impossible to include winsock2.h after winsock.h, while windows.h
+/* Impossible to include WinSock2.h after winsock.h, while Windows.h
  * attempts to load winsock.  Setting _WINSOCKAPI_ will dodge this.
  */
 #if APR_HAVE_WINSOCK2_H
 #define _WINSOCKAPI_
 #endif
 
-#include <windows.h>
+#include <Windows.h>
 #endif /* ndef _WINDOWS_ */
 #endif /* APR_HAVE_WINDOWS_H */
 
 #if APR_HAVE_WINSOCK2_H
-#include <winsock2.h>
+#include <WinSock2.h>
 
 #if APR_HAVE_WS2TCPIP_H
-#include <ws2tcpip.h>
+#include <WS2tcpip.h>
 #endif
 
 #if APR_HAVE_MSWSOCK_H
-#include <mswsock.h>
-#endif
-
-#else /* !APR_HAVE_WINSOCK2_H */
-
-#if APR_HAVE_WINSOCK_H
-#include <winsock.h>
+#include <MSWSock.h>
 #endif
 
 #endif /* !APR_HAVE_WINSOCK2_H */

Modified: apr/apr/trunk/include/apr.hw
URL: http://svn.apache.org/viewvc/apr/apr/trunk/include/apr.hw?rev=1881421&r1=1881420&r2=1881421&view=diff
==============================================================================
--- apr/apr/trunk/include/apr.hw (original)
+++ apr/apr/trunk/include/apr.hw Thu Sep  3 19:44:33 2020
@@ -180,8 +180,12 @@
  * or the extern "C" namespace
  */
 
-/* If windows.h was already included, our preferences don't matter.
- * If not, include a restricted set of windows headers to our tastes.
+/* Has Windows.h already been included?  If so, our preferences don't matter,
+ * but we will still need the winsock things no matter what was included.
+ * If not, include a restricted set of Windows headers to our tastes.
+ * Note: _WIN32_WINNT is not an APR toggle, and should be set to the current API
+ * level; it is not a minimum, it is a maximum. Newly added functions to Win32
+ * are maintained in apr_arch_misc.h for runtime (not build time) determination.
  */
 #if APR_HAVE_WINDOWS_H
 #ifndef _WINDOWS_
@@ -189,11 +193,9 @@
 #ifndef WIN32_LEAN_AND_MEAN
 #define WIN32_LEAN_AND_MEAN
 #endif
-
 #ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x0601
+#define _WIN32_WINNT 0x0A00
 #endif
-
 #ifndef NOUSER
 #define NOUSER
 #endif
@@ -204,32 +206,26 @@
 #define NOIME
 #endif
 
-/* Impossible to include winsock2.h after winsock.h, while windows.h
+/* Impossible to include WinSock2.h after winsock.h, while Windows.h
  * attempts to load winsock.  Setting _WINSOCKAPI_ will dodge this.
  */
 #if APR_HAVE_WINSOCK2_H
 #define _WINSOCKAPI_
 #endif
 
-#include <windows.h>
-#endif
-#endif
+#include <Windows.h>
+#endif /* ndef _WINDOWS_ */
+#endif /* APR_HAVE_WINDOWS_H */
 
 #if APR_HAVE_WINSOCK2_H
-#include <winsock2.h>
+#include <WinSock2.h>
 
 #if APR_HAVE_WS2TCPIP_H
-#include <ws2tcpip.h>
+#include <WS2tcpip.h>
 #endif
 
 #if APR_HAVE_MSWSOCK_H
-#include <mswsock.h>
-#endif
-
-#else /* !APR_HAVE_WINSOCK2_H */
-
-#if APR_HAVE_WINSOCK_H
-#include <winsock.h>
+#include <MSWSock.h>
 #endif
 
 #endif /* !APR_HAVE_WINSOCK2_H */

Modified: apr/apr/trunk/include/apr.hwc
URL: http://svn.apache.org/viewvc/apr/apr/trunk/include/apr.hwc?rev=1881421&r1=1881420&r2=1881421&view=diff
==============================================================================
--- apr/apr/trunk/include/apr.hwc (original)
+++ apr/apr/trunk/include/apr.hwc Thu Sep  3 19:44:33 2020
@@ -180,8 +180,12 @@
  * or the extern "C" namespace
  */
 
-/* If windows.h was already included, our preferences don't matter.
- * If not, include a restricted set of windows headers to our tastes.
+/* Has Windows.h already been included?  If so, our preferences don't matter,
+ * but we will still need the winsock things no matter what was included.
+ * If not, include a restricted set of Windows headers to our tastes.
+ * Note: _WIN32_WINNT is not an APR toggle, and should be set to the current API
+ * level; it is not a minimum, it is a maximum. Newly added functions to Win32
+ * are maintained in apr_arch_misc.h for runtime (not build time) determination.
  */
 #if APR_HAVE_WINDOWS_H
 #ifndef _WINDOWS_
@@ -189,11 +193,9 @@
 #ifndef WIN32_LEAN_AND_MEAN
 #define WIN32_LEAN_AND_MEAN
 #endif
-
 #ifndef _WIN32_WINNT
-#define _WIN32_WINNT @win32_winnt_str@
+#define _WIN32_WINNT 0x0A00
 #endif
-
 #ifndef NOUSER
 #define NOUSER
 #endif
@@ -204,32 +206,26 @@
 #define NOIME
 #endif
 
-/* Impossible to include winsock2.h after winsock.h, while windows.h
+/* Impossible to include WinSock2.h after winsock.h, while Windows.h
  * attempts to load winsock.  Setting _WINSOCKAPI_ will dodge this.
  */
 #if APR_HAVE_WINSOCK2_H
 #define _WINSOCKAPI_
 #endif
 
-#include <windows.h>
-#endif
-#endif
+#include <Windows.h>
+#endif /* ndef _WINDOWS_ */
+#endif /* APR_HAVE_WINDOWS_H */
 
 #if APR_HAVE_WINSOCK2_H
-#include <winsock2.h>
+#include <WinSock2.h>
 
 #if APR_HAVE_WS2TCPIP_H
-#include <ws2tcpip.h>
+#include <WS2tcpip.h>
 #endif
 
 #if APR_HAVE_MSWSOCK_H
-#include <mswsock.h>
-#endif
-
-#else /* !APR_HAVE_WINSOCK2_H */
-
-#if APR_HAVE_WINSOCK_H
-#include <winsock.h>
+#include <MSWSock.h>
 #endif
 
 #endif /* !APR_HAVE_WINSOCK2_H */