]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
build: require Windows XP or newer
authorViktor Szakats <commit@vsz.me>
Sat, 28 Oct 2023 10:52:23 +0000 (10:52 +0000)
committerViktor Szakats <commit@vsz.me>
Mon, 30 Oct 2023 10:46:40 +0000 (10:46 +0000)
After this patch we assume availability of `getaddrinfo` and
`freeaddrinfo`, first introduced in Windows XP. Meaning curl
now requires building for Windows XP as a minimum.

TODO: assume these also in autotools.

Ref: https://github.com/curl/curl/pull/12221#issuecomment-1783761806
Closes #12225

CMake/Platforms/WindowsCache.cmake
CMakeLists.txt
docs/INSTALL.md
lib/config-win32.h

index c6610d0a8c50677e398b5680c8c2a88c8521f35e..e4525300c414fab65aa43421e7e4fcb62d8f5030 100644 (file)
@@ -82,6 +82,10 @@ else()
   endif()
 endif()
 
+# Available in Windows XP and newer
+set(HAVE_GETADDRINFO 1)
+set(HAVE_FREEADDRINFO 1)
+
 set(HAVE_FCHMOD 0)
 set(HAVE_SOCKETPAIR 0)
 set(HAVE_SENDMSG 0)
index 0654aee8712626eac2d617466522c772584da06f..3786c56622c46ac252773195a39754c304e12c60 100644 (file)
@@ -1087,26 +1087,24 @@ if(WIN32)
   # avoid storing HAVE_WIN32_WINNT in CMake cache
   unset(HAVE_WIN32_WINNT CACHE)
 
-  # pre-fill detection results that are based on target OS version
-  if(HAVE_WIN32_WINNT AND (MINGW OR MSVC))
+  if(HAVE_WIN32_WINNT)
     if(HAVE_WIN32_WINNT STRLESS "0x0501")
-      set(HAVE_GETADDRINFO 0)
-      set(HAVE_FREEADDRINFO 0)
-    else()  # Windows XP or newer
-      set(HAVE_GETADDRINFO 1)
-      set(HAVE_FREEADDRINFO 1)
+      # Windows XP is required for freeaddrinfo, getaddrinfo
+      message(FATAL_ERROR "Building for Windows XP or newer is required.")
     endif()
-    unset(HAVE_GETADDRINFO CACHE)
-    unset(HAVE_FREEADDRINFO CACHE)
-    if(HAVE_WIN32_WINNT STRLESS "0x0600")
-      set(HAVE_INET_NTOP 0)
-      set(HAVE_INET_PTON 0)
-    else()  # Windows Vista or newer
-      set(HAVE_INET_NTOP 1)
-      set(HAVE_INET_PTON 1)
+
+    # pre-fill detection results based on target OS version
+    if(MINGW OR MSVC)
+      if(HAVE_WIN32_WINNT STRLESS "0x0600")
+        set(HAVE_INET_NTOP 0)
+        set(HAVE_INET_PTON 0)
+      else()  # Windows Vista or newer
+        set(HAVE_INET_NTOP 1)
+        set(HAVE_INET_PTON 1)
+      endif()
+      unset(HAVE_INET_NTOP CACHE)
+      unset(HAVE_INET_PTON CACHE)
     endif()
-    unset(HAVE_INET_NTOP CACHE)
-    unset(HAVE_INET_PTON CACHE)
   endif()
 endif()
 
index 8c38aa9bb6a498ae63400c3f2dc9f7b60d36b3aa..6bbd1cbabb8c3a8d60ffd1323d2fc65326a1956e 100644 (file)
@@ -162,6 +162,8 @@ library check.
 
 # Windows
 
+Building for Windows XP is required as a minimum.
+
 ## Building Windows DLLs and C runtime (CRT) linkage issues
 
  As a general rule, building a DLL with static CRT linkage is highly
index 6d110eb7685aa161c8bf56c97653daf22880720e..aa0d751338d58c119e83805f4aa24ae9dc4d3bd8 100644 (file)
 #  undef RECV_TYPE_ARG3
 #  undef SEND_TYPE_ARG1
 #  undef SEND_TYPE_ARG3
-#  define HAVE_FREEADDRINFO
-#  define HAVE_GETADDRINFO
 #  define HAVE_GETHOSTBYNAME_R
 #  define HAVE_GETHOSTBYNAME_R_6
 #  define LWIP_POSIX_SOCKETS_IO_NAMES 0
   #undef USE_WINSOCK
   #undef HAVE_WINSOCK2_H
   #undef HAVE_WS2TCPIP_H
-  #define HAVE_GETADDRINFO
   #define HAVE_SYS_IOCTL_H
   #define HAVE_SYS_SOCKET_H
   #define HAVE_NETINET_IN_H
   #define HAVE_NETDB_H
   #define HAVE_ARPA_INET_H
-  #define HAVE_FREEADDRINFO
   #define SOCKET int
 #endif
 
@@ -473,24 +469,10 @@ Vista
 #  endif
 #endif
 
-/* Availability of freeaddrinfo, getaddrinfo, and if_nametoindex
-   functions is quite convoluted, compiler dependent and even build target
-   dependent. */
-#if defined(HAVE_WS2TCPIP_H)
-#  if defined(__POCC__)
-#    define HAVE_FREEADDRINFO           1
-#    define HAVE_GETADDRINFO            1
-#    define HAVE_GETADDRINFO_THREADSAFE 1
-#  elif defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0501)
-#    define HAVE_FREEADDRINFO           1
-#    define HAVE_GETADDRINFO            1
-#    define HAVE_GETADDRINFO_THREADSAFE 1
-#  elif defined(_MSC_VER) && (_MSC_VER >= 1200)
-#    define HAVE_FREEADDRINFO           1
-#    define HAVE_GETADDRINFO            1
-#    define HAVE_GETADDRINFO_THREADSAFE 1
-#  endif
-#endif
+/* Windows XP is required for freeaddrinfo, getaddrinfo */
+#define HAVE_FREEADDRINFO           1
+#define HAVE_GETADDRINFO            1
+#define HAVE_GETADDRINFO_THREADSAFE 1
 
 #if defined(__POCC__)
 #  ifndef _MSC_VER