`winsock2.h` pulls in `windows.h`. `ws2tcpip.h` pulls in `winsock2.h`.
`winsock2.h` and `ws2tcpip.h` are also pulled by `curl/curl.h`.
Keep only those headers that are not already included, or the code under
it uses something from that specific header.
Closes #12539
# define WIN32_LEAN_AND_MEAN
# endif
# include <winsock2.h>
-# include <windows.h>
#endif
int main(void)
{
# define WIN32_LEAN_AND_MEAN
# endif
# include <winsock2.h>
-# include <windows.h>
#endif
int main(void)
{
# define WIN32_LEAN_AND_MEAN
# endif
# include <winsock2.h>
-# include <windows.h>
#endif
int main(void)
{
# define WIN32_LEAN_AND_MEAN
# endif
# include <winsock2.h>
-# include <windows.h>
#endif
int main(void)
{
# define WIN32_LEAN_AND_MEAN
# endif
# include <winsock2.h>
-# include <windows.h>
#endif
/* includes start */
#ifdef HAVE_SYS_TYPES_H
#define WIN32_LEAN_AND_MEAN
#endif
#include <winsock2.h>
-#include <windows.h>
#else
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#define WIN32_LEAN_AND_MEAN
#endif
#include <winsock2.h>
-#include <windows.h>
#else
$curl_includes_bsdsocket
#ifdef HAVE_SYS_TYPES_H
#define WIN32_LEAN_AND_MEAN
#endif
#include <winsock2.h>
-#include <windows.h>
#else
$curl_includes_bsdsocket
#ifdef HAVE_SYS_TYPES_H
#define WIN32_LEAN_AND_MEAN
#endif
#include <winsock2.h>
-#include <windows.h>
#else
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#define WIN32_LEAN_AND_MEAN
#endif
#include <winsock2.h>
-#include <windows.h>
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#define WIN32_LEAN_AND_MEAN
#endif
#include <winsock2.h>
-#include <windows.h>
#else
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#define WIN32_LEAN_AND_MEAN
#endif
#include <winsock2.h>
-#include <windows.h>
#else
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#define WIN32_LEAN_AND_MEAN
#endif
#include <winsock2.h>
-#include <windows.h>
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#define WIN32_LEAN_AND_MEAN
#endif
#include <winsock2.h>
-#include <windows.h>
#endif
]],[[
gethostbyname("localhost");
#ifdef _WIN32
#include <winsock2.h>
-#include <ws2tcpip.h>
-#include <windows.h>
#define close closesocket
#else
#include <sys/types.h> /* socket types */
#include <stdio.h>
#include <time.h>
-#ifndef __CYGWIN__
-#include <winsock2.h>
+#include <curl/curl.h>
+
+#ifdef _WIN32
#include <windows.h>
#endif
-#include <curl/curl.h>
#define MAX_STRING 256
#ifdef HAVE_INET_PTON
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
-#elif defined(USE_WINSOCK)
-/* inet_pton() exists in Vista or later */
-#include <ws2tcpip.h>
#endif
#define Curl_inet_pton(x,y,z) inet_pton(x,y,z)
#endif
* This is a socketpair() implementation for Windows.
*/
#include <string.h>
-#include <winsock2.h>
-#include <ws2tcpip.h>
-#include <windows.h>
#include <io.h>
#else
#ifdef HAVE_NETDB_H
# define WIN32_LEAN_AND_MEAN
# endif
# include <winsock2.h>
-# include <windows.h>
#endif
/* includes end */"
CURL_CHECK_NATIVE_WINDOWS
# endif
# include <winsock2.h>
# include <ws2tcpip.h>
-# include <windows.h>
#endif
/* includes end */"
CURL_CHECK_NATIVE_WINDOWS
#ifdef HAVE_INET_PTON
-#ifdef _WIN32
-#include <winsock2.h>
-#include <ws2tcpip.h>
-#include <windows.h>
-#endif
-
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif