aboutsummaryrefslogtreecommitdiff
path: root/lib/curl_setup.h
diff options
context:
space:
mode:
authorJay Satiro <raysatiro@yahoo.com>2020-03-07 03:21:33 -0500
committerJay Satiro <raysatiro@yahoo.com>2020-03-21 17:42:44 -0400
commitd820224b8b3621c312bd85e0951f470eab6df66a (patch)
treec96ae75ec3754a71c5a277c9fef85b5baaacdc1e /lib/curl_setup.h
parentf25f602ffd026cc6b5bb0b3a6d8f1abe1bad7881 (diff)
curl_setup: define _WIN32_WINNT_[OS] symbols
.. because not all Windows build systems have those symbols, and even those that do may be missing newer symbols (eg the Windows 7 SDK does not define _WIN32_WINNT_WIN10). Those symbols are used in build-time logic to decide which API to use and prior to this change if the symbols were missing it would have resulted in deprecated API being used when more recent functions were available (eg GetVersionEx used instead of VerifyVersionInfo). Reported-by: FuccDucc@users.noreply.github.com Probably fixes https://github.com/curl/curl/issues/4995 Closes https://github.com/curl/curl/pull/5057
Diffstat (limited to 'lib/curl_setup.h')
-rw-r--r--lib/curl_setup.h58
1 files changed, 7 insertions, 51 deletions
diff --git a/lib/curl_setup.h b/lib/curl_setup.h
index 4ecda6a9b..5d72403a0 100644
--- a/lib/curl_setup.h
+++ b/lib/curl_setup.h
@@ -231,64 +231,20 @@
#endif
/*
- * Use getaddrinfo to resolve the IPv4 address literal. If the current network
- * interface doesn't support IPv4, but supports IPv6, NAT64, and DNS64,
- * performing this task will result in a synthesized IPv6 address.
- */
-#ifdef __APPLE__
-#define USE_RESOLVE_ON_IPS 1
-#endif
-
-/*
- * Include header files for windows builds before redefining anything.
- * Use this preprocessor block only to include or exclude windows.h,
- * winsock2.h, ws2tcpip.h or winsock.h. Any other windows thing belongs
- * to any other further and independent block. Under Cygwin things work
- * just as under linux (e.g. <sys/socket.h>) and the winsock headers should
- * never be included when __CYGWIN__ is defined. configure script takes
- * care of this, not defining HAVE_WINDOWS_H, HAVE_WINSOCK_H, HAVE_WINSOCK2_H,
- * neither HAVE_WS2TCPIP_H when __CYGWIN__ is defined.
+ * Windows setup file includes some system headers.
*/
#ifdef HAVE_WINDOWS_H
-# if defined(UNICODE) && !defined(_UNICODE)
-# define _UNICODE
-# endif
-# if defined(_UNICODE) && !defined(UNICODE)
-# define UNICODE
-# endif
-# include <winerror.h>
-# include <windows.h>
-# ifdef HAVE_WINSOCK2_H
-# include <winsock2.h>
-# ifdef HAVE_WS2TCPIP_H
-# include <ws2tcpip.h>
-# endif
-# else
-# ifdef HAVE_WINSOCK_H
-# include <winsock.h>
-# endif
-# endif
-# include <tchar.h>
-# ifdef UNICODE
- typedef wchar_t *(*curl_wcsdup_callback)(const wchar_t *str);
-# endif
+# include "setup-win32.h"
#endif
/*
- * Define USE_WINSOCK to 2 if we have and use WINSOCK2 API, else
- * define USE_WINSOCK to 1 if we have and use WINSOCK API, else
- * undefine USE_WINSOCK.
+ * Use getaddrinfo to resolve the IPv4 address literal. If the current network
+ * interface doesn't support IPv4, but supports IPv6, NAT64, and DNS64,
+ * performing this task will result in a synthesized IPv6 address.
*/
-
-#undef USE_WINSOCK
-
-#ifdef HAVE_WINSOCK2_H
-# define USE_WINSOCK 2
-#else
-# ifdef HAVE_WINSOCK_H
-# define USE_WINSOCK 1
-# endif
+#ifdef __APPLE__
+#define USE_RESOLVE_ON_IPS 1
#endif
#ifdef USE_LWIPSOCK