windows: delete redundant headers
`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
This commit is contained in:
parent
7e8fdad2d5
commit
03e7dff8ff
@ -169,7 +169,6 @@ int main(void) { ; return 0; }
|
|||||||
# define WIN32_LEAN_AND_MEAN
|
# define WIN32_LEAN_AND_MEAN
|
||||||
# endif
|
# endif
|
||||||
# include <winsock2.h>
|
# include <winsock2.h>
|
||||||
# include <windows.h>
|
|
||||||
#endif
|
#endif
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
@ -189,7 +188,6 @@ int main(void)
|
|||||||
# define WIN32_LEAN_AND_MEAN
|
# define WIN32_LEAN_AND_MEAN
|
||||||
# endif
|
# endif
|
||||||
# include <winsock2.h>
|
# include <winsock2.h>
|
||||||
# include <windows.h>
|
|
||||||
#endif
|
#endif
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
@ -208,7 +206,6 @@ int main(void)
|
|||||||
# define WIN32_LEAN_AND_MEAN
|
# define WIN32_LEAN_AND_MEAN
|
||||||
# endif
|
# endif
|
||||||
# include <winsock2.h>
|
# include <winsock2.h>
|
||||||
# include <windows.h>
|
|
||||||
#endif
|
#endif
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
@ -228,7 +225,6 @@ int main(void)
|
|||||||
# define WIN32_LEAN_AND_MEAN
|
# define WIN32_LEAN_AND_MEAN
|
||||||
# endif
|
# endif
|
||||||
# include <winsock2.h>
|
# include <winsock2.h>
|
||||||
# include <windows.h>
|
|
||||||
#endif
|
#endif
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
@ -304,7 +300,6 @@ int main(void)
|
|||||||
# define WIN32_LEAN_AND_MEAN
|
# define WIN32_LEAN_AND_MEAN
|
||||||
# endif
|
# endif
|
||||||
# include <winsock2.h>
|
# include <winsock2.h>
|
||||||
# include <windows.h>
|
|
||||||
#endif
|
#endif
|
||||||
/* includes start */
|
/* includes start */
|
||||||
#ifdef HAVE_SYS_TYPES_H
|
#ifdef HAVE_SYS_TYPES_H
|
||||||
|
|||||||
@ -589,7 +589,6 @@ AC_DEFUN([TYPE_SOCKADDR_STORAGE],
|
|||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#endif
|
#endif
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#include <windows.h>
|
|
||||||
#else
|
#else
|
||||||
#ifdef HAVE_SYS_TYPES_H
|
#ifdef HAVE_SYS_TYPES_H
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@ -625,7 +624,6 @@ AC_DEFUN([CURL_CHECK_FUNC_RECV], [
|
|||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#endif
|
#endif
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#include <windows.h>
|
|
||||||
#else
|
#else
|
||||||
$curl_includes_bsdsocket
|
$curl_includes_bsdsocket
|
||||||
#ifdef HAVE_SYS_TYPES_H
|
#ifdef HAVE_SYS_TYPES_H
|
||||||
@ -674,7 +672,6 @@ AC_DEFUN([CURL_CHECK_FUNC_SEND], [
|
|||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#endif
|
#endif
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#include <windows.h>
|
|
||||||
#else
|
#else
|
||||||
$curl_includes_bsdsocket
|
$curl_includes_bsdsocket
|
||||||
#ifdef HAVE_SYS_TYPES_H
|
#ifdef HAVE_SYS_TYPES_H
|
||||||
@ -719,7 +716,6 @@ AC_DEFUN([CURL_CHECK_MSG_NOSIGNAL], [
|
|||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#endif
|
#endif
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#include <windows.h>
|
|
||||||
#else
|
#else
|
||||||
#ifdef HAVE_SYS_TYPES_H
|
#ifdef HAVE_SYS_TYPES_H
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@ -762,7 +758,6 @@ AC_DEFUN([CURL_CHECK_STRUCT_TIMEVAL], [
|
|||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#endif
|
#endif
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#include <windows.h>
|
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_SYS_TYPES_H
|
#ifdef HAVE_SYS_TYPES_H
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@ -815,7 +810,6 @@ AC_DEFUN([TYPE_IN_ADDR_T], [
|
|||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#endif
|
#endif
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#include <windows.h>
|
|
||||||
#else
|
#else
|
||||||
#ifdef HAVE_SYS_TYPES_H
|
#ifdef HAVE_SYS_TYPES_H
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@ -855,7 +849,6 @@ AC_DEFUN([TYPE_IN_ADDR_T], [
|
|||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#endif
|
#endif
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#include <windows.h>
|
|
||||||
#else
|
#else
|
||||||
#ifdef HAVE_SYS_TYPES_H
|
#ifdef HAVE_SYS_TYPES_H
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@ -1134,7 +1127,6 @@ AC_DEFUN([CURL_CHECK_FUNC_SELECT], [
|
|||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#endif
|
#endif
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#include <windows.h>
|
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_SYS_TYPES_H
|
#ifdef HAVE_SYS_TYPES_H
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|||||||
@ -1125,7 +1125,6 @@ then
|
|||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#endif
|
#endif
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#include <windows.h>
|
|
||||||
#endif
|
#endif
|
||||||
]],[[
|
]],[[
|
||||||
gethostbyname("localhost");
|
gethostbyname("localhost");
|
||||||
|
|||||||
@ -32,8 +32,6 @@
|
|||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#include <ws2tcpip.h>
|
|
||||||
#include <windows.h>
|
|
||||||
#define close closesocket
|
#define close closesocket
|
||||||
#else
|
#else
|
||||||
#include <sys/types.h> /* socket types */
|
#include <sys/types.h> /* socket types */
|
||||||
|
|||||||
@ -91,11 +91,11 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#ifndef __CYGWIN__
|
#include <curl/curl.h>
|
||||||
#include <winsock2.h>
|
|
||||||
|
#ifdef _WIN32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
#include <curl/curl.h>
|
|
||||||
|
|
||||||
|
|
||||||
#define MAX_STRING 256
|
#define MAX_STRING 256
|
||||||
|
|||||||
@ -31,9 +31,6 @@ int Curl_inet_pton(int, const char *, void *);
|
|||||||
#ifdef HAVE_INET_PTON
|
#ifdef HAVE_INET_PTON
|
||||||
#ifdef HAVE_ARPA_INET_H
|
#ifdef HAVE_ARPA_INET_H
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#elif defined(USE_WINSOCK)
|
|
||||||
/* inet_pton() exists in Vista or later */
|
|
||||||
#include <ws2tcpip.h>
|
|
||||||
#endif
|
#endif
|
||||||
#define Curl_inet_pton(x,y,z) inet_pton(x,y,z)
|
#define Curl_inet_pton(x,y,z) inet_pton(x,y,z)
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -33,9 +33,6 @@
|
|||||||
* This is a socketpair() implementation for Windows.
|
* This is a socketpair() implementation for Windows.
|
||||||
*/
|
*/
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <winsock2.h>
|
|
||||||
#include <ws2tcpip.h>
|
|
||||||
#include <windows.h>
|
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
#else
|
#else
|
||||||
#ifdef HAVE_NETDB_H
|
#ifdef HAVE_NETDB_H
|
||||||
|
|||||||
@ -419,7 +419,6 @@ curl_includes_winsock2="\
|
|||||||
# define WIN32_LEAN_AND_MEAN
|
# define WIN32_LEAN_AND_MEAN
|
||||||
# endif
|
# endif
|
||||||
# include <winsock2.h>
|
# include <winsock2.h>
|
||||||
# include <windows.h>
|
|
||||||
#endif
|
#endif
|
||||||
/* includes end */"
|
/* includes end */"
|
||||||
CURL_CHECK_NATIVE_WINDOWS
|
CURL_CHECK_NATIVE_WINDOWS
|
||||||
@ -440,7 +439,6 @@ curl_includes_ws2tcpip="\
|
|||||||
# endif
|
# endif
|
||||||
# include <winsock2.h>
|
# include <winsock2.h>
|
||||||
# include <ws2tcpip.h>
|
# include <ws2tcpip.h>
|
||||||
# include <windows.h>
|
|
||||||
#endif
|
#endif
|
||||||
/* includes end */"
|
/* includes end */"
|
||||||
CURL_CHECK_NATIVE_WINDOWS
|
CURL_CHECK_NATIVE_WINDOWS
|
||||||
|
|||||||
@ -25,12 +25,6 @@
|
|||||||
|
|
||||||
#ifdef HAVE_INET_PTON
|
#ifdef HAVE_INET_PTON
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
#include <winsock2.h>
|
|
||||||
#include <ws2tcpip.h>
|
|
||||||
#include <windows.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_NETINET_IN_H
|
#ifdef HAVE_NETINET_IN_H
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user