From a0b207164c6c943adb8b3bf89b375a491b41806a Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Fri, 14 Dec 2012 17:38:18 +0100 Subject: [PATCH] setup_once.h: refactor inclusion of and Inclusion of top two most included header files now done in setup_once.h --- lib/asyn-ares.c | 6 ------ lib/asyn-thread.c | 6 ------ lib/axtls.c | 4 ---- lib/connect.c | 6 ------ lib/curl_addrinfo.c | 5 +---- lib/curl_addrinfo.h | 5 +---- lib/curl_darwinssl.c | 3 --- lib/curl_gethostname.c | 6 +----- lib/curl_ntlm_wb.c | 5 +---- lib/cyassl.c | 4 ---- lib/dict.c | 6 ------ lib/easy.c | 6 ------ lib/file.c | 6 ------ lib/ftp.c | 7 ------- lib/gtls.c | 5 +---- lib/hostasyn.c | 8 +------- lib/hostip.c | 6 ------ lib/hostip4.c | 6 ------ lib/hostip6.c | 8 +------- lib/hostsyn.c | 8 +------- lib/http.c | 6 ------ lib/http_proxy.c | 4 ---- lib/if2ip.c | 8 +------- lib/if2ip.h | 6 +++--- lib/imap.c | 7 ------- lib/inet_ntop.c | 3 --- lib/inet_pton.c | 3 --- lib/krb4.c | 4 ---- lib/ldap.c | 6 +----- lib/memdebug.c | 11 ++--------- lib/memdebug.h | 6 +----- lib/multi.c | 7 ------- lib/netrc.c | 3 --- lib/nonblock.c | 6 ------ lib/nss.c | 4 ---- lib/polarssl.c | 4 ---- lib/pop3.c | 7 ------- lib/security.c | 4 ---- lib/sendf.c | 11 ++--------- lib/setup_once.h | 8 ++++++++ lib/smtp.c | 7 ------- lib/socks.c | 5 +---- lib/ssh.c | 7 ------- lib/sslgen.c | 4 ---- lib/ssluse.c | 3 --- lib/telnet.c | 6 ------ lib/tftp.c | 6 ------ lib/transfer.c | 6 ------ lib/url.c | 6 ------ lib/warnless.c | 3 --- src/tool_cb_rea.c | 4 ---- src/tool_cb_see.c | 4 ---- src/tool_dirhie.c | 4 ---- src/tool_getpass.c | 4 ---- src/tool_homedir.c | 3 --- src/tool_main.c | 4 ---- src/tool_metalink.c | 4 ---- src/tool_operate.c | 4 ---- src/tool_sleep.c | 4 ---- tests/libtest/lib1502.c | 7 ------- tests/libtest/lib505.c | 9 +-------- tests/libtest/test.h | 10 ---------- tests/server/fake_ntlm.c | 4 ---- tests/server/resolve.c | 9 --------- tests/server/rtspd.c | 6 ------ tests/server/sockfilt.c | 6 ------ tests/server/sws.c | 6 ------ tests/server/tftpd.c | 7 +------ tests/server/util.c | 6 ------ 69 files changed, 29 insertions(+), 363 deletions(-) diff --git a/lib/asyn-ares.c b/lib/asyn-ares.c index ee8050a..44d00bd 100644 --- a/lib/asyn-ares.c +++ b/lib/asyn-ares.c @@ -25,9 +25,6 @@ #ifdef HAVE_LIMITS_H #include #endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif #ifdef HAVE_NETINET_IN_H #include #endif @@ -37,9 +34,6 @@ #ifdef HAVE_ARPA_INET_H #include #endif -#ifdef HAVE_UNISTD_H -#include /* for the close() proto */ -#endif #ifdef __VMS #include #include diff --git a/lib/asyn-thread.c b/lib/asyn-thread.c index b027144..0d29d58 100644 --- a/lib/asyn-thread.c +++ b/lib/asyn-thread.c @@ -22,9 +22,6 @@ #include "setup.h" -#ifdef HAVE_SYS_SOCKET_H -#include -#endif #ifdef HAVE_NETINET_IN_H #include #endif @@ -34,9 +31,6 @@ #ifdef HAVE_ARPA_INET_H #include #endif -#ifdef HAVE_UNISTD_H -#include /* for the close() proto */ -#endif #ifdef __VMS #include #include diff --git a/lib/axtls.c b/lib/axtls.c index ea94c6c..19ed730 100644 --- a/lib/axtls.c +++ b/lib/axtls.c @@ -32,10 +32,6 @@ #include #include "axtls.h" -#ifdef HAVE_SYS_SOCKET_H -#include -#endif - #include "sendf.h" #include "inet_pton.h" #include "sslgen.h" diff --git a/lib/connect.c b/lib/connect.c index f615d81..19f5b2f 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -22,9 +22,6 @@ #include "setup.h" -#ifdef HAVE_SYS_SOCKET_H -#include -#endif #ifdef HAVE_NETINET_IN_H #include /* may need it */ #endif @@ -37,9 +34,6 @@ #ifdef HAVE_SYS_IOCTL_H #include #endif -#ifdef HAVE_UNISTD_H -#include -#endif #ifdef HAVE_NETDB_H #include #endif diff --git a/lib/curl_addrinfo.c b/lib/curl_addrinfo.c index bae403f..815b4ae 100644 --- a/lib/curl_addrinfo.c +++ b/lib/curl_addrinfo.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2011, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -24,9 +24,6 @@ #include -#ifdef HAVE_SYS_SOCKET_H -# include -#endif #ifdef HAVE_NETINET_IN_H # include #endif diff --git a/lib/curl_addrinfo.h b/lib/curl_addrinfo.h index 11c3394..a5375cb 100644 --- a/lib/curl_addrinfo.h +++ b/lib/curl_addrinfo.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2010, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -24,9 +24,6 @@ #include "setup.h" -#ifdef HAVE_SYS_SOCKET_H -# include -#endif #ifdef HAVE_NETINET_IN_H # include #endif diff --git a/lib/curl_darwinssl.c b/lib/curl_darwinssl.c index 3cc278a..8ea190a 100644 --- a/lib/curl_darwinssl.c +++ b/lib/curl_darwinssl.c @@ -33,9 +33,6 @@ #ifdef HAVE_LIMITS_H #include #endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif #include #include diff --git a/lib/curl_gethostname.c b/lib/curl_gethostname.c index aafa45b..ddee4ba 100644 --- a/lib/curl_gethostname.c +++ b/lib/curl_gethostname.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2010, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -22,10 +22,6 @@ #include "setup.h" -#ifdef HAVE_UNISTD_H -# include -#endif - #include "curl_gethostname.h" /* diff --git a/lib/curl_ntlm_wb.c b/lib/curl_ntlm_wb.c index 18d0d13..46a51c2 100644 --- a/lib/curl_ntlm_wb.c +++ b/lib/curl_ntlm_wb.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2011, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -33,9 +33,6 @@ #define DEBUG_ME 0 -#ifdef HAVE_UNISTD_H -#include -#endif #ifdef HAVE_SYS_WAIT_H #include #endif diff --git a/lib/cyassl.c b/lib/cyassl.c index 3639532..13c0d13 100644 --- a/lib/cyassl.c +++ b/lib/cyassl.c @@ -34,10 +34,6 @@ #include #endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif - #include "urldata.h" #include "sendf.h" #include "inet_pton.h" diff --git a/lib/dict.c b/lib/dict.c index beebf4a..ca5c362 100644 --- a/lib/dict.c +++ b/lib/dict.c @@ -24,15 +24,9 @@ #ifndef CURL_DISABLE_DICT -#ifdef HAVE_SYS_SOCKET_H -#include -#endif #ifdef HAVE_NETINET_IN_H #include #endif -#ifdef HAVE_UNISTD_H -#include -#endif #ifdef HAVE_NETDB_H #include #endif diff --git a/lib/easy.c b/lib/easy.c index 100d003..b73bf66 100644 --- a/lib/easy.c +++ b/lib/easy.c @@ -22,15 +22,9 @@ #include "setup.h" -#ifdef HAVE_SYS_SOCKET_H -#include -#endif #ifdef HAVE_NETINET_IN_H #include #endif -#ifdef HAVE_UNISTD_H -#include -#endif #ifdef HAVE_NETDB_H #include #endif diff --git a/lib/file.c b/lib/file.c index ebb0866..886a09e 100644 --- a/lib/file.c +++ b/lib/file.c @@ -24,15 +24,9 @@ #ifndef CURL_DISABLE_FILE -#ifdef HAVE_SYS_SOCKET_H -#include -#endif #ifdef HAVE_NETINET_IN_H #include #endif -#ifdef HAVE_UNISTD_H -#include -#endif #ifdef HAVE_NETDB_H #include #endif diff --git a/lib/ftp.c b/lib/ftp.c index 8fd29b4..dc24d0b 100644 --- a/lib/ftp.c +++ b/lib/ftp.c @@ -24,13 +24,6 @@ #ifndef CURL_DISABLE_FTP -#ifdef HAVE_UNISTD_H -#include -#endif - -#ifdef HAVE_SYS_SOCKET_H -#include -#endif #ifdef HAVE_NETINET_IN_H #include #endif diff --git a/lib/gtls.c b/lib/gtls.c index 2920ee2..8c2a4a0 100644 --- a/lib/gtls.c +++ b/lib/gtls.c @@ -34,6 +34,7 @@ #include #include + #ifdef USE_GNUTLS_NETTLE #include #include @@ -41,10 +42,6 @@ #include #endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif - #include "urldata.h" #include "sendf.h" #include "inet_pton.h" diff --git a/lib/hostasyn.c b/lib/hostasyn.c index 771562f..93e2c31 100644 --- a/lib/hostasyn.c +++ b/lib/hostasyn.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2011, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -22,9 +22,6 @@ #include "setup.h" -#ifdef HAVE_SYS_SOCKET_H -#include -#endif #ifdef HAVE_NETINET_IN_H #include #endif @@ -34,9 +31,6 @@ #ifdef HAVE_ARPA_INET_H #include #endif -#ifdef HAVE_UNISTD_H -#include /* for the close() proto */ -#endif #ifdef __VMS #include #include diff --git a/lib/hostip.c b/lib/hostip.c index ef14ce8..2bfb74b 100644 --- a/lib/hostip.c +++ b/lib/hostip.c @@ -22,9 +22,6 @@ #include "setup.h" -#ifdef HAVE_SYS_SOCKET_H -#include -#endif #ifdef HAVE_NETINET_IN_H #include #endif @@ -34,9 +31,6 @@ #ifdef HAVE_ARPA_INET_H #include #endif -#ifdef HAVE_UNISTD_H -#include /* for the close() proto */ -#endif #ifdef __VMS #include #include diff --git a/lib/hostip4.c b/lib/hostip4.c index f68618c..3babe72 100644 --- a/lib/hostip4.c +++ b/lib/hostip4.c @@ -22,9 +22,6 @@ #include "setup.h" -#ifdef HAVE_SYS_SOCKET_H -#include -#endif #ifdef HAVE_NETINET_IN_H #include #endif @@ -34,9 +31,6 @@ #ifdef HAVE_ARPA_INET_H #include #endif -#ifdef HAVE_UNISTD_H -#include /* for the close() proto */ -#endif #ifdef __VMS #include #include diff --git a/lib/hostip6.c b/lib/hostip6.c index 8241cb4..5b25d6f 100644 --- a/lib/hostip6.c +++ b/lib/hostip6.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2011, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -22,9 +22,6 @@ #include "setup.h" -#ifdef HAVE_SYS_SOCKET_H -#include -#endif #ifdef HAVE_NETINET_IN_H #include #endif @@ -34,9 +31,6 @@ #ifdef HAVE_ARPA_INET_H #include #endif -#ifdef HAVE_UNISTD_H -#include /* for the close() proto */ -#endif #ifdef __VMS #include #include diff --git a/lib/hostsyn.c b/lib/hostsyn.c index d1a9079..eff2efa 100644 --- a/lib/hostsyn.c +++ b/lib/hostsyn.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2011, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -22,9 +22,6 @@ #include "setup.h" -#ifdef HAVE_SYS_SOCKET_H -#include -#endif #ifdef HAVE_NETINET_IN_H #include #endif @@ -34,9 +31,6 @@ #ifdef HAVE_ARPA_INET_H #include #endif -#ifdef HAVE_UNISTD_H -#include /* for the close() proto */ -#endif #ifdef __VMS #include #include diff --git a/lib/http.c b/lib/http.c index 0b6d7d4..0013e50 100644 --- a/lib/http.c +++ b/lib/http.c @@ -24,16 +24,10 @@ #ifndef CURL_DISABLE_HTTP -#ifdef HAVE_SYS_SOCKET_H -#include -#endif #ifdef HAVE_NETINET_IN_H #include #endif -#ifdef HAVE_UNISTD_H -#include -#endif #ifdef HAVE_NETDB_H #include #endif diff --git a/lib/http_proxy.c b/lib/http_proxy.c index 245e1c1..d2e1aa1 100644 --- a/lib/http_proxy.c +++ b/lib/http_proxy.c @@ -24,10 +24,6 @@ #if !defined(CURL_DISABLE_PROXY) && !defined(CURL_DISABLE_HTTP) -#ifdef HAVE_UNISTD_H -#include -#endif - #include "urldata.h" #include #include "http_proxy.h" diff --git a/lib/if2ip.c b/lib/if2ip.c index 055ee7a..c1905d1 100644 --- a/lib/if2ip.c +++ b/lib/if2ip.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2011, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -22,12 +22,6 @@ #include "setup.h" -#ifdef HAVE_UNISTD_H -# include -#endif -#ifdef HAVE_SYS_SOCKET_H -# include -#endif #ifdef HAVE_NETINET_IN_H # include #endif diff --git a/lib/if2ip.h b/lib/if2ip.h index 99821b7..7084245 100644 --- a/lib/if2ip.h +++ b/lib/if2ip.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2011, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -27,7 +27,6 @@ bool Curl_if_is_interface_name(const char *interf); char *Curl_if2ip(int af, const char *interf, char *buf, int buf_size); #ifdef __INTERIX -#include /* Nedelcho Stanev's work-around for SFU 3.0 */ struct ifreq { @@ -61,6 +60,7 @@ struct ifreq { #define ifr_mtu ifr_ifru.ifru_mtu /* mtu */ #define SIOCGIFADDR _IOW('s', 102, struct ifreq) /* Get if addr */ -#endif /* interix */ + +#endif /* __INTERIX */ #endif /* HEADER_CURL_IF2IP_H */ diff --git a/lib/imap.c b/lib/imap.c index 01f8163..094a437 100644 --- a/lib/imap.c +++ b/lib/imap.c @@ -27,13 +27,6 @@ #ifndef CURL_DISABLE_IMAP -#ifdef HAVE_UNISTD_H -#include -#endif - -#ifdef HAVE_SYS_SOCKET_H -#include -#endif #ifdef HAVE_NETINET_IN_H #include #endif diff --git a/lib/inet_ntop.c b/lib/inet_ntop.c index 1bb9744..1ff9756 100644 --- a/lib/inet_ntop.c +++ b/lib/inet_ntop.c @@ -25,9 +25,6 @@ #ifdef HAVE_SYS_PARAM_H #include #endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif #ifdef HAVE_NETINET_IN_H #include #endif diff --git a/lib/inet_pton.c b/lib/inet_pton.c index 021f48d..d7fbbe9 100644 --- a/lib/inet_pton.c +++ b/lib/inet_pton.c @@ -23,9 +23,6 @@ #ifdef HAVE_SYS_PARAM_H #include #endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif #ifdef HAVE_NETINET_IN_H #include #endif diff --git a/lib/krb4.c b/lib/krb4.c index b53a610..58354b6 100644 --- a/lib/krb4.c +++ b/lib/krb4.c @@ -50,10 +50,6 @@ #include #include -#ifdef HAVE_UNISTD_H -#include /* for getpid() */ -#endif - #include "urldata.h" #include "curl_base64.h" #include "ftp.h" diff --git a/lib/ldap.c b/lib/ldap.c index 7378476..9ef3100 100644 --- a/lib/ldap.c +++ b/lib/ldap.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2011, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -54,10 +54,6 @@ # endif /* HAVE_LDAP_SSL && HAVE_LDAP_SSL_H */ #endif -#ifdef HAVE_UNISTD_H -# include -#endif - #include "urldata.h" #include #include "sendf.h" diff --git a/lib/memdebug.c b/lib/memdebug.c index 0b81621..c95f41f 100644 --- a/lib/memdebug.c +++ b/lib/memdebug.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2010, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -23,20 +23,13 @@ #include "setup.h" #ifdef CURLDEBUG -#include -#ifdef HAVE_SYS_SOCKET_H -#include -#endif +#include #define _MPRINTF_REPLACE #include #include "urldata.h" -#ifdef HAVE_UNISTD_H -#include -#endif - #define MEMDEBUG_NODEFINES /* don't redefine the standard functions */ #include "curl_memory.h" #include "memdebug.h" diff --git a/lib/memdebug.h b/lib/memdebug.h index 1e02645..1716e35 100644 --- a/lib/memdebug.h +++ b/lib/memdebug.h @@ -8,7 +8,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2011, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -32,10 +32,6 @@ #include -#ifdef HAVE_SYS_SOCKET_H -#include -#endif - #define CURL_MT_LOGFNAME_BUFSIZE 512 #define logfile curl_debuglogfile diff --git a/lib/multi.c b/lib/multi.c index e309c0d..bab6157 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -22,13 +22,6 @@ #include "setup.h" -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif - #include #include "urldata.h" diff --git a/lib/netrc.c b/lib/netrc.c index a993351..162a86c 100644 --- a/lib/netrc.c +++ b/lib/netrc.c @@ -22,9 +22,6 @@ #include "setup.h" -#ifdef HAVE_UNISTD_H -#include -#endif #ifdef HAVE_PWD_H #include #endif diff --git a/lib/nonblock.c b/lib/nonblock.c index 68ff2f3..a2722ed 100644 --- a/lib/nonblock.c +++ b/lib/nonblock.c @@ -22,15 +22,9 @@ #include "setup.h" -#ifdef HAVE_SYS_SOCKET_H -#include -#endif #ifdef HAVE_SYS_IOCTL_H #include #endif -#ifdef HAVE_UNISTD_H -#include -#endif #ifdef HAVE_FCNTL_H #include #endif diff --git a/lib/nss.c b/lib/nss.c index 794eccb..86ce6a6 100644 --- a/lib/nss.c +++ b/lib/nss.c @@ -29,10 +29,6 @@ #ifdef USE_NSS -#ifdef HAVE_SYS_SOCKET_H -#include -#endif - #include "urldata.h" #include "sendf.h" #include "formdata.h" /* for the boundary function */ diff --git a/lib/polarssl.c b/lib/polarssl.c index b20b4a3..ef074be 100644 --- a/lib/polarssl.c +++ b/lib/polarssl.c @@ -31,10 +31,6 @@ #ifdef USE_POLARSSL -#ifdef HAVE_SYS_SOCKET_H -#include -#endif - #include #include #include diff --git a/lib/pop3.c b/lib/pop3.c index c00fb62..391f4e7 100644 --- a/lib/pop3.c +++ b/lib/pop3.c @@ -33,13 +33,6 @@ #ifndef CURL_DISABLE_POP3 -#ifdef HAVE_UNISTD_H -#include -#endif - -#ifdef HAVE_SYS_SOCKET_H -#include -#endif #ifdef HAVE_NETINET_IN_H #include #endif diff --git a/lib/security.c b/lib/security.c index 6201c55..b70310b 100644 --- a/lib/security.c +++ b/lib/security.c @@ -50,10 +50,6 @@ #include #endif -#ifdef HAVE_UNISTD_H -#include -#endif - #ifdef HAVE_LIMITS_H #include #endif diff --git a/lib/sendf.c b/lib/sendf.c index 1a9b63f..b45e43a 100644 --- a/lib/sendf.c +++ b/lib/sendf.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2011, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -22,15 +22,8 @@ #include "setup.h" -#ifdef HAVE_SYS_SOCKET_H -#include /* required for send() & recv() prototypes */ -#endif - -#ifdef HAVE_UNISTD_H -#include -#endif - #include + #include "urldata.h" #include "sendf.h" #include "connect.h" diff --git a/lib/setup_once.h b/lib/setup_once.h index 0bf49b7..effe14b 100644 --- a/lib/setup_once.h +++ b/lib/setup_once.h @@ -83,6 +83,14 @@ #include #endif +#ifdef HAVE_UNISTD_H +#include +#endif + +#ifdef HAVE_SYS_SOCKET_H +#include +#endif + /* * Definition of timeval struct for platforms that don't have it. diff --git a/lib/smtp.c b/lib/smtp.c index b73bb2d..dd39b83 100644 --- a/lib/smtp.c +++ b/lib/smtp.c @@ -31,13 +31,6 @@ #ifndef CURL_DISABLE_SMTP -#ifdef HAVE_UNISTD_H -#include -#endif - -#ifdef HAVE_SYS_SOCKET_H -#include -#endif #ifdef HAVE_NETINET_IN_H #include #endif diff --git a/lib/socks.c b/lib/socks.c index d4b58f2..13a756a 100644 --- a/lib/socks.c +++ b/lib/socks.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2011, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -24,9 +24,6 @@ #if !defined(CURL_DISABLE_PROXY) -#ifdef HAVE_SYS_SOCKET_H -#include -#endif #ifdef HAVE_NETINET_IN_H #include #endif diff --git a/lib/ssh.c b/lib/ssh.c index 334e4b8..3a97299 100644 --- a/lib/ssh.c +++ b/lib/ssh.c @@ -33,17 +33,10 @@ #include #include -#ifdef HAVE_UNISTD_H -#include -#endif - #ifdef HAVE_FCNTL_H #include #endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif #ifdef HAVE_NETINET_IN_H #include #endif diff --git a/lib/sslgen.c b/lib/sslgen.c index 8408d58..67dd71f 100644 --- a/lib/sslgen.c +++ b/lib/sslgen.c @@ -45,10 +45,6 @@ #include "setup.h" -#ifdef HAVE_SYS_SOCKET_H -#include -#endif - #include "urldata.h" #define SSLGEN_C #include "sslgen.h" /* generic SSL protos etc */ diff --git a/lib/ssluse.c b/lib/ssluse.c index 92ae2e3..8f9fce4 100644 --- a/lib/ssluse.c +++ b/lib/ssluse.c @@ -35,9 +35,6 @@ #ifdef HAVE_LIMITS_H #include #endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif #include "urldata.h" #include "sendf.h" diff --git a/lib/telnet.c b/lib/telnet.c index 1c294e2..a64da09 100644 --- a/lib/telnet.c +++ b/lib/telnet.c @@ -24,15 +24,9 @@ #ifndef CURL_DISABLE_TELNET -#ifdef HAVE_SYS_SOCKET_H -#include -#endif #ifdef HAVE_NETINET_IN_H #include #endif -#ifdef HAVE_UNISTD_H -#include -#endif #ifdef HAVE_NETDB_H #include #endif diff --git a/lib/tftp.c b/lib/tftp.c index 3beabb4..97276ea 100644 --- a/lib/tftp.c +++ b/lib/tftp.c @@ -24,15 +24,9 @@ #ifndef CURL_DISABLE_TFTP -#ifdef HAVE_SYS_SOCKET_H -#include -#endif #ifdef HAVE_NETINET_IN_H #include #endif -#ifdef HAVE_UNISTD_H -#include -#endif #ifdef HAVE_NETDB_H #include #endif diff --git a/lib/transfer.c b/lib/transfer.c index 51b2f77..6194908 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -26,15 +26,9 @@ #include "strequal.h" #include "rawstr.h" -#ifdef HAVE_SYS_SOCKET_H -#include -#endif #ifdef HAVE_NETINET_IN_H #include #endif -#ifdef HAVE_UNISTD_H -#include -#endif #ifdef HAVE_NETDB_H #include #endif diff --git a/lib/url.c b/lib/url.c index 5747517..d93a0e9 100644 --- a/lib/url.c +++ b/lib/url.c @@ -22,15 +22,9 @@ #include "setup.h" -#ifdef HAVE_SYS_SOCKET_H -#include -#endif #ifdef HAVE_NETINET_IN_H #include #endif -#ifdef HAVE_UNISTD_H -#include -#endif #ifdef HAVE_NETDB_H #include #endif diff --git a/lib/warnless.c b/lib/warnless.c index aab95ab..f621383 100644 --- a/lib/warnless.c +++ b/lib/warnless.c @@ -24,9 +24,6 @@ #if defined(__INTEL_COMPILER) && defined(__unix__) -#ifdef HAVE_SYS_SOCKET_H -# include -#endif #ifdef HAVE_NETINET_IN_H # include #endif diff --git a/src/tool_cb_rea.c b/src/tool_cb_rea.c index 5320cdb..4565a15 100644 --- a/src/tool_cb_rea.c +++ b/src/tool_cb_rea.c @@ -21,10 +21,6 @@ ***************************************************************************/ #include "tool_setup.h" -#ifdef HAVE_UNISTD_H -# include -#endif - #define ENABLE_CURLX_PRINTF /* use our own printf() functions */ #include "curlx.h" diff --git a/src/tool_cb_see.c b/src/tool_cb_see.c index af33ad4..2f49e1d 100644 --- a/src/tool_cb_see.c +++ b/src/tool_cb_see.c @@ -21,10 +21,6 @@ ***************************************************************************/ #include "tool_setup.h" -#ifdef HAVE_UNISTD_H -# include -#endif - #define ENABLE_CURLX_PRINTF /* use our own printf() functions */ #include "curlx.h" diff --git a/src/tool_dirhie.c b/src/tool_dirhie.c index d21dc97..4ba1c43 100644 --- a/src/tool_dirhie.c +++ b/src/tool_dirhie.c @@ -23,10 +23,6 @@ #include -#ifdef HAVE_UNISTD_H -# include -#endif - #ifdef WIN32 # include #endif diff --git a/src/tool_getpass.c b/src/tool_getpass.c index a3fffa9..0ac7dcb 100644 --- a/src/tool_getpass.c +++ b/src/tool_getpass.c @@ -24,10 +24,6 @@ #ifndef HAVE_GETPASS_R /* this file is only for systems without getpass_r() */ -#ifdef HAVE_UNISTD_H -# include -#endif - #ifdef HAVE_FCNTL_H # include #endif diff --git a/src/tool_homedir.c b/src/tool_homedir.c index 61cc02a..cb90095 100644 --- a/src/tool_homedir.c +++ b/src/tool_homedir.c @@ -24,9 +24,6 @@ #ifdef HAVE_PWD_H # include #endif -#ifdef HAVE_UNISTD_H -# include -#endif #ifdef __VMS # include #endif diff --git a/src/tool_main.c b/src/tool_main.c index be1b3fc..9c0a19f 100644 --- a/src/tool_main.c +++ b/src/tool_main.c @@ -23,10 +23,6 @@ #include -#ifdef HAVE_UNISTD_H -# include -#endif - #define ENABLE_CURLX_PRINTF /* use our own printf() functions */ #include "curlx.h" diff --git a/src/tool_metalink.c b/src/tool_metalink.c index 42b514c..f9e9869 100644 --- a/src/tool_metalink.c +++ b/src/tool_metalink.c @@ -23,10 +23,6 @@ #ifdef USE_METALINK -#ifdef HAVE_UNISTD_H -# include -#endif - #include #ifdef HAVE_FCNTL_H diff --git a/src/tool_operate.c b/src/tool_operate.c index 826b4a5..bcbce20 100644 --- a/src/tool_operate.c +++ b/src/tool_operate.c @@ -21,10 +21,6 @@ ***************************************************************************/ #include "tool_setup.h" -#ifdef HAVE_UNISTD_H -# include -#endif - #ifdef HAVE_FCNTL_H # include #endif diff --git a/src/tool_sleep.c b/src/tool_sleep.c index 8354840..49cdc71 100644 --- a/src/tool_sleep.c +++ b/src/tool_sleep.c @@ -25,10 +25,6 @@ # include #endif -#ifdef HAVE_SYS_SOCKET_H -# include -#endif - #ifdef HAVE_SYS_POLL_H # include #elif defined(HAVE_POLL_H) diff --git a/tests/libtest/lib1502.c b/tests/libtest/lib1502.c index bb008f1..1ded5ab 100644 --- a/tests/libtest/lib1502.c +++ b/tests/libtest/lib1502.c @@ -30,13 +30,6 @@ #include #endif -#include -#include - -/* somewhat unix-specific */ -#include -#include - int test(char *URL) { CURL *ehandle; diff --git a/tests/libtest/lib505.c b/tests/libtest/lib505.c index 394131e..99b3a0a 100644 --- a/tests/libtest/lib505.c +++ b/tests/libtest/lib505.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2011, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -21,17 +21,10 @@ ***************************************************************************/ #include "test.h" -#ifdef HAVE_SYS_SOCKET_H -#include -#endif #ifdef HAVE_FCNTL_H #include #endif -#ifdef HAVE_UNISTD_H -#include -#endif - #include "memdebug.h" /* diff --git a/tests/libtest/test.h b/tests/libtest/test.h index ffa4be1..fcc91ad 100644 --- a/tests/libtest/test.h +++ b/tests/libtest/test.h @@ -30,21 +30,11 @@ #include "setup.h" #include -#include -#include -#include -#ifdef HAVE_SYS_SOCKET_H -#include -#endif #ifdef HAVE_SYS_SELECT_H /* since so many tests use select(), we can just as well include it here */ #include #endif -#ifdef HAVE_UNISTD_H -/* at least somewhat oldish FreeBSD systems need this for select() */ -#include -#endif #ifdef TPF # include "select.h" diff --git a/tests/server/fake_ntlm.c b/tests/server/fake_ntlm.c index 4af334d..64f0675 100644 --- a/tests/server/fake_ntlm.c +++ b/tests/server/fake_ntlm.c @@ -29,10 +29,6 @@ * responses with a pre-written string saved in test case test2005. */ -#ifdef HAVE_UNISTD_H -#include -#endif - #define ENABLE_CURLX_PRINTF #include "curlx.h" /* from the private lib dir */ #include "getpart.h" diff --git a/tests/server/resolve.c b/tests/server/resolve.c index 3237589..d060988 100644 --- a/tests/server/resolve.c +++ b/tests/server/resolve.c @@ -34,15 +34,6 @@ #ifdef HAVE_SIGNAL_H #include #endif -#ifdef HAVE_UNISTD_H -#include -#endif -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif #ifdef HAVE_NETINET_IN_H #include #endif diff --git a/tests/server/rtspd.c b/tests/server/rtspd.c index e68c609..3c55eff 100644 --- a/tests/server/rtspd.c +++ b/tests/server/rtspd.c @@ -30,12 +30,6 @@ #ifdef HAVE_SIGNAL_H #include #endif -#ifdef HAVE_UNISTD_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif #ifdef HAVE_NETINET_IN_H #include #endif diff --git a/tests/server/sockfilt.c b/tests/server/sockfilt.c index e04cd33..7a39768 100644 --- a/tests/server/sockfilt.c +++ b/tests/server/sockfilt.c @@ -83,12 +83,6 @@ #ifdef HAVE_SIGNAL_H #include #endif -#ifdef HAVE_UNISTD_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif #ifdef HAVE_NETINET_IN_H #include #endif diff --git a/tests/server/sws.c b/tests/server/sws.c index 2910274..44d899f 100644 --- a/tests/server/sws.c +++ b/tests/server/sws.c @@ -31,12 +31,6 @@ #ifdef HAVE_SIGNAL_H #include #endif -#ifdef HAVE_UNISTD_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif #ifdef HAVE_NETINET_IN_H #include #endif diff --git a/tests/server/tftpd.c b/tests/server/tftpd.c index 62c95e6..e8c3c2d 100644 --- a/tests/server/tftpd.c +++ b/tests/server/tftpd.c @@ -58,9 +58,6 @@ #ifdef HAVE_FCNTL_H #include #endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif #ifdef HAVE_NETINET_IN_H #include #endif @@ -81,9 +78,7 @@ #endif #include -#ifdef HAVE_UNISTD_H -#include -#endif + #ifdef HAVE_PWD_H #include #endif diff --git a/tests/server/util.c b/tests/server/util.c index c6a404b..30766d8 100644 --- a/tests/server/util.c +++ b/tests/server/util.c @@ -24,12 +24,6 @@ #ifdef HAVE_SIGNAL_H #include #endif -#ifdef HAVE_UNISTD_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif #ifdef HAVE_NETINET_IN_H #include #endif -- 2.7.4