From 5a053ffe80289b8472f88d7f11f29fbc98d4d9fd Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Sun, 6 Jan 2013 19:06:49 +0100 Subject: build: fix circular header inclusion with other packages This commit renames lib/setup.h to lib/curl_setup.h and renames lib/setup_once.h to lib/curl_setup_once.h. Removes the need and usage of a header inclusion guard foreign to libcurl. [1] Removes the need and presence of an alarming notice we carried in old setup_once.h [2] ---------------------------------------- 1 - lib/setup_once.h used __SETUP_ONCE_H macro as header inclusion guard up to commit ec691ca3 which changed this to HEADER_CURL_SETUP_ONCE_H, this single inclusion guard is enough to ensure that inclusion of lib/setup_once.h done from lib/setup.h is only done once. Additionally lib/setup.h has always used __SETUP_ONCE_H macro to protect inclusion of setup_once.h even after commit ec691ca3, this was to avoid a circular header inclusion triggered when building a c-ares enabled version with c-ares sources available which also has a setup_once.h header. Commit ec691ca3 exposes the real nature of __SETUP_ONCE_H usage in lib/setup.h, it is a header inclusion guard foreign to libcurl belonging to c-ares's setup_once.h The renaming this commit does, fixes the circular header inclusion, and as such removes the need and usage of a header inclusion guard foreign to libcurl. Macro __SETUP_ONCE_H no longer used in libcurl. 2 - Due to the circular interdependency of old lib/setup_once.h and the c-ares setup_once.h header, old file lib/setup_once.h has carried back from 2006 up to now days an alarming and prominent notice about the need of keeping libcurl's and c-ares's setup_once.h in sync. Given that this commit fixes the circular interdependency, the need and presence of mentioned notice is removed. All mentioned interdependencies come back from now old days when the c-ares project lived inside a curl subdirectory. This commit removes last traces of such fact. --- lib/Makefile.am | 4 +- lib/Makefile.inc | 6 +- lib/README.hostip | 2 +- lib/amigaos.c | 2 +- lib/amigaos.h | 2 +- lib/asyn-ares.c | 2 +- lib/asyn-thread.c | 2 +- lib/asyn.h | 2 +- lib/axtls.c | 2 +- lib/base64.c | 2 +- lib/bundles.c | 2 +- lib/conncache.c | 2 +- lib/connect.c | 2 +- lib/connect.h | 2 +- lib/content_encoding.c | 2 +- lib/content_encoding.h | 2 +- lib/cookie.c | 2 +- lib/cookie.h | 2 +- lib/curl_addrinfo.c | 2 +- lib/curl_addrinfo.h | 2 +- lib/curl_darwinssl.c | 2 +- lib/curl_darwinssl.h | 2 +- lib/curl_fnmatch.c | 2 +- lib/curl_gethostname.c | 2 +- lib/curl_gssapi.c | 2 +- lib/curl_gssapi.h | 2 +- lib/curl_md4.h | 2 +- lib/curl_memrchr.c | 2 +- lib/curl_memrchr.h | 2 +- lib/curl_multibyte.c | 2 +- lib/curl_multibyte.h | 2 +- lib/curl_ntlm.c | 2 +- lib/curl_ntlm.h | 2 +- lib/curl_ntlm_core.c | 2 +- lib/curl_ntlm_core.h | 2 +- lib/curl_ntlm_msgs.c | 2 +- lib/curl_ntlm_msgs.h | 2 +- lib/curl_ntlm_wb.c | 2 +- lib/curl_ntlm_wb.h | 2 +- lib/curl_rand.c | 2 +- lib/curl_rtmp.c | 2 +- lib/curl_sasl.c | 2 +- lib/curl_schannel.c | 2 +- lib/curl_schannel.h | 2 +- lib/curl_setup.h | 687 +++++++++++++++++++++++++++++++++++++++++++++ lib/curl_setup_once.h | 560 +++++++++++++++++++++++++++++++++++++ lib/curl_sspi.c | 2 +- lib/curl_sspi.h | 2 +- lib/curl_threads.c | 2 +- lib/curl_threads.h | 2 +- lib/cyassl.c | 2 +- lib/cyassl.h | 2 +- lib/dict.c | 2 +- lib/easy.c | 2 +- lib/escape.c | 2 +- lib/file.c | 2 +- lib/fileinfo.c | 2 +- lib/formdata.c | 2 +- lib/ftp.c | 2 +- lib/ftplistparser.c | 2 +- lib/ftplistparser.h | 2 +- lib/getenv.c | 2 +- lib/getinfo.c | 2 +- lib/gopher.c | 2 +- lib/gtls.c | 5 +- lib/gtls.h | 2 +- lib/hash.c | 2 +- lib/hash.h | 2 +- lib/hmac.c | 2 +- lib/hostasyn.c | 2 +- lib/hostcheck.c | 2 +- lib/hostip.c | 4 +- lib/hostip.h | 2 +- lib/hostip4.c | 2 +- lib/hostip6.c | 2 +- lib/hostsyn.c | 2 +- lib/http.c | 2 +- lib/http_chunks.c | 2 +- lib/http_digest.c | 2 +- lib/http_digest.h | 2 +- lib/http_negotiate.c | 2 +- lib/http_negotiate_sspi.c | 2 +- lib/http_proxy.c | 2 +- lib/idn_win32.c | 2 +- lib/if2ip.c | 2 +- lib/if2ip.h | 2 +- lib/imap.c | 2 +- lib/inet_ntop.c | 2 +- lib/inet_ntop.h | 2 +- lib/inet_pton.c | 2 +- lib/inet_pton.h | 2 +- lib/krb4.c | 2 +- lib/krb5.c | 2 +- lib/ldap.c | 2 +- lib/llist.c | 2 +- lib/llist.h | 2 +- lib/md4.c | 2 +- lib/md5.c | 2 +- lib/memdebug.c | 2 +- lib/memdebug.h | 2 +- lib/mprintf.c | 2 +- lib/multi.c | 2 +- lib/netrc.c | 2 +- lib/non-ascii.c | 2 +- lib/non-ascii.h | 2 +- lib/nonblock.c | 2 +- lib/nss.c | 2 +- lib/nssg.h | 2 +- lib/nwlib.c | 2 +- lib/nwos.c | 2 +- lib/openldap.c | 2 +- lib/parsedate.c | 2 +- lib/pingpong.c | 2 +- lib/pingpong.h | 2 +- lib/polarssl.c | 2 +- lib/polarssl.h | 2 +- lib/pop3.c | 2 +- lib/progress.c | 2 +- lib/qssl.c | 2 +- lib/qssl.h | 2 +- lib/rawstr.c | 2 +- lib/rtsp.c | 2 +- lib/security.c | 2 +- lib/select.c | 2 +- lib/select.h | 2 +- lib/sendf.c | 2 +- lib/sendf.h | 2 +- lib/setup.h | 689 ---------------------------------------------- lib/setup_once.h | 570 -------------------------------------- lib/share.c | 2 +- lib/share.h | 2 +- lib/slist.c | 2 +- lib/smtp.c | 2 +- lib/sockaddr.h | 2 +- lib/socks.c | 2 +- lib/socks.h | 2 +- lib/socks_gssapi.c | 2 +- lib/socks_sspi.c | 2 +- lib/speedcheck.c | 2 +- lib/speedcheck.h | 2 +- lib/splay.c | 2 +- lib/splay.h | 2 +- lib/ssh.c | 2 +- lib/ssh.h | 2 +- lib/sslgen.c | 2 +- lib/sslgen.h | 2 +- lib/ssluse.c | 2 +- lib/ssluse.h | 2 +- lib/strdup.c | 2 +- lib/strdup.h | 2 +- lib/strequal.c | 2 +- lib/strerror.c | 2 +- lib/strtok.c | 2 +- lib/strtok.h | 2 +- lib/strtoofft.c | 2 +- lib/strtoofft.h | 2 +- lib/telnet.c | 2 +- lib/tftp.c | 2 +- lib/timeval.h | 2 +- lib/transfer.c | 2 +- lib/url.c | 2 +- lib/url.h | 2 +- lib/urldata.h | 2 +- lib/version.c | 2 +- lib/warnless.c | 2 +- lib/wildcard.c | 2 +- 166 files changed, 1415 insertions(+), 1426 deletions(-) create mode 100644 lib/curl_setup.h create mode 100644 lib/curl_setup_once.h delete mode 100644 lib/setup.h delete mode 100644 lib/setup_once.h (limited to 'lib') diff --git a/lib/Makefile.am b/lib/Makefile.am index bb7721d0e..3eb497798 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -57,10 +57,10 @@ CFLAG_CURL_SYMBOL_HIDING = @CFLAG_CURL_SYMBOL_HIDING@ # might possibly already be installed in the system. # # $(top_builddir)/include/curl for generated curlbuild.h included from curl.h -# $(top_builddir)/include for generated curlbuild.h included from lib/setup.h +# $(top_builddir)/include for generated curlbuild.h inc. from lib/curl_setup.h # $(top_srcdir)/include is for libcurl's external include files # $(top_builddir)/lib is for libcurl's generated lib/curl_config.h file -# $(top_srcdir)/lib is for libcurl's lib/setup.h and other "private" files +# $(top_srcdir)/lib for libcurl's lib/curl_setup.h and other "private" files # $(top_builddir)/ares is for in-tree c-ares's generated ares_build.h file # $(top_srcdir)/ares is for in-tree c-ares's external include files diff --git a/lib/Makefile.inc b/lib/Makefile.inc index f97ef6d0e..b116b3932 100644 --- a/lib/Makefile.inc +++ b/lib/Makefile.inc @@ -34,13 +34,13 @@ HHEADERS = arpa_telnet.h netrc.h file.h timeval.h qssl.h hostip.h \ curl_fnmatch.h wildcard.h fileinfo.h ftplistparser.h strtok.h \ connect.h llist.h hash.h content_encoding.h share.h curl_md4.h \ curl_md5.h http_digest.h http_negotiate.h inet_pton.h amigaos.h \ - strtoofft.h strerror.h inet_ntop.h curlx.h curl_memory.h setup.h \ + strtoofft.h strerror.h inet_ntop.h curlx.h curl_memory.h curl_setup.h \ transfer.h select.h easyif.h multiif.h parsedate.h sslgen.h gtls.h \ - tftp.h sockaddr.h splay.h strdup.h setup_once.h socks.h ssh.h nssg.h \ + tftp.h sockaddr.h splay.h strdup.h socks.h ssh.h nssg.h \ curl_base64.h rawstr.h curl_addrinfo.h curl_sspi.h slist.h nonblock.h \ curl_memrchr.h imap.h pop3.h smtp.h pingpong.h rtsp.h curl_threads.h \ warnless.h curl_hmac.h polarssl.h curl_rtmp.h curl_gethostname.h \ gopher.h axtls.h cyassl.h http_proxy.h non-ascii.h asyn.h curl_ntlm.h \ curl_gssapi.h curl_ntlm_wb.h curl_ntlm_core.h curl_ntlm_msgs.h \ curl_sasl.h curl_schannel.h curl_multibyte.h curl_darwinssl.h \ - hostcheck.h bundles.h conncache.h + hostcheck.h bundles.h conncache.h curl_setup_once.h diff --git a/lib/README.hostip b/lib/README.hostip index 9723b93fd..2e30bc792 100644 --- a/lib/README.hostip +++ b/lib/README.hostip @@ -32,4 +32,4 @@ hostip6.c - ipv6-specific functions The hostip.h is the single united header file for all this. It defines the - CURLRES_* defines based on the config*.h and setup.h defines. + CURLRES_* defines based on the config*.h and curl_setup.h defines. diff --git a/lib/amigaos.c b/lib/amigaos.c index 71ea704e1..34f95e9b5 100644 --- a/lib/amigaos.c +++ b/lib/amigaos.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #if defined(__AMIGA__) && !defined(__ixemul__) diff --git a/lib/amigaos.h b/lib/amigaos.h index 7476a13d8..76578be86 100644 --- a/lib/amigaos.h +++ b/lib/amigaos.h @@ -21,7 +21,7 @@ * KIND, either express or implied. * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #if defined(__AMIGA__) && !defined(__ixemul__) diff --git a/lib/asyn-ares.c b/lib/asyn-ares.c index 44d00bdb0..fdfa2a30f 100644 --- a/lib/asyn-ares.c +++ b/lib/asyn-ares.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifdef HAVE_LIMITS_H #include diff --git a/lib/asyn-thread.c b/lib/asyn-thread.c index 0d29d5887..7a8294ddf 100644 --- a/lib/asyn-thread.c +++ b/lib/asyn-thread.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifdef HAVE_NETINET_IN_H #include diff --git a/lib/asyn.h b/lib/asyn.h index e7c1b886d..1b681ea12 100644 --- a/lib/asyn.h +++ b/lib/asyn.h @@ -22,7 +22,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #include "curl_addrinfo.h" struct addrinfo; diff --git a/lib/axtls.c b/lib/axtls.c index 19ed73091..d512950c2 100644 --- a/lib/axtls.c +++ b/lib/axtls.c @@ -26,7 +26,7 @@ * but sslgen.c should ever call or use these functions. */ -#include "setup.h" +#include "curl_setup.h" #ifdef USE_AXTLS #include diff --git a/lib/base64.c b/lib/base64.c index ec46c09ab..3f3f0f9b8 100644 --- a/lib/base64.c +++ b/lib/base64.c @@ -22,7 +22,7 @@ /* Base64 encoding/decoding */ -#include "setup.h" +#include "curl_setup.h" #define _MPRINTF_REPLACE /* use our functions only */ #include diff --git a/lib/bundles.c b/lib/bundles.c index f09ee2a35..aadf02656 100644 --- a/lib/bundles.c +++ b/lib/bundles.c @@ -21,7 +21,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #include diff --git a/lib/conncache.c b/lib/conncache.c index a3a90f879..165a26fb4 100644 --- a/lib/conncache.c +++ b/lib/conncache.c @@ -21,7 +21,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #include diff --git a/lib/connect.c b/lib/connect.c index 19f5b2f5b..acaf3b485 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifdef HAVE_NETINET_IN_H #include /* may need it */ diff --git a/lib/connect.h b/lib/connect.h index f84361f2e..ab9800289 100644 --- a/lib/connect.h +++ b/lib/connect.h @@ -21,7 +21,7 @@ * KIND, either express or implied. * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #include "nonblock.h" /* for curlx_nonblock(), formerly Curl_nonblock() */ #include "sockaddr.h" diff --git a/lib/content_encoding.c b/lib/content_encoding.c index 3276ef988..c68e6e5f5 100644 --- a/lib/content_encoding.c +++ b/lib/content_encoding.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifdef HAVE_LIBZ diff --git a/lib/content_encoding.h b/lib/content_encoding.h index 372da4a3b..501f6c8ce 100644 --- a/lib/content_encoding.h +++ b/lib/content_encoding.h @@ -21,7 +21,7 @@ * KIND, either express or implied. * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" /* * Comma-separated list all supported Content-Encodings ('identity' is implied) diff --git a/lib/cookie.c b/lib/cookie.c index 644b33a25..18b91559c 100644 --- a/lib/cookie.c +++ b/lib/cookie.c @@ -77,7 +77,7 @@ Example set of cookies: ****/ -#include "setup.h" +#include "curl_setup.h" #if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES) diff --git a/lib/cookie.h b/lib/cookie.h index 5997e4680..d3b63f780 100644 --- a/lib/cookie.h +++ b/lib/cookie.h @@ -21,7 +21,7 @@ * KIND, either express or implied. * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #include diff --git a/lib/curl_addrinfo.c b/lib/curl_addrinfo.c index 815b4ae64..10652c642 100644 --- a/lib/curl_addrinfo.c +++ b/lib/curl_addrinfo.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #include diff --git a/lib/curl_addrinfo.h b/lib/curl_addrinfo.h index a5375cb33..6d2b753eb 100644 --- a/lib/curl_addrinfo.h +++ b/lib/curl_addrinfo.h @@ -22,7 +22,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifdef HAVE_NETINET_IN_H # include diff --git a/lib/curl_darwinssl.c b/lib/curl_darwinssl.c index 2d56b3920..e8fa2758b 100644 --- a/lib/curl_darwinssl.c +++ b/lib/curl_darwinssl.c @@ -26,7 +26,7 @@ * TLS/SSL layer. No code but sslgen.c should ever call or use these functions. */ -#include "setup.h" +#include "curl_setup.h" #ifdef USE_DARWINSSL diff --git a/lib/curl_darwinssl.h b/lib/curl_darwinssl.h index 53053edca..183d9371c 100644 --- a/lib/curl_darwinssl.h +++ b/lib/curl_darwinssl.h @@ -21,7 +21,7 @@ * KIND, either express or implied. * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifdef USE_DARWINSSL diff --git a/lib/curl_fnmatch.c b/lib/curl_fnmatch.c index e18f52eab..63f67b9aa 100644 --- a/lib/curl_fnmatch.c +++ b/lib/curl_fnmatch.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #include "curl_fnmatch.h" diff --git a/lib/curl_gethostname.c b/lib/curl_gethostname.c index ddee4ba1d..ded1e6f94 100644 --- a/lib/curl_gethostname.c +++ b/lib/curl_gethostname.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #include "curl_gethostname.h" diff --git a/lib/curl_gssapi.c b/lib/curl_gssapi.c index b9c8ad0cf..fabbe3598 100644 --- a/lib/curl_gssapi.c +++ b/lib/curl_gssapi.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifdef HAVE_GSSAPI diff --git a/lib/curl_gssapi.h b/lib/curl_gssapi.h index fd4596b80..ed33b51a2 100644 --- a/lib/curl_gssapi.h +++ b/lib/curl_gssapi.h @@ -22,7 +22,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #include "urldata.h" #ifdef HAVE_GSSAPI diff --git a/lib/curl_md4.h b/lib/curl_md4.h index 6b6c16e13..b0be9cf6c 100644 --- a/lib/curl_md4.h +++ b/lib/curl_md4.h @@ -22,7 +22,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" /* NSS crypto library does not provide the MD4 hash algorithm, so that we have * a local implementation of it */ diff --git a/lib/curl_memrchr.c b/lib/curl_memrchr.c index d79af9be7..a71c2bb4a 100644 --- a/lib/curl_memrchr.c +++ b/lib/curl_memrchr.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #include "curl_memrchr.h" diff --git a/lib/curl_memrchr.h b/lib/curl_memrchr.h index 37061b608..324c73a7b 100644 --- a/lib/curl_memrchr.h +++ b/lib/curl_memrchr.h @@ -22,7 +22,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifdef HAVE_MEMRCHR diff --git a/lib/curl_multibyte.c b/lib/curl_multibyte.c index 7cb9e4c60..6c02239eb 100644 --- a/lib/curl_multibyte.c +++ b/lib/curl_multibyte.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #if defined(USE_WIN32_IDN) || (defined(USE_WINDOWS_SSPI) && defined(UNICODE)) diff --git a/lib/curl_multibyte.h b/lib/curl_multibyte.h index 6ecccd3c9..7ee5eae12 100644 --- a/lib/curl_multibyte.h +++ b/lib/curl_multibyte.h @@ -21,7 +21,7 @@ * KIND, either express or implied. * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #if defined(USE_WIN32_IDN) || (defined(USE_WINDOWS_SSPI) && defined(UNICODE)) diff --git a/lib/curl_ntlm.c b/lib/curl_ntlm.c index 9c7837254..72e446c8f 100644 --- a/lib/curl_ntlm.c +++ b/lib/curl_ntlm.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifdef USE_NTLM diff --git a/lib/curl_ntlm.h b/lib/curl_ntlm.h index b2783778b..21a9e9e47 100644 --- a/lib/curl_ntlm.h +++ b/lib/curl_ntlm.h @@ -22,7 +22,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifdef USE_NTLM diff --git a/lib/curl_ntlm_core.c b/lib/curl_ntlm_core.c index 6b7d9fc46..8f3c00d64 100644 --- a/lib/curl_ntlm_core.c +++ b/lib/curl_ntlm_core.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #if defined(USE_NTLM) && !defined(USE_WINDOWS_SSPI) diff --git a/lib/curl_ntlm_core.h b/lib/curl_ntlm_core.h index 5615b3504..9aa126bb2 100644 --- a/lib/curl_ntlm_core.h +++ b/lib/curl_ntlm_core.h @@ -22,7 +22,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #if defined(USE_NTLM) && !defined(USE_WINDOWS_SSPI) diff --git a/lib/curl_ntlm_msgs.c b/lib/curl_ntlm_msgs.c index 8e788d733..93334c601 100644 --- a/lib/curl_ntlm_msgs.c +++ b/lib/curl_ntlm_msgs.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifdef USE_NTLM diff --git a/lib/curl_ntlm_msgs.h b/lib/curl_ntlm_msgs.h index 703fb75e1..e7d185dea 100644 --- a/lib/curl_ntlm_msgs.h +++ b/lib/curl_ntlm_msgs.h @@ -22,7 +22,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifdef USE_NTLM diff --git a/lib/curl_ntlm_wb.c b/lib/curl_ntlm_wb.c index 46a51c2c4..b1c20e1b3 100644 --- a/lib/curl_ntlm_wb.c +++ b/lib/curl_ntlm_wb.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #if defined(USE_NTLM) && defined(NTLM_WB_ENABLED) diff --git a/lib/curl_ntlm_wb.h b/lib/curl_ntlm_wb.h index e3eaffe17..db6bc16b7 100644 --- a/lib/curl_ntlm_wb.h +++ b/lib/curl_ntlm_wb.h @@ -22,7 +22,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #if defined(USE_NTLM) && defined(NTLM_WB_ENABLED) diff --git a/lib/curl_rand.c b/lib/curl_rand.c index 047b7f345..dc49289a1 100644 --- a/lib/curl_rand.c +++ b/lib/curl_rand.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #include diff --git a/lib/curl_rtmp.c b/lib/curl_rtmp.c index b87bdf2c7..45da35ca0 100644 --- a/lib/curl_rtmp.c +++ b/lib/curl_rtmp.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifdef USE_LIBRTMP diff --git a/lib/curl_sasl.c b/lib/curl_sasl.c index 8062e53d2..7f998308d 100644 --- a/lib/curl_sasl.c +++ b/lib/curl_sasl.c @@ -25,7 +25,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #include #include "urldata.h" diff --git a/lib/curl_schannel.c b/lib/curl_schannel.c index 8cb3af80f..b71d8d4b0 100644 --- a/lib/curl_schannel.c +++ b/lib/curl_schannel.c @@ -51,7 +51,7 @@ * http://msdn.microsoft.com/en-us/library/windows/desktop/aa380161.aspx */ -#include "setup.h" +#include "curl_setup.h" #ifdef USE_SCHANNEL diff --git a/lib/curl_schannel.h b/lib/curl_schannel.h index 37126ac7d..b82c734a0 100644 --- a/lib/curl_schannel.h +++ b/lib/curl_schannel.h @@ -22,7 +22,7 @@ * KIND, either express or implied. * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifdef USE_SCHANNEL diff --git a/lib/curl_setup.h b/lib/curl_setup.h new file mode 100644 index 000000000..37be5ae46 --- /dev/null +++ b/lib/curl_setup.h @@ -0,0 +1,687 @@ +#ifndef HEADER_CURL_SETUP_H +#define HEADER_CURL_SETUP_H +/*************************************************************************** + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * + * 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 + * are also available at http://curl.haxx.se/docs/copyright.html. + * + * You may opt to use, copy, modify, merge, publish, distribute and/or sell + * copies of the Software, and permit persons to whom the Software is + * furnished to do so, under the terms of the COPYING file. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ***************************************************************************/ + +/* + * Define WIN32 when build target is Win32 API + */ + +#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32) && \ + !defined(__SYMBIAN32__) +#define WIN32 +#endif + +/* + * Include configuration script results or hand-crafted + * configuration file for platforms which lack config tool. + */ + +#ifdef HAVE_CONFIG_H + +#include "curl_config.h" + +#else /* HAVE_CONFIG_H */ + +#ifdef _WIN32_WCE +# include "config-win32ce.h" +#else +# ifdef WIN32 +# include "config-win32.h" +# endif +#endif + +#if defined(macintosh) && defined(__MRC__) +# include "config-mac.h" +#endif + +#ifdef __riscos__ +# include "config-riscos.h" +#endif + +#ifdef __AMIGA__ +# include "config-amigaos.h" +#endif + +#ifdef __SYMBIAN32__ +# include "config-symbian.h" +#endif + +#ifdef __OS400__ +# include "config-os400.h" +#endif + +#ifdef TPF +# include "config-tpf.h" +#endif + +#ifdef __VXWORKS__ +# include "config-vxworks.h" +#endif + +#endif /* HAVE_CONFIG_H */ + +/* ================================================================ */ +/* Definition of preprocessor macros/symbols which modify compiler */ +/* behavior or generated code characteristics must be done here, */ +/* as appropriate, before any system header file is included. It is */ +/* also possible to have them defined in the config file included */ +/* before this point. As a result of all this we frown inclusion of */ +/* system header files in our config files, avoid this at any cost. */ +/* ================================================================ */ + +/* + * AIX 4.3 and newer needs _THREAD_SAFE defined to build + * proper reentrant code. Others may also need it. + */ + +#ifdef NEED_THREAD_SAFE +# ifndef _THREAD_SAFE +# define _THREAD_SAFE +# endif +#endif + +/* + * Tru64 needs _REENTRANT set for a few function prototypes and + * things to appear in the system header files. Unixware needs it + * to build proper reentrant code. Others may also need it. + */ + +#ifdef NEED_REENTRANT +# ifndef _REENTRANT +# define _REENTRANT +# endif +#endif + +/* ================================================================ */ +/* If you need to include a system header file for your platform, */ +/* please, do it beyond the point further indicated in this file. */ +/* ================================================================ */ + +/* + * libcurl's external interface definitions are also used internally, + * and might also include required system header files to define them. + */ + +#include + +/* + * Compile time sanity checks must also be done when building the library. + */ + +#include + +/* + * Ensure that no one is using the old SIZEOF_CURL_OFF_T macro + */ + +#ifdef SIZEOF_CURL_OFF_T +# error "SIZEOF_CURL_OFF_T shall not be defined!" + Error Compilation_aborted_SIZEOF_CURL_OFF_T_shall_not_be_defined +#endif + +/* + * Set up internal curl_off_t formatting string directives for + * exclusive use with libcurl's internal *printf functions. + */ + +#ifdef FORMAT_OFF_T +# error "FORMAT_OFF_T shall not be defined before this point!" + Error Compilation_aborted_FORMAT_OFF_T_already_defined +#endif + +#ifdef FORMAT_OFF_TU +# error "FORMAT_OFF_TU shall not be defined before this point!" + Error Compilation_aborted_FORMAT_OFF_TU_already_defined +#endif + +#if (CURL_SIZEOF_CURL_OFF_T > CURL_SIZEOF_LONG) +# define FORMAT_OFF_T "lld" +# define FORMAT_OFF_TU "llu" +#else +# define FORMAT_OFF_T "ld" +# define FORMAT_OFF_TU "lu" +#endif + +/* + * Disable other protocols when http is the only one desired. + */ + +#ifdef HTTP_ONLY +# ifndef CURL_DISABLE_TFTP +# define CURL_DISABLE_TFTP +# endif +# ifndef CURL_DISABLE_FTP +# define CURL_DISABLE_FTP +# endif +# ifndef CURL_DISABLE_LDAP +# define CURL_DISABLE_LDAP +# endif +# ifndef CURL_DISABLE_TELNET +# define CURL_DISABLE_TELNET +# endif +# ifndef CURL_DISABLE_DICT +# define CURL_DISABLE_DICT +# endif +# ifndef CURL_DISABLE_FILE +# define CURL_DISABLE_FILE +# endif +# ifndef CURL_DISABLE_RTSP +# define CURL_DISABLE_RTSP +# endif +# ifndef CURL_DISABLE_POP3 +# define CURL_DISABLE_POP3 +# endif +# ifndef CURL_DISABLE_IMAP +# define CURL_DISABLE_IMAP +# endif +# ifndef CURL_DISABLE_SMTP +# define CURL_DISABLE_SMTP +# endif +# ifndef CURL_DISABLE_RTSP +# define CURL_DISABLE_RTSP +# endif +# ifndef CURL_DISABLE_RTMP +# define CURL_DISABLE_RTMP +# endif +# ifndef CURL_DISABLE_GOPHER +# define CURL_DISABLE_GOPHER +# endif +#endif + +/* + * When http is disabled rtsp is not supported. + */ + +#if defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_RTSP) +# define CURL_DISABLE_RTSP +#endif + +/* ================================================================ */ +/* No system header file shall be included in this file before this */ +/* point. The only allowed ones are those included from curlbuild.h */ +/* ================================================================ */ + +/* + * OS/400 setup file includes some system headers. + */ + +#ifdef __OS400__ +# include "setup-os400.h" +#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. ) 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. + */ + +#ifdef HAVE_WINDOWS_H +# if defined(UNICODE) && !defined(_UNICODE) +# define _UNICODE +# endif +# if defined(_UNICODE) && !defined(UNICODE) +# define UNICODE +# endif +# ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN +# endif +# include +# ifdef HAVE_WINSOCK2_H +# include +# ifdef HAVE_WS2TCPIP_H +# include +# endif +# else +# ifdef HAVE_WINSOCK_H +# include +# endif +# endif +# include +#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. + */ + +#undef USE_WINSOCK + +#ifdef HAVE_WINSOCK2_H +# define USE_WINSOCK 2 +#else +# ifdef HAVE_WINSOCK_H +# define USE_WINSOCK 1 +# endif +#endif + +#ifdef USE_LWIPSOCK +# include +# include +# include +#endif + +#ifdef HAVE_EXTRA_STRICMP_H +# include +#endif + +#ifdef HAVE_EXTRA_STRDUP_H +# include +#endif + +#ifdef TPF +# include /* for bzero, strcasecmp, and strncasecmp */ +# include /* for strcpy and strlen */ +# include /* for rand and srand */ +# include /* for select and ioctl*/ +# include /* for in_addr_t definition */ +# include /* for tpf_process_signals */ + /* change which select is used for libcurl */ +# define select(a,b,c,d,e) tpf_select_libcurl(a,b,c,d,e) +#endif + +#ifdef __VXWORKS__ +# include /* for generic BSD socket functions */ +# include /* for basic I/O interface functions */ +#endif + +#ifdef __AMIGA__ +# ifndef __ixemul__ +# include +# include +# include +# include +# define select(a,b,c,d,e) WaitSelect(a,b,c,d,e,0) +# endif +#endif + +#include +#ifdef HAVE_ASSERT_H +#include +#endif + +#ifdef __TANDEM /* for nsr-tandem-nsk systems */ +#include +#endif + +#ifndef STDC_HEADERS /* no standard C headers! */ +#include +#endif + +#ifdef __POCC__ +# include +# include +# define sys_nerr EILSEQ +#endif + +/* + * Salford-C kludge section (mostly borrowed from wxWidgets). + */ +#ifdef __SALFORDC__ + #pragma suppress 353 /* Possible nested comments */ + #pragma suppress 593 /* Define not used */ + #pragma suppress 61 /* enum has no name */ + #pragma suppress 106 /* unnamed, unused parameter */ + #include +#endif + +/* + * Large file (>2Gb) support using WIN32 functions. + */ + +#ifdef USE_WIN32_LARGE_FILES +# include +# include +# include +# undef lseek +# define lseek(fdes,offset,whence) _lseeki64(fdes, offset, whence) +# define fstat(fdes,stp) _fstati64(fdes, stp) +# define stat(fname,stp) _stati64(fname, stp) +# define struct_stat struct _stati64 +# define LSEEK_ERROR (__int64)-1 +#endif + +/* + * Small file (<2Gb) support using WIN32 functions. + */ + +#ifdef USE_WIN32_SMALL_FILES +# include +# include +# include +# ifndef _WIN32_WCE +# undef lseek +# define lseek(fdes,offset,whence) _lseek(fdes, (long)offset, whence) +# define fstat(fdes,stp) _fstat(fdes, stp) +# define stat(fname,stp) _stat(fname, stp) +# define struct_stat struct _stat +# endif +# define LSEEK_ERROR (long)-1 +#endif + +#ifndef struct_stat +# define struct_stat struct stat +#endif + +#ifndef LSEEK_ERROR +# define LSEEK_ERROR (off_t)-1 +#endif + +/* + * Default sizeof(off_t) in case it hasn't been defined in config file. + */ + +#ifndef SIZEOF_OFF_T +# if defined(__VMS) && !defined(__VAX) +# if defined(_LARGEFILE) +# define SIZEOF_OFF_T 8 +# endif +# elif defined(__OS400__) && defined(__ILEC400__) +# if defined(_LARGE_FILES) +# define SIZEOF_OFF_T 8 +# endif +# elif defined(__MVS__) && defined(__IBMC__) +# if defined(_LP64) || defined(_LARGE_FILES) +# define SIZEOF_OFF_T 8 +# endif +# elif defined(__370__) && defined(__IBMC__) +# if defined(_LP64) || defined(_LARGE_FILES) +# define SIZEOF_OFF_T 8 +# endif +# endif +# ifndef SIZEOF_OFF_T +# define SIZEOF_OFF_T 4 +# endif +#endif + +/* + * Arg 2 type for gethostname in case it hasn't been defined in config file. + */ + +#ifndef GETHOSTNAME_TYPE_ARG2 +# ifdef USE_WINSOCK +# define GETHOSTNAME_TYPE_ARG2 int +# else +# define GETHOSTNAME_TYPE_ARG2 size_t +# endif +#endif + +/* Below we define some functions. They should + + 4. set the SIGALRM signal timeout + 5. set dir/file naming defines + */ + +#ifdef WIN32 + +# define DIR_CHAR "\\" +# define DOT_CHAR "_" + +#else /* WIN32 */ + +# ifdef MSDOS /* Watt-32 */ + +# include +# define select(n,r,w,x,t) select_s(n,r,w,x,t) +# define ioctl(x,y,z) ioctlsocket(x,y,(char *)(z)) +# include +# ifdef word +# undef word +# endif +# ifdef byte +# undef byte +# endif + +# endif /* MSDOS */ + +# ifdef __minix + /* Minix 3 versions up to at least 3.1.3 are missing these prototypes */ + extern char * strtok_r(char *s, const char *delim, char **last); + extern struct tm * gmtime_r(const time_t * const timep, struct tm *tmp); +# endif + +# define DIR_CHAR "/" +# ifndef DOT_CHAR +# define DOT_CHAR "." +# endif + +# ifdef MSDOS +# undef DOT_CHAR +# define DOT_CHAR "_" +# endif + +# ifndef fileno /* sunos 4 have this as a macro! */ + int fileno( FILE *stream); +# endif + +#endif /* WIN32 */ + +/* + * msvc 6.0 requires PSDK in order to have INET6_ADDRSTRLEN + * defined in ws2tcpip.h as well as to provide IPv6 support. + */ + +#if defined(_MSC_VER) && !defined(__POCC__) +# if !defined(HAVE_WS2TCPIP_H) || \ + ((_MSC_VER < 1300) && !defined(INET6_ADDRSTRLEN)) +# undef HAVE_GETADDRINFO_THREADSAFE +# undef HAVE_FREEADDRINFO +# undef HAVE_GETADDRINFO +# undef HAVE_GETNAMEINFO +# undef ENABLE_IPV6 +# endif +#endif + +/* ---------------------------------------------------------------- */ +/* resolver specialty compile-time defines */ +/* CURLRES_* defines to use in the host*.c sources */ +/* ---------------------------------------------------------------- */ + +/* + * lcc-win32 doesn't have _beginthreadex(), lacks threads support. + */ + +#if defined(__LCC__) && defined(WIN32) +# undef USE_THREADS_POSIX +# undef USE_THREADS_WIN32 +#endif + +/* + * MSVC threads support requires a multi-threaded runtime library. + * _beginthreadex() is not available in single-threaded ones. + */ + +#if defined(_MSC_VER) && !defined(__POCC__) && !defined(_MT) +# undef USE_THREADS_POSIX +# undef USE_THREADS_WIN32 +#endif + +/* + * Mutually exclusive CURLRES_* definitions. + */ + +#ifdef USE_ARES +# define CURLRES_ASYNCH +# define CURLRES_ARES +/* now undef the stock libc functions just to avoid them being used */ +# undef HAVE_GETADDRINFO +# undef HAVE_GETHOSTBYNAME +#elif defined(USE_THREADS_POSIX) || defined(USE_THREADS_WIN32) +# define CURLRES_ASYNCH +# define CURLRES_THREADED +#else +# define CURLRES_SYNCH +#endif + +#ifdef ENABLE_IPV6 +# define CURLRES_IPV6 +#else +# define CURLRES_IPV4 +#endif + +/* ---------------------------------------------------------------- */ + +/* + * When using WINSOCK, TELNET protocol requires WINSOCK2 API. + */ + +#if defined(USE_WINSOCK) && (USE_WINSOCK != 2) +# define CURL_DISABLE_TELNET 1 +#endif + +/* + * msvc 6.0 does not have struct sockaddr_storage and + * does not define IPPROTO_ESP in winsock2.h. But both + * are available if PSDK is properly installed. + */ + +#if defined(_MSC_VER) && !defined(__POCC__) +# if !defined(HAVE_WINSOCK2_H) || ((_MSC_VER < 1300) && !defined(IPPROTO_ESP)) +# undef HAVE_STRUCT_SOCKADDR_STORAGE +# endif +#endif + +/* + * Intentionally fail to build when using msvc 6.0 without PSDK installed. + * The brave of heart can circumvent this, defining ALLOW_MSVC6_WITHOUT_PSDK + * in lib/config-win32.h although absolutely discouraged and unsupported. + */ + +#if defined(_MSC_VER) && !defined(__POCC__) +# if !defined(HAVE_WINDOWS_H) || ((_MSC_VER < 1300) && !defined(_FILETIME_)) +# if !defined(ALLOW_MSVC6_WITHOUT_PSDK) +# error MSVC 6.0 requires "February 2003 Platform SDK" a.k.a. \ + "Windows Server 2003 PSDK" +# else +# define CURL_DISABLE_LDAP 1 +# endif +# endif +#endif + +#ifdef NETWARE +int netware_init(void); +#ifndef __NOVELL_LIBC__ +#include +#include +#endif +#endif + +#if defined(HAVE_LIBIDN) && defined(HAVE_TLD_H) +/* The lib was present and the tld.h header (which is missing in libidn 0.3.X + but we only work with libidn 0.4.1 or later) */ +#define USE_LIBIDN +#endif + +#ifndef SIZEOF_TIME_T +/* assume default size of time_t to be 32 bit */ +#define SIZEOF_TIME_T 4 +#endif + +#define LIBIDN_REQUIRED_VERSION "0.4.1" + +#if defined(USE_GNUTLS) || defined(USE_SSLEAY) || defined(USE_NSS) || \ + defined(USE_QSOSSL) || defined(USE_POLARSSL) || defined(USE_AXTLS) || \ + defined(USE_CYASSL) || defined(USE_SCHANNEL) || \ + defined(USE_DARWINSSL) +#define USE_SSL /* SSL support has been enabled */ +#endif + +#if defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI) +#define USE_HTTP_NEGOTIATE +#endif + +/* Single point where USE_NTLM definition might be done */ +#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_NTLM) +#if defined(USE_SSLEAY) || defined(USE_WINDOWS_SSPI) || \ + defined(USE_GNUTLS) || defined(USE_NSS) || defined(USE_DARWINSSL) +#define USE_NTLM +#endif +#endif + +/* non-configure builds may define CURL_WANTS_CA_BUNDLE_ENV */ +#if defined(CURL_WANTS_CA_BUNDLE_ENV) && !defined(CURL_CA_BUNDLE) +#define CURL_CA_BUNDLE getenv("CURL_CA_BUNDLE") +#endif + +/* + * Provide a mechanism to silence picky compilers, such as gcc 4.6+. + * Parameters should of course normally not be unused, but for example when + * we have multiple implementations of the same interface it may happen. + */ + +#if defined(__GNUC__) && ((__GNUC__ >= 3) || \ + ((__GNUC__ == 2) && defined(__GNUC_MINOR__) && (__GNUC_MINOR__ >= 7))) +# define UNUSED_PARAM __attribute__((__unused__)) +#else +# define UNUSED_PARAM /*NOTHING*/ +#endif + +/* + * Include macros and defines that should only be processed once. + */ + +#include "curl_setup_once.h" + +/* + * Definition of our NOP statement Object-like macro + */ + +#ifndef Curl_nop_stmt +# define Curl_nop_stmt do { } WHILE_FALSE +#endif + +/* + * Ensure that Winsock and lwIP TCP/IP stacks are not mixed. + */ + +#if defined(__LWIP_OPT_H__) +# if defined(SOCKET) || \ + defined(USE_WINSOCK) || \ + defined(HAVE_WINSOCK_H) || \ + defined(HAVE_WINSOCK2_H) || \ + defined(HAVE_WS2TCPIP_H) +# error "Winsock and lwIP TCP/IP stack definitions shall not coexist!" +# endif +#endif + +/* + * Portable symbolic names for Winsock shutdown() mode flags. + */ + +#ifdef USE_WINSOCK +# define SHUT_RD 0x00 +# define SHUT_WR 0x01 +# define SHUT_RDWR 0x02 +#endif + +/* Define S_ISREG if not defined by system headers, f.e. MSVC */ +#if !defined(S_ISREG) && defined(S_IFMT) && defined(S_IFREG) +#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) +#endif + +#endif /* HEADER_CURL_SETUP_H */ diff --git a/lib/curl_setup_once.h b/lib/curl_setup_once.h new file mode 100644 index 000000000..57d3ea945 --- /dev/null +++ b/lib/curl_setup_once.h @@ -0,0 +1,560 @@ +#ifndef HEADER_CURL_SETUP_ONCE_H +#define HEADER_CURL_SETUP_ONCE_H +/*************************************************************************** + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * + * 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 + * are also available at http://curl.haxx.se/docs/copyright.html. + * + * You may opt to use, copy, modify, merge, publish, distribute and/or sell + * copies of the Software, and permit persons to whom the Software is + * furnished to do so, under the terms of the COPYING file. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ***************************************************************************/ + + +/* + * Inclusion of common header files. + */ + +#include +#include +#include +#include +#include + +#ifdef HAVE_ERRNO_H +#include +#endif + +#ifdef HAVE_SYS_TYPES_H +#include +#endif + +#ifdef NEED_MALLOC_H +#include +#endif + +#ifdef NEED_MEMORY_H +#include +#endif + +#ifdef HAVE_SYS_STAT_H +#include +#endif + +#ifdef HAVE_SYS_TIME_H +#include +#ifdef TIME_WITH_SYS_TIME +#include +#endif +#else +#ifdef HAVE_TIME_H +#include +#endif +#endif + +#ifdef WIN32 +#include +#include +#endif + +#if defined(HAVE_STDBOOL_H) && defined(HAVE_BOOL_T) +#include +#endif + +#ifdef HAVE_UNISTD_H +#include +#endif + +#ifdef __hpux +# if !defined(_XOPEN_SOURCE_EXTENDED) || defined(_KERNEL) +# ifdef _APP32_64BIT_OFF_T +# define OLD_APP32_64BIT_OFF_T _APP32_64BIT_OFF_T +# undef _APP32_64BIT_OFF_T +# else +# undef OLD_APP32_64BIT_OFF_T +# endif +# endif +#endif + +#ifdef HAVE_SYS_SOCKET_H +#include +#endif + +#ifdef __hpux +# if !defined(_XOPEN_SOURCE_EXTENDED) || defined(_KERNEL) +# ifdef OLD_APP32_64BIT_OFF_T +# define _APP32_64BIT_OFF_T OLD_APP32_64BIT_OFF_T +# undef OLD_APP32_64BIT_OFF_T +# endif +# endif +#endif + + +/* + * Definition of timeval struct for platforms that don't have it. + */ + +#ifndef HAVE_STRUCT_TIMEVAL +struct timeval { + long tv_sec; + long tv_usec; +}; +#endif + + +/* + * If we have the MSG_NOSIGNAL define, make sure we use + * it as the fourth argument of function send() + */ + +#ifdef HAVE_MSG_NOSIGNAL +#define SEND_4TH_ARG MSG_NOSIGNAL +#else +#define SEND_4TH_ARG 0 +#endif + + +#if defined(__minix) +/* Minix doesn't support recv on TCP sockets */ +#define sread(x,y,z) (ssize_t)read((RECV_TYPE_ARG1)(x), \ + (RECV_TYPE_ARG2)(y), \ + (RECV_TYPE_ARG3)(z)) + +#elif defined(HAVE_RECV) +/* + * The definitions for the return type and arguments types + * of functions recv() and send() belong and come from the + * configuration file. Do not define them in any other place. + * + * HAVE_RECV is defined if you have a function named recv() + * which is used to read incoming data from sockets. If your + * function has another name then don't define HAVE_RECV. + * + * If HAVE_RECV is defined then RECV_TYPE_ARG1, RECV_TYPE_ARG2, + * RECV_TYPE_ARG3, RECV_TYPE_ARG4 and RECV_TYPE_RETV must also + * be defined. + * + * HAVE_SEND is defined if you have a function named send() + * which is used to write outgoing data on a connected socket. + * If yours has another name then don't define HAVE_SEND. + * + * If HAVE_SEND is defined then SEND_TYPE_ARG1, SEND_QUAL_ARG2, + * SEND_TYPE_ARG2, SEND_TYPE_ARG3, SEND_TYPE_ARG4 and + * SEND_TYPE_RETV must also be defined. + */ + +#if !defined(RECV_TYPE_ARG1) || \ + !defined(RECV_TYPE_ARG2) || \ + !defined(RECV_TYPE_ARG3) || \ + !defined(RECV_TYPE_ARG4) || \ + !defined(RECV_TYPE_RETV) + /* */ + Error Missing_definition_of_return_and_arguments_types_of_recv + /* */ +#else +#define sread(x,y,z) (ssize_t)recv((RECV_TYPE_ARG1)(x), \ + (RECV_TYPE_ARG2)(y), \ + (RECV_TYPE_ARG3)(z), \ + (RECV_TYPE_ARG4)(0)) +#endif +#else /* HAVE_RECV */ +#ifndef sread + /* */ + Error Missing_definition_of_macro_sread + /* */ +#endif +#endif /* HAVE_RECV */ + + +#if defined(__minix) +/* Minix doesn't support send on TCP sockets */ +#define swrite(x,y,z) (ssize_t)write((SEND_TYPE_ARG1)(x), \ + (SEND_TYPE_ARG2)(y), \ + (SEND_TYPE_ARG3)(z)) + +#elif defined(HAVE_SEND) +#if !defined(SEND_TYPE_ARG1) || \ + !defined(SEND_QUAL_ARG2) || \ + !defined(SEND_TYPE_ARG2) || \ + !defined(SEND_TYPE_ARG3) || \ + !defined(SEND_TYPE_ARG4) || \ + !defined(SEND_TYPE_RETV) + /* */ + Error Missing_definition_of_return_and_arguments_types_of_send + /* */ +#else +#define swrite(x,y,z) (ssize_t)send((SEND_TYPE_ARG1)(x), \ + (SEND_TYPE_ARG2)(y), \ + (SEND_TYPE_ARG3)(z), \ + (SEND_TYPE_ARG4)(SEND_4TH_ARG)) +#endif +#else /* HAVE_SEND */ +#ifndef swrite + /* */ + Error Missing_definition_of_macro_swrite + /* */ +#endif +#endif /* HAVE_SEND */ + + +#if 0 +#if defined(HAVE_RECVFROM) +/* + * Currently recvfrom is only used on udp sockets. + */ +#if !defined(RECVFROM_TYPE_ARG1) || \ + !defined(RECVFROM_TYPE_ARG2) || \ + !defined(RECVFROM_TYPE_ARG3) || \ + !defined(RECVFROM_TYPE_ARG4) || \ + !defined(RECVFROM_TYPE_ARG5) || \ + !defined(RECVFROM_TYPE_ARG6) || \ + !defined(RECVFROM_TYPE_RETV) + /* */ + Error Missing_definition_of_return_and_arguments_types_of_recvfrom + /* */ +#else +#define sreadfrom(s,b,bl,f,fl) (ssize_t)recvfrom((RECVFROM_TYPE_ARG1) (s), \ + (RECVFROM_TYPE_ARG2 *)(b), \ + (RECVFROM_TYPE_ARG3) (bl), \ + (RECVFROM_TYPE_ARG4) (0), \ + (RECVFROM_TYPE_ARG5 *)(f), \ + (RECVFROM_TYPE_ARG6 *)(fl)) +#endif +#else /* HAVE_RECVFROM */ +#ifndef sreadfrom + /* */ + Error Missing_definition_of_macro_sreadfrom + /* */ +#endif +#endif /* HAVE_RECVFROM */ + + +#ifdef RECVFROM_TYPE_ARG6_IS_VOID +# define RECVFROM_ARG6_T int +#else +# define RECVFROM_ARG6_T RECVFROM_TYPE_ARG6 +#endif +#endif /* if 0 */ + + +/* + * Function-like macro definition used to close a socket. + */ + +#if defined(HAVE_CLOSESOCKET) +# define sclose(x) closesocket((x)) +#elif defined(HAVE_CLOSESOCKET_CAMEL) +# define sclose(x) CloseSocket((x)) +#elif defined(USE_LWIPSOCK) +# define sclose(x) lwip_close((x)) +#else +# define sclose(x) close((x)) +#endif + +/* + * Stack-independent version of fcntl() on sockets: + */ +#if defined(USE_LWIPSOCK) +# define sfcntl lwip_fcntl +#else +# define sfcntl fcntl +#endif + +/* + * Uppercase macro versions of ANSI/ISO is*() functions/macros which + * avoid negative number inputs with argument byte codes > 127. + */ + +#define ISSPACE(x) (isspace((int) ((unsigned char)x))) +#define ISDIGIT(x) (isdigit((int) ((unsigned char)x))) +#define ISALNUM(x) (isalnum((int) ((unsigned char)x))) +#define ISXDIGIT(x) (isxdigit((int) ((unsigned char)x))) +#define ISGRAPH(x) (isgraph((int) ((unsigned char)x))) +#define ISALPHA(x) (isalpha((int) ((unsigned char)x))) +#define ISPRINT(x) (isprint((int) ((unsigned char)x))) +#define ISUPPER(x) (isupper((int) ((unsigned char)x))) +#define ISLOWER(x) (islower((int) ((unsigned char)x))) +#define ISASCII(x) (isascii((int) ((unsigned char)x))) + +#define ISBLANK(x) (int)((((unsigned char)x) == ' ') || \ + (((unsigned char)x) == '\t')) + +#define TOLOWER(x) (tolower((int) ((unsigned char)x))) + + +/* + * 'bool' stuff compatible with HP-UX headers. + */ + +#if defined(__hpux) && !defined(HAVE_BOOL_T) + typedef int bool; +# define false 0 +# define true 1 +# define HAVE_BOOL_T +#endif + + +/* + * 'bool' exists on platforms with , i.e. C99 platforms. + * On non-C99 platforms there's no bool, so define an enum for that. + * On C99 platforms 'false' and 'true' also exist. Enum uses a + * global namespace though, so use bool_false and bool_true. + */ + +#ifndef HAVE_BOOL_T + typedef enum { + bool_false = 0, + bool_true = 1 + } bool; + +/* + * Use a define to let 'true' and 'false' use those enums. There + * are currently no use of true and false in libcurl proper, but + * there are some in the examples. This will cater for any later + * code happening to use true and false. + */ +# define false bool_false +# define true bool_true +# define HAVE_BOOL_T +#endif + + +/* + * Redefine TRUE and FALSE too, to catch current use. With this + * change, 'bool found = 1' will give a warning on MIPSPro, but + * 'bool found = TRUE' will not. Change tested on IRIX/MIPSPro, + * AIX 5.1/Xlc, Tru64 5.1/cc, w/make test too. + */ + +#ifndef TRUE +#define TRUE true +#endif +#ifndef FALSE +#define FALSE false +#endif + + +/* + * Macro WHILE_FALSE may be used to build single-iteration do-while loops, + * avoiding compiler warnings. Mostly intended for other macro definitions. + */ + +#define WHILE_FALSE while(0) + +#if defined(_MSC_VER) && !defined(__POCC__) +# undef WHILE_FALSE +# if (_MSC_VER < 1500) +# define WHILE_FALSE while(1, 0) +# else +# define WHILE_FALSE \ +__pragma(warning(push)) \ +__pragma(warning(disable:4127)) \ +while(0) \ +__pragma(warning(pop)) +# endif +#endif + + +/* + * Typedef to 'int' if sig_atomic_t is not an available 'typedefed' type. + */ + +#ifndef HAVE_SIG_ATOMIC_T +typedef int sig_atomic_t; +#define HAVE_SIG_ATOMIC_T +#endif + + +/* + * Convenience SIG_ATOMIC_T definition + */ + +#ifdef HAVE_SIG_ATOMIC_T_VOLATILE +#define SIG_ATOMIC_T static sig_atomic_t +#else +#define SIG_ATOMIC_T static volatile sig_atomic_t +#endif + + +/* + * Default return type for signal handlers. + */ + +#ifndef RETSIGTYPE +#define RETSIGTYPE void +#endif + + +/* + * Macro used to include code only in debug builds. + */ + +#ifdef DEBUGBUILD +#define DEBUGF(x) x +#else +#define DEBUGF(x) do { } WHILE_FALSE +#endif + + +/* + * Macro used to include assertion code only in debug builds. + */ + +#if defined(DEBUGBUILD) && defined(HAVE_ASSERT_H) +#define DEBUGASSERT(x) assert(x) +#else +#define DEBUGASSERT(x) do { } WHILE_FALSE +#endif + + +/* + * Macro SOCKERRNO / SET_SOCKERRNO() returns / sets the *socket-related* errno + * (or equivalent) on this platform to hide platform details to code using it. + */ + +#ifdef USE_WINSOCK +#define SOCKERRNO ((int)WSAGetLastError()) +#define SET_SOCKERRNO(x) (WSASetLastError((int)(x))) +#else +#define SOCKERRNO (errno) +#define SET_SOCKERRNO(x) (errno = (x)) +#endif + + +/* + * Macro ERRNO / SET_ERRNO() returns / sets the NOT *socket-related* errno + * (or equivalent) on this platform to hide platform details to code using it. + */ + +#ifdef WIN32 +#define ERRNO ((int)GetLastError()) +#define SET_ERRNO(x) (SetLastError((DWORD)(x))) +#else +#define ERRNO (errno) +#define SET_ERRNO(x) (errno = (x)) +#endif + + +/* + * Portable error number symbolic names defined to Winsock error codes. + */ + +#ifdef USE_WINSOCK +#undef EBADF /* override definition in errno.h */ +#define EBADF WSAEBADF +#undef EINTR /* override definition in errno.h */ +#define EINTR WSAEINTR +#undef EINVAL /* override definition in errno.h */ +#define EINVAL WSAEINVAL +#undef EWOULDBLOCK /* override definition in errno.h */ +#define EWOULDBLOCK WSAEWOULDBLOCK +#undef EINPROGRESS /* override definition in errno.h */ +#define EINPROGRESS WSAEINPROGRESS +#undef EALREADY /* override definition in errno.h */ +#define EALREADY WSAEALREADY +#undef ENOTSOCK /* override definition in errno.h */ +#define ENOTSOCK WSAENOTSOCK +#undef EDESTADDRREQ /* override definition in errno.h */ +#define EDESTADDRREQ WSAEDESTADDRREQ +#undef EMSGSIZE /* override definition in errno.h */ +#define EMSGSIZE WSAEMSGSIZE +#undef EPROTOTYPE /* override definition in errno.h */ +#define EPROTOTYPE WSAEPROTOTYPE +#undef ENOPROTOOPT /* override definition in errno.h */ +#define ENOPROTOOPT WSAENOPROTOOPT +#undef EPROTONOSUPPORT /* override definition in errno.h */ +#define EPROTONOSUPPORT WSAEPROTONOSUPPORT +#define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT +#undef EOPNOTSUPP /* override definition in errno.h */ +#define EOPNOTSUPP WSAEOPNOTSUPP +#define EPFNOSUPPORT WSAEPFNOSUPPORT +#undef EAFNOSUPPORT /* override definition in errno.h */ +#define EAFNOSUPPORT WSAEAFNOSUPPORT +#undef EADDRINUSE /* override definition in errno.h */ +#define EADDRINUSE WSAEADDRINUSE +#undef EADDRNOTAVAIL /* override definition in errno.h */ +#define EADDRNOTAVAIL WSAEADDRNOTAVAIL +#undef ENETDOWN /* override definition in errno.h */ +#define ENETDOWN WSAENETDOWN +#undef ENETUNREACH /* override definition in errno.h */ +#define ENETUNREACH WSAENETUNREACH +#undef ENETRESET /* override definition in errno.h */ +#define ENETRESET WSAENETRESET +#undef ECONNABORTED /* override definition in errno.h */ +#define ECONNABORTED WSAECONNABORTED +#undef ECONNRESET /* override definition in errno.h */ +#define ECONNRESET WSAECONNRESET +#undef ENOBUFS /* override definition in errno.h */ +#define ENOBUFS WSAENOBUFS +#undef EISCONN /* override definition in errno.h */ +#define EISCONN WSAEISCONN +#undef ENOTCONN /* override definition in errno.h */ +#define ENOTCONN WSAENOTCONN +#define ESHUTDOWN WSAESHUTDOWN +#define ETOOMANYREFS WSAETOOMANYREFS +#undef ETIMEDOUT /* override definition in errno.h */ +#define ETIMEDOUT WSAETIMEDOUT +#undef ECONNREFUSED /* override definition in errno.h */ +#define ECONNREFUSED WSAECONNREFUSED +#undef ELOOP /* override definition in errno.h */ +#define ELOOP WSAELOOP +#ifndef ENAMETOOLONG /* possible previous definition in errno.h */ +#define ENAMETOOLONG WSAENAMETOOLONG +#endif +#define EHOSTDOWN WSAEHOSTDOWN +#undef EHOSTUNREACH /* override definition in errno.h */ +#define EHOSTUNREACH WSAEHOSTUNREACH +#ifndef ENOTEMPTY /* possible previous definition in errno.h */ +#define ENOTEMPTY WSAENOTEMPTY +#endif +#define EPROCLIM WSAEPROCLIM +#define EUSERS WSAEUSERS +#define EDQUOT WSAEDQUOT +#define ESTALE WSAESTALE +#define EREMOTE WSAEREMOTE +#endif + + +/* + * Actually use __32_getpwuid() on 64-bit VMS builds for getpwuid() + */ + +#if defined(__VMS) && \ + defined(__INITIAL_POINTER_SIZE) && (__INITIAL_POINTER_SIZE == 64) +#define getpwuid __32_getpwuid +#endif + + +/* + * Macro argv_item_t hides platform details to code using it. + */ + +#ifdef __VMS +#define argv_item_t __char_ptr32 +#else +#define argv_item_t char * +#endif + + +/* + * We use this ZERO_NULL to avoid picky compiler warnings, + * when assigning a NULL pointer to a function pointer var. + */ + +#define ZERO_NULL 0 + + +#endif /* HEADER_CURL_SETUP_ONCE_H */ + diff --git a/lib/curl_sspi.c b/lib/curl_sspi.c index c3c41ec2f..e747d86b1 100644 --- a/lib/curl_sspi.c +++ b/lib/curl_sspi.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifdef USE_WINDOWS_SSPI diff --git a/lib/curl_sspi.h b/lib/curl_sspi.h index c3e6d9760..d52582856 100644 --- a/lib/curl_sspi.h +++ b/lib/curl_sspi.h @@ -22,7 +22,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifdef USE_WINDOWS_SSPI diff --git a/lib/curl_threads.c b/lib/curl_threads.c index 411ccc81d..c9e91f63a 100644 --- a/lib/curl_threads.c +++ b/lib/curl_threads.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #if defined(USE_THREADS_POSIX) # ifdef HAVE_PTHREAD_H diff --git a/lib/curl_threads.h b/lib/curl_threads.h index ba81054a2..d9cec6b29 100644 --- a/lib/curl_threads.h +++ b/lib/curl_threads.h @@ -21,7 +21,7 @@ * KIND, either express or implied. * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #if defined(USE_THREADS_POSIX) # define CURL_STDCALL diff --git a/lib/cyassl.c b/lib/cyassl.c index 13c0d135d..7c78464d8 100644 --- a/lib/cyassl.c +++ b/lib/cyassl.c @@ -26,7 +26,7 @@ * */ -#include "setup.h" +#include "curl_setup.h" #ifdef USE_CYASSL diff --git a/lib/cyassl.h b/lib/cyassl.h index 56d68066f..7728a0cf5 100644 --- a/lib/cyassl.h +++ b/lib/cyassl.h @@ -21,7 +21,7 @@ * KIND, either express or implied. * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifdef USE_CYASSL diff --git a/lib/dict.c b/lib/dict.c index ca5c362b1..f5c892197 100644 --- a/lib/dict.c +++ b/lib/dict.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifndef CURL_DISABLE_DICT diff --git a/lib/easy.c b/lib/easy.c index b73bf6601..700fb327b 100644 --- a/lib/easy.c +++ b/lib/easy.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifdef HAVE_NETINET_IN_H #include diff --git a/lib/escape.c b/lib/escape.c index 0dd5a1d0a..6a26cf8ef 100644 --- a/lib/escape.c +++ b/lib/escape.c @@ -23,7 +23,7 @@ /* Escape and unescape URL encoding in strings. The functions return a new * allocated string or NULL if an error occurred. */ -#include "setup.h" +#include "curl_setup.h" #include diff --git a/lib/file.c b/lib/file.c index 886a09e24..038bf42e1 100644 --- a/lib/file.c +++ b/lib/file.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifndef CURL_DISABLE_FILE diff --git a/lib/fileinfo.c b/lib/fileinfo.c index 4ffcbbe29..8c8ee981a 100644 --- a/lib/fileinfo.c +++ b/lib/fileinfo.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #include "strdup.h" #include "fileinfo.h" diff --git a/lib/formdata.c b/lib/formdata.c index 7bf883941..6d78b795e 100644 --- a/lib/formdata.c +++ b/lib/formdata.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #include diff --git a/lib/ftp.c b/lib/ftp.c index dc24d0bb5..29b9743ec 100644 --- a/lib/ftp.c +++ b/lib/ftp.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifndef CURL_DISABLE_FTP diff --git a/lib/ftplistparser.c b/lib/ftplistparser.c index 49ee4b6a6..cb3601f58 100644 --- a/lib/ftplistparser.c +++ b/lib/ftplistparser.c @@ -35,7 +35,7 @@ * 01-29-97 11:32PM prog */ -#include "setup.h" +#include "curl_setup.h" #ifndef CURL_DISABLE_FTP diff --git a/lib/ftplistparser.h b/lib/ftplistparser.h index 8499ccda4..96764e2a4 100644 --- a/lib/ftplistparser.h +++ b/lib/ftplistparser.h @@ -21,7 +21,7 @@ * KIND, either express or implied. * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifndef CURL_DISABLE_FTP diff --git a/lib/getenv.c b/lib/getenv.c index a2d69830e..19da29a2d 100644 --- a/lib/getenv.c +++ b/lib/getenv.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifdef __VMS #include diff --git a/lib/getinfo.c b/lib/getinfo.c index 221f05a4f..74e5b0893 100644 --- a/lib/getinfo.c +++ b/lib/getinfo.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #include diff --git a/lib/gopher.c b/lib/gopher.c index e8f2790fc..b1dd65fff 100644 --- a/lib/gopher.c +++ b/lib/gopher.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifndef CURL_DISABLE_GOPHER diff --git a/lib/gtls.c b/lib/gtls.c index 8c2a4a0c9..700e46a9d 100644 --- a/lib/gtls.c +++ b/lib/gtls.c @@ -28,7 +28,7 @@ * since they were not present in 1.0.X. */ -#include "setup.h" +#include "curl_setup.h" #ifdef USE_GNUTLS @@ -94,7 +94,8 @@ static bool gtls_inited = FALSE; /* * Custom push and pull callback functions used by GNU TLS to read and write * to the socket. These functions are simple wrappers to send() and recv() - * (although here using the sread/swrite macros as defined by setup_once.h). + * (although here using the sread/swrite macros as defined by + * curl_setup_once.h). * We use custom functions rather than the GNU TLS defaults because it allows * us to get specific about the fourth "flags" argument, and to use arbitrary * private data with gnutls_transport_set_ptr if we wish. diff --git a/lib/gtls.h b/lib/gtls.h index 45b755a0e..84e1396b5 100644 --- a/lib/gtls.h +++ b/lib/gtls.h @@ -22,7 +22,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifdef USE_GNUTLS diff --git a/lib/hash.c b/lib/hash.c index b59e56146..0a8e99ab2 100644 --- a/lib/hash.c +++ b/lib/hash.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #include "hash.h" #include "llist.h" diff --git a/lib/hash.h b/lib/hash.h index 3fa621cb1..99a627405 100644 --- a/lib/hash.h +++ b/lib/hash.h @@ -22,7 +22,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #include diff --git a/lib/hmac.c b/lib/hmac.c index 4df6f79ad..dace82037 100644 --- a/lib/hmac.c +++ b/lib/hmac.c @@ -22,7 +22,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifndef CURL_DISABLE_CRYPTO_AUTH diff --git a/lib/hostasyn.c b/lib/hostasyn.c index 93e2c31cd..8151b6714 100644 --- a/lib/hostasyn.c +++ b/lib/hostasyn.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifdef HAVE_NETINET_IN_H #include diff --git a/lib/hostcheck.c b/lib/hostcheck.c index 8affce044..44ad822f0 100644 --- a/lib/hostcheck.c +++ b/lib/hostcheck.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #if defined(USE_SSLEAY) || defined(USE_AXTLS) /* these two backends use functions from this file */ diff --git a/lib/hostip.c b/lib/hostip.c index 2bfb74b42..3765ca1cd 100644 --- a/lib/hostip.c +++ b/lib/hostip.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifdef HAVE_NETINET_IN_H #include @@ -106,7 +106,7 @@ * asyn-thread.c - functions for threaded name resolves * The hostip.h is the united header file for all this. It defines the - * CURLRES_* defines based on the config*.h and setup.h defines. + * CURLRES_* defines based on the config*.h and curl_setup.h defines. */ /* These two symbols are for the global DNS cache */ diff --git a/lib/hostip.h b/lib/hostip.h index de71f54f4..9dd47baa6 100644 --- a/lib/hostip.h +++ b/lib/hostip.h @@ -22,7 +22,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #include "hash.h" #include "curl_addrinfo.h" #include "asyn.h" diff --git a/lib/hostip4.c b/lib/hostip4.c index 3babe7269..3a38b321f 100644 --- a/lib/hostip4.c +++ b/lib/hostip4.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifdef HAVE_NETINET_IN_H #include diff --git a/lib/hostip6.c b/lib/hostip6.c index 5b25d6fc4..c42760a64 100644 --- a/lib/hostip6.c +++ b/lib/hostip6.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifdef HAVE_NETINET_IN_H #include diff --git a/lib/hostsyn.c b/lib/hostsyn.c index eff2efa7b..65a403545 100644 --- a/lib/hostsyn.c +++ b/lib/hostsyn.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifdef HAVE_NETINET_IN_H #include diff --git a/lib/http.c b/lib/http.c index 0013e5065..21f7c21e6 100644 --- a/lib/http.c +++ b/lib/http.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifndef CURL_DISABLE_HTTP diff --git a/lib/http_chunks.c b/lib/http_chunks.c index d6a0bec13..e9fddf588 100644 --- a/lib/http_chunks.c +++ b/lib/http_chunks.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifndef CURL_DISABLE_HTTP diff --git a/lib/http_digest.c b/lib/http_digest.c index 17cc95e81..f9f20d487 100644 --- a/lib/http_digest.c +++ b/lib/http_digest.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_CRYPTO_AUTH) diff --git a/lib/http_digest.h b/lib/http_digest.h index 3b22ce10e..c6a4e9161 100644 --- a/lib/http_digest.h +++ b/lib/http_digest.h @@ -21,7 +21,7 @@ * KIND, either express or implied. * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" typedef enum { CURLDIGEST_NONE, /* not a digest */ diff --git a/lib/http_negotiate.c b/lib/http_negotiate.c index 92c363d7c..535a4279e 100644 --- a/lib/http_negotiate.c +++ b/lib/http_negotiate.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifdef HAVE_GSSAPI #ifdef HAVE_OLD_GSSMIT diff --git a/lib/http_negotiate_sspi.c b/lib/http_negotiate_sspi.c index 5aa4f9433..1381d5292 100644 --- a/lib/http_negotiate_sspi.c +++ b/lib/http_negotiate_sspi.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifdef USE_WINDOWS_SSPI diff --git a/lib/http_proxy.c b/lib/http_proxy.c index d2e1aa199..ada89576e 100644 --- a/lib/http_proxy.c +++ b/lib/http_proxy.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #if !defined(CURL_DISABLE_PROXY) && !defined(CURL_DISABLE_HTTP) diff --git a/lib/idn_win32.c b/lib/idn_win32.c index 9bc9cb810..464964bcd 100644 --- a/lib/idn_win32.c +++ b/lib/idn_win32.c @@ -24,7 +24,7 @@ * IDN conversions using Windows kernel32 and normaliz libraries. */ -#include "setup.h" +#include "curl_setup.h" #ifdef USE_WIN32_IDN diff --git a/lib/if2ip.c b/lib/if2ip.c index c1905d175..558e30f15 100644 --- a/lib/if2ip.c +++ b/lib/if2ip.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifdef HAVE_NETINET_IN_H # include diff --git a/lib/if2ip.h b/lib/if2ip.h index 70842457c..858ec2f5b 100644 --- a/lib/if2ip.h +++ b/lib/if2ip.h @@ -21,7 +21,7 @@ * KIND, either express or implied. * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" bool Curl_if_is_interface_name(const char *interf); char *Curl_if2ip(int af, const char *interf, char *buf, int buf_size); diff --git a/lib/imap.c b/lib/imap.c index 0fa1accd7..a53f2e9d2 100644 --- a/lib/imap.c +++ b/lib/imap.c @@ -28,7 +28,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifndef CURL_DISABLE_IMAP diff --git a/lib/inet_ntop.c b/lib/inet_ntop.c index 1ff975667..c32715005 100644 --- a/lib/inet_ntop.c +++ b/lib/inet_ntop.c @@ -18,7 +18,7 @@ * Original code by Paul Vixie. "curlified" by Gisle Vanem. */ -#include "setup.h" +#include "curl_setup.h" #ifndef HAVE_INET_NTOP diff --git a/lib/inet_ntop.h b/lib/inet_ntop.h index dbc146d91..db28ed807 100644 --- a/lib/inet_ntop.h +++ b/lib/inet_ntop.h @@ -22,7 +22,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" char *Curl_inet_ntop(int af, const void *addr, char *buf, size_t size); diff --git a/lib/inet_pton.c b/lib/inet_pton.c index d7fbbe957..f50b365da 100644 --- a/lib/inet_pton.c +++ b/lib/inet_pton.c @@ -16,7 +16,7 @@ * SOFTWARE. */ -#include "setup.h" +#include "curl_setup.h" #ifndef HAVE_INET_PTON diff --git a/lib/inet_pton.h b/lib/inet_pton.h index f991473d6..43c549143 100644 --- a/lib/inet_pton.h +++ b/lib/inet_pton.h @@ -22,7 +22,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" int Curl_inet_pton(int, const char *, void *); diff --git a/lib/krb4.c b/lib/krb4.c index 58354b602..3d789621d 100644 --- a/lib/krb4.c +++ b/lib/krb4.c @@ -39,7 +39,7 @@ * */ -#include "setup.h" +#include "curl_setup.h" #ifndef CURL_DISABLE_FTP #ifdef HAVE_KRB4 diff --git a/lib/krb5.c b/lib/krb5.c index c51041dda..1e99c709e 100644 --- a/lib/krb5.c +++ b/lib/krb5.c @@ -32,7 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ -#include "setup.h" +#include "curl_setup.h" #ifndef CURL_DISABLE_FTP #ifdef HAVE_GSSAPI diff --git a/lib/ldap.c b/lib/ldap.c index 9ef31008c..833ffa445 100644 --- a/lib/ldap.c +++ b/lib/ldap.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #if !defined(CURL_DISABLE_LDAP) && !defined(USE_OPENLDAP) diff --git a/lib/llist.c b/lib/llist.c index a302e32d5..40bb62837 100644 --- a/lib/llist.c +++ b/lib/llist.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #include "llist.h" #include "curl_memory.h" diff --git a/lib/llist.h b/lib/llist.h index b4ca82a44..27ddb719a 100644 --- a/lib/llist.h +++ b/lib/llist.h @@ -22,7 +22,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #include typedef void (*curl_llist_dtor)(void *, void *); diff --git a/lib/md4.c b/lib/md4.c index cf6c36023..6930e021a 100644 --- a/lib/md4.c +++ b/lib/md4.c @@ -20,7 +20,7 @@ documentation and/or software. */ -#include "setup.h" +#include "curl_setup.h" /* NSS crypto library does not provide the MD4 hash algorithm, so that we have * a local implementation of it */ diff --git a/lib/md5.c b/lib/md5.c index ae5812b95..57efa431b 100644 --- a/lib/md5.c +++ b/lib/md5.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifndef CURL_DISABLE_CRYPTO_AUTH diff --git a/lib/memdebug.c b/lib/memdebug.c index c95f41fc5..4d5f44d2f 100644 --- a/lib/memdebug.c +++ b/lib/memdebug.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifdef CURLDEBUG diff --git a/lib/memdebug.h b/lib/memdebug.h index 1716e3598..fbeb61de5 100644 --- a/lib/memdebug.h +++ b/lib/memdebug.h @@ -28,7 +28,7 @@ * as well as the library. Do not mix with library internals! */ -#include "setup.h" +#include "curl_setup.h" #include diff --git a/lib/mprintf.c b/lib/mprintf.c index 0990f4024..b5b81536a 100644 --- a/lib/mprintf.c +++ b/lib/mprintf.c @@ -35,7 +35,7 @@ * page at http://daniel.haxx.se/trio/ */ -#include "setup.h" +#include "curl_setup.h" #if defined(DJGPP) && (DJGPP_MINOR < 4) #undef _MPRINTF_REPLACE /* don't use x_was_used() here */ diff --git a/lib/multi.c b/lib/multi.c index dae1f6b56..de1fc7d6e 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #include diff --git a/lib/netrc.c b/lib/netrc.c index 162a86caa..1b834b821 100644 --- a/lib/netrc.c +++ b/lib/netrc.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifdef HAVE_PWD_H #include diff --git a/lib/non-ascii.c b/lib/non-ascii.c index 8e29227c0..91d6a54fc 100644 --- a/lib/non-ascii.c +++ b/lib/non-ascii.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifdef CURL_DOES_CONVERSIONS diff --git a/lib/non-ascii.h b/lib/non-ascii.h index 6dcbe0044..8b4b7c22e 100644 --- a/lib/non-ascii.h +++ b/lib/non-ascii.h @@ -21,7 +21,7 @@ * KIND, either express or implied. * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifdef CURL_DOES_CONVERSIONS diff --git a/lib/nonblock.c b/lib/nonblock.c index a2722ed7f..1447c877d 100644 --- a/lib/nonblock.c +++ b/lib/nonblock.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifdef HAVE_SYS_IOCTL_H #include diff --git a/lib/nss.c b/lib/nss.c index 86ce6a6d5..298ddad17 100644 --- a/lib/nss.c +++ b/lib/nss.c @@ -25,7 +25,7 @@ * but sslgen.c should ever call or use these functions. */ -#include "setup.h" +#include "curl_setup.h" #ifdef USE_NSS diff --git a/lib/nssg.h b/lib/nssg.h index 647b7bb28..a881a9ad2 100644 --- a/lib/nssg.h +++ b/lib/nssg.h @@ -21,7 +21,7 @@ * KIND, either express or implied. * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifdef USE_NSS /* diff --git a/lib/nwlib.c b/lib/nwlib.c index c67342a08..252bf11ec 100644 --- a/lib/nwlib.c +++ b/lib/nwlib.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifdef NETWARE /* Novell NetWare */ diff --git a/lib/nwos.c b/lib/nwos.c index dd3291155..23ff2a717 100644 --- a/lib/nwos.c +++ b/lib/nwos.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifdef NETWARE /* Novell NetWare */ diff --git a/lib/openldap.c b/lib/openldap.c index 9ccfa7fae..4c395fadc 100644 --- a/lib/openldap.c +++ b/lib/openldap.c @@ -21,7 +21,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #if !defined(CURL_DISABLE_LDAP) && defined(USE_OPENLDAP) diff --git a/lib/parsedate.c b/lib/parsedate.c index b6079bc8f..1ddd0080a 100644 --- a/lib/parsedate.c +++ b/lib/parsedate.c @@ -73,7 +73,7 @@ */ -#include "setup.h" +#include "curl_setup.h" #ifdef HAVE_LIMITS_H #include diff --git a/lib/pingpong.c b/lib/pingpong.c index 85a7a45af..16b4ad37e 100644 --- a/lib/pingpong.c +++ b/lib/pingpong.c @@ -23,7 +23,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #include "urldata.h" #include "sendf.h" diff --git a/lib/pingpong.h b/lib/pingpong.h index 1d104cfbc..b48c1ed61 100644 --- a/lib/pingpong.h +++ b/lib/pingpong.h @@ -22,7 +22,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #if !defined(CURL_DISABLE_IMAP) || !defined(CURL_DISABLE_FTP) || \ !defined(CURL_DISABLE_POP3) || !defined(CURL_DISABLE_SMTP) diff --git a/lib/polarssl.c b/lib/polarssl.c index ef074be13..f4ca63e11 100644 --- a/lib/polarssl.c +++ b/lib/polarssl.c @@ -27,7 +27,7 @@ * */ -#include "setup.h" +#include "curl_setup.h" #ifdef USE_POLARSSL diff --git a/lib/polarssl.h b/lib/polarssl.h index ad655465e..12b3db28c 100644 --- a/lib/polarssl.h +++ b/lib/polarssl.h @@ -21,7 +21,7 @@ * KIND, either express or implied. * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifdef USE_POLARSSL diff --git a/lib/pop3.c b/lib/pop3.c index dcb2e693f..e8fd9c52c 100644 --- a/lib/pop3.c +++ b/lib/pop3.c @@ -30,7 +30,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifndef CURL_DISABLE_POP3 diff --git a/lib/progress.c b/lib/progress.c index e73f01811..4cff2b76e 100644 --- a/lib/progress.c +++ b/lib/progress.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #include "urldata.h" #include "sendf.h" diff --git a/lib/qssl.c b/lib/qssl.c index 172df3141..8ef6fec8d 100644 --- a/lib/qssl.c +++ b/lib/qssl.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifdef USE_QSOSSL diff --git a/lib/qssl.h b/lib/qssl.h index a523cb1f3..1fb47b829 100644 --- a/lib/qssl.h +++ b/lib/qssl.h @@ -21,7 +21,7 @@ * KIND, either express or implied. * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" /* * This header should only be needed to get included by sslgen.c and qssl.c diff --git a/lib/rawstr.c b/lib/rawstr.c index 2cf2fe7cb..e27dac4a8 100644 --- a/lib/rawstr.c +++ b/lib/rawstr.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #include "rawstr.h" diff --git a/lib/rtsp.c b/lib/rtsp.c index ca9788ef7..9d7a9a94b 100644 --- a/lib/rtsp.c +++ b/lib/rtsp.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifndef CURL_DISABLE_RTSP diff --git a/lib/security.c b/lib/security.c index b70310b89..3c46953cb 100644 --- a/lib/security.c +++ b/lib/security.c @@ -41,7 +41,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ -#include "setup.h" +#include "curl_setup.h" #ifndef CURL_DISABLE_FTP #if defined(HAVE_KRB4) || defined(HAVE_GSSAPI) diff --git a/lib/select.c b/lib/select.c index 32b6fa55f..d13e1228a 100644 --- a/lib/select.c +++ b/lib/select.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifdef HAVE_SYS_SELECT_H #include diff --git a/lib/select.h b/lib/select.h index d66873fe9..00789bb89 100644 --- a/lib/select.h +++ b/lib/select.h @@ -22,7 +22,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifdef HAVE_SYS_POLL_H #include diff --git a/lib/sendf.c b/lib/sendf.c index b45e43a32..c64d686b9 100644 --- a/lib/sendf.c +++ b/lib/sendf.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #include diff --git a/lib/sendf.h b/lib/sendf.h index 39911d016..39489e40f 100644 --- a/lib/sendf.h +++ b/lib/sendf.h @@ -22,7 +22,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" CURLcode Curl_sendf(curl_socket_t sockfd, struct connectdata *, const char *fmt, ...); diff --git a/lib/setup.h b/lib/setup.h deleted file mode 100644 index 6d2dc90a8..000000000 --- a/lib/setup.h +++ /dev/null @@ -1,689 +0,0 @@ -#ifndef HEADER_CURL_SETUP_H -#define HEADER_CURL_SETUP_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * 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 - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - ***************************************************************************/ - -/* - * Define WIN32 when build target is Win32 API - */ - -#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32) && \ - !defined(__SYMBIAN32__) -#define WIN32 -#endif - -/* - * Include configuration script results or hand-crafted - * configuration file for platforms which lack config tool. - */ - -#ifdef HAVE_CONFIG_H - -#include "curl_config.h" - -#else /* HAVE_CONFIG_H */ - -#ifdef _WIN32_WCE -# include "config-win32ce.h" -#else -# ifdef WIN32 -# include "config-win32.h" -# endif -#endif - -#if defined(macintosh) && defined(__MRC__) -# include "config-mac.h" -#endif - -#ifdef __riscos__ -# include "config-riscos.h" -#endif - -#ifdef __AMIGA__ -# include "config-amigaos.h" -#endif - -#ifdef __SYMBIAN32__ -# include "config-symbian.h" -#endif - -#ifdef __OS400__ -# include "config-os400.h" -#endif - -#ifdef TPF -# include "config-tpf.h" -#endif - -#ifdef __VXWORKS__ -# include "config-vxworks.h" -#endif - -#endif /* HAVE_CONFIG_H */ - -/* ================================================================ */ -/* Definition of preprocessor macros/symbols which modify compiler */ -/* behavior or generated code characteristics must be done here, */ -/* as appropriate, before any system header file is included. It is */ -/* also possible to have them defined in the config file included */ -/* before this point. As a result of all this we frown inclusion of */ -/* system header files in our config files, avoid this at any cost. */ -/* ================================================================ */ - -/* - * AIX 4.3 and newer needs _THREAD_SAFE defined to build - * proper reentrant code. Others may also need it. - */ - -#ifdef NEED_THREAD_SAFE -# ifndef _THREAD_SAFE -# define _THREAD_SAFE -# endif -#endif - -/* - * Tru64 needs _REENTRANT set for a few function prototypes and - * things to appear in the system header files. Unixware needs it - * to build proper reentrant code. Others may also need it. - */ - -#ifdef NEED_REENTRANT -# ifndef _REENTRANT -# define _REENTRANT -# endif -#endif - -/* ================================================================ */ -/* If you need to include a system header file for your platform, */ -/* please, do it beyond the point further indicated in this file. */ -/* ================================================================ */ - -/* - * libcurl's external interface definitions are also used internally, - * and might also include required system header files to define them. - */ - -#include - -/* - * Compile time sanity checks must also be done when building the library. - */ - -#include - -/* - * Ensure that no one is using the old SIZEOF_CURL_OFF_T macro - */ - -#ifdef SIZEOF_CURL_OFF_T -# error "SIZEOF_CURL_OFF_T shall not be defined!" - Error Compilation_aborted_SIZEOF_CURL_OFF_T_shall_not_be_defined -#endif - -/* - * Set up internal curl_off_t formatting string directives for - * exclusive use with libcurl's internal *printf functions. - */ - -#ifdef FORMAT_OFF_T -# error "FORMAT_OFF_T shall not be defined before this point!" - Error Compilation_aborted_FORMAT_OFF_T_already_defined -#endif - -#ifdef FORMAT_OFF_TU -# error "FORMAT_OFF_TU shall not be defined before this point!" - Error Compilation_aborted_FORMAT_OFF_TU_already_defined -#endif - -#if (CURL_SIZEOF_CURL_OFF_T > CURL_SIZEOF_LONG) -# define FORMAT_OFF_T "lld" -# define FORMAT_OFF_TU "llu" -#else -# define FORMAT_OFF_T "ld" -# define FORMAT_OFF_TU "lu" -#endif - -/* - * Disable other protocols when http is the only one desired. - */ - -#ifdef HTTP_ONLY -# ifndef CURL_DISABLE_TFTP -# define CURL_DISABLE_TFTP -# endif -# ifndef CURL_DISABLE_FTP -# define CURL_DISABLE_FTP -# endif -# ifndef CURL_DISABLE_LDAP -# define CURL_DISABLE_LDAP -# endif -# ifndef CURL_DISABLE_TELNET -# define CURL_DISABLE_TELNET -# endif -# ifndef CURL_DISABLE_DICT -# define CURL_DISABLE_DICT -# endif -# ifndef CURL_DISABLE_FILE -# define CURL_DISABLE_FILE -# endif -# ifndef CURL_DISABLE_RTSP -# define CURL_DISABLE_RTSP -# endif -# ifndef CURL_DISABLE_POP3 -# define CURL_DISABLE_POP3 -# endif -# ifndef CURL_DISABLE_IMAP -# define CURL_DISABLE_IMAP -# endif -# ifndef CURL_DISABLE_SMTP -# define CURL_DISABLE_SMTP -# endif -# ifndef CURL_DISABLE_RTSP -# define CURL_DISABLE_RTSP -# endif -# ifndef CURL_DISABLE_RTMP -# define CURL_DISABLE_RTMP -# endif -# ifndef CURL_DISABLE_GOPHER -# define CURL_DISABLE_GOPHER -# endif -#endif - -/* - * When http is disabled rtsp is not supported. - */ - -#if defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_RTSP) -# define CURL_DISABLE_RTSP -#endif - -/* ================================================================ */ -/* No system header file shall be included in this file before this */ -/* point. The only allowed ones are those included from curlbuild.h */ -/* ================================================================ */ - -/* - * OS/400 setup file includes some system headers. - */ - -#ifdef __OS400__ -# include "setup-os400.h" -#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. ) 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. - */ - -#ifdef HAVE_WINDOWS_H -# if defined(UNICODE) && !defined(_UNICODE) -# define _UNICODE -# endif -# if defined(_UNICODE) && !defined(UNICODE) -# define UNICODE -# endif -# ifndef WIN32_LEAN_AND_MEAN -# define WIN32_LEAN_AND_MEAN -# endif -# include -# ifdef HAVE_WINSOCK2_H -# include -# ifdef HAVE_WS2TCPIP_H -# include -# endif -# else -# ifdef HAVE_WINSOCK_H -# include -# endif -# endif -# include -#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. - */ - -#undef USE_WINSOCK - -#ifdef HAVE_WINSOCK2_H -# define USE_WINSOCK 2 -#else -# ifdef HAVE_WINSOCK_H -# define USE_WINSOCK 1 -# endif -#endif - -#ifdef USE_LWIPSOCK -# include -# include -# include -#endif - -#ifdef HAVE_EXTRA_STRICMP_H -# include -#endif - -#ifdef HAVE_EXTRA_STRDUP_H -# include -#endif - -#ifdef TPF -# include /* for bzero, strcasecmp, and strncasecmp */ -# include /* for strcpy and strlen */ -# include /* for rand and srand */ -# include /* for select and ioctl*/ -# include /* for in_addr_t definition */ -# include /* for tpf_process_signals */ - /* change which select is used for libcurl */ -# define select(a,b,c,d,e) tpf_select_libcurl(a,b,c,d,e) -#endif - -#ifdef __VXWORKS__ -# include /* for generic BSD socket functions */ -# include /* for basic I/O interface functions */ -#endif - -#ifdef __AMIGA__ -# ifndef __ixemul__ -# include -# include -# include -# include -# define select(a,b,c,d,e) WaitSelect(a,b,c,d,e,0) -# endif -#endif - -#include -#ifdef HAVE_ASSERT_H -#include -#endif - -#ifdef __TANDEM /* for nsr-tandem-nsk systems */ -#include -#endif - -#ifndef STDC_HEADERS /* no standard C headers! */ -#include -#endif - -#ifdef __POCC__ -# include -# include -# define sys_nerr EILSEQ -#endif - -/* - * Salford-C kludge section (mostly borrowed from wxWidgets). - */ -#ifdef __SALFORDC__ - #pragma suppress 353 /* Possible nested comments */ - #pragma suppress 593 /* Define not used */ - #pragma suppress 61 /* enum has no name */ - #pragma suppress 106 /* unnamed, unused parameter */ - #include -#endif - -/* - * Large file (>2Gb) support using WIN32 functions. - */ - -#ifdef USE_WIN32_LARGE_FILES -# include -# include -# include -# undef lseek -# define lseek(fdes,offset,whence) _lseeki64(fdes, offset, whence) -# define fstat(fdes,stp) _fstati64(fdes, stp) -# define stat(fname,stp) _stati64(fname, stp) -# define struct_stat struct _stati64 -# define LSEEK_ERROR (__int64)-1 -#endif - -/* - * Small file (<2Gb) support using WIN32 functions. - */ - -#ifdef USE_WIN32_SMALL_FILES -# include -# include -# include -# ifndef _WIN32_WCE -# undef lseek -# define lseek(fdes,offset,whence) _lseek(fdes, (long)offset, whence) -# define fstat(fdes,stp) _fstat(fdes, stp) -# define stat(fname,stp) _stat(fname, stp) -# define struct_stat struct _stat -# endif -# define LSEEK_ERROR (long)-1 -#endif - -#ifndef struct_stat -# define struct_stat struct stat -#endif - -#ifndef LSEEK_ERROR -# define LSEEK_ERROR (off_t)-1 -#endif - -/* - * Default sizeof(off_t) in case it hasn't been defined in config file. - */ - -#ifndef SIZEOF_OFF_T -# if defined(__VMS) && !defined(__VAX) -# if defined(_LARGEFILE) -# define SIZEOF_OFF_T 8 -# endif -# elif defined(__OS400__) && defined(__ILEC400__) -# if defined(_LARGE_FILES) -# define SIZEOF_OFF_T 8 -# endif -# elif defined(__MVS__) && defined(__IBMC__) -# if defined(_LP64) || defined(_LARGE_FILES) -# define SIZEOF_OFF_T 8 -# endif -# elif defined(__370__) && defined(__IBMC__) -# if defined(_LP64) || defined(_LARGE_FILES) -# define SIZEOF_OFF_T 8 -# endif -# endif -# ifndef SIZEOF_OFF_T -# define SIZEOF_OFF_T 4 -# endif -#endif - -/* - * Arg 2 type for gethostname in case it hasn't been defined in config file. - */ - -#ifndef GETHOSTNAME_TYPE_ARG2 -# ifdef USE_WINSOCK -# define GETHOSTNAME_TYPE_ARG2 int -# else -# define GETHOSTNAME_TYPE_ARG2 size_t -# endif -#endif - -/* Below we define some functions. They should - - 4. set the SIGALRM signal timeout - 5. set dir/file naming defines - */ - -#ifdef WIN32 - -# define DIR_CHAR "\\" -# define DOT_CHAR "_" - -#else /* WIN32 */ - -# ifdef MSDOS /* Watt-32 */ - -# include -# define select(n,r,w,x,t) select_s(n,r,w,x,t) -# define ioctl(x,y,z) ioctlsocket(x,y,(char *)(z)) -# include -# ifdef word -# undef word -# endif -# ifdef byte -# undef byte -# endif - -# endif /* MSDOS */ - -# ifdef __minix - /* Minix 3 versions up to at least 3.1.3 are missing these prototypes */ - extern char * strtok_r(char *s, const char *delim, char **last); - extern struct tm * gmtime_r(const time_t * const timep, struct tm *tmp); -# endif - -# define DIR_CHAR "/" -# ifndef DOT_CHAR -# define DOT_CHAR "." -# endif - -# ifdef MSDOS -# undef DOT_CHAR -# define DOT_CHAR "_" -# endif - -# ifndef fileno /* sunos 4 have this as a macro! */ - int fileno( FILE *stream); -# endif - -#endif /* WIN32 */ - -/* - * msvc 6.0 requires PSDK in order to have INET6_ADDRSTRLEN - * defined in ws2tcpip.h as well as to provide IPv6 support. - */ - -#if defined(_MSC_VER) && !defined(__POCC__) -# if !defined(HAVE_WS2TCPIP_H) || \ - ((_MSC_VER < 1300) && !defined(INET6_ADDRSTRLEN)) -# undef HAVE_GETADDRINFO_THREADSAFE -# undef HAVE_FREEADDRINFO -# undef HAVE_GETADDRINFO -# undef HAVE_GETNAMEINFO -# undef ENABLE_IPV6 -# endif -#endif - -/* ---------------------------------------------------------------- */ -/* resolver specialty compile-time defines */ -/* CURLRES_* defines to use in the host*.c sources */ -/* ---------------------------------------------------------------- */ - -/* - * lcc-win32 doesn't have _beginthreadex(), lacks threads support. - */ - -#if defined(__LCC__) && defined(WIN32) -# undef USE_THREADS_POSIX -# undef USE_THREADS_WIN32 -#endif - -/* - * MSVC threads support requires a multi-threaded runtime library. - * _beginthreadex() is not available in single-threaded ones. - */ - -#if defined(_MSC_VER) && !defined(__POCC__) && !defined(_MT) -# undef USE_THREADS_POSIX -# undef USE_THREADS_WIN32 -#endif - -/* - * Mutually exclusive CURLRES_* definitions. - */ - -#ifdef USE_ARES -# define CURLRES_ASYNCH -# define CURLRES_ARES -/* now undef the stock libc functions just to avoid them being used */ -# undef HAVE_GETADDRINFO -# undef HAVE_GETHOSTBYNAME -#elif defined(USE_THREADS_POSIX) || defined(USE_THREADS_WIN32) -# define CURLRES_ASYNCH -# define CURLRES_THREADED -#else -# define CURLRES_SYNCH -#endif - -#ifdef ENABLE_IPV6 -# define CURLRES_IPV6 -#else -# define CURLRES_IPV4 -#endif - -/* ---------------------------------------------------------------- */ - -/* - * When using WINSOCK, TELNET protocol requires WINSOCK2 API. - */ - -#if defined(USE_WINSOCK) && (USE_WINSOCK != 2) -# define CURL_DISABLE_TELNET 1 -#endif - -/* - * msvc 6.0 does not have struct sockaddr_storage and - * does not define IPPROTO_ESP in winsock2.h. But both - * are available if PSDK is properly installed. - */ - -#if defined(_MSC_VER) && !defined(__POCC__) -# if !defined(HAVE_WINSOCK2_H) || ((_MSC_VER < 1300) && !defined(IPPROTO_ESP)) -# undef HAVE_STRUCT_SOCKADDR_STORAGE -# endif -#endif - -/* - * Intentionally fail to build when using msvc 6.0 without PSDK installed. - * The brave of heart can circumvent this, defining ALLOW_MSVC6_WITHOUT_PSDK - * in lib/config-win32.h although absolutely discouraged and unsupported. - */ - -#if defined(_MSC_VER) && !defined(__POCC__) -# if !defined(HAVE_WINDOWS_H) || ((_MSC_VER < 1300) && !defined(_FILETIME_)) -# if !defined(ALLOW_MSVC6_WITHOUT_PSDK) -# error MSVC 6.0 requires "February 2003 Platform SDK" a.k.a. \ - "Windows Server 2003 PSDK" -# else -# define CURL_DISABLE_LDAP 1 -# endif -# endif -#endif - -#ifdef NETWARE -int netware_init(void); -#ifndef __NOVELL_LIBC__ -#include -#include -#endif -#endif - -#if defined(HAVE_LIBIDN) && defined(HAVE_TLD_H) -/* The lib was present and the tld.h header (which is missing in libidn 0.3.X - but we only work with libidn 0.4.1 or later) */ -#define USE_LIBIDN -#endif - -#ifndef SIZEOF_TIME_T -/* assume default size of time_t to be 32 bit */ -#define SIZEOF_TIME_T 4 -#endif - -#define LIBIDN_REQUIRED_VERSION "0.4.1" - -#if defined(USE_GNUTLS) || defined(USE_SSLEAY) || defined(USE_NSS) || \ - defined(USE_QSOSSL) || defined(USE_POLARSSL) || defined(USE_AXTLS) || \ - defined(USE_CYASSL) || defined(USE_SCHANNEL) || \ - defined(USE_DARWINSSL) -#define USE_SSL /* SSL support has been enabled */ -#endif - -#if defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI) -#define USE_HTTP_NEGOTIATE -#endif - -/* Single point where USE_NTLM definition might be done */ -#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_NTLM) -#if defined(USE_SSLEAY) || defined(USE_WINDOWS_SSPI) || \ - defined(USE_GNUTLS) || defined(USE_NSS) || defined(USE_DARWINSSL) -#define USE_NTLM -#endif -#endif - -/* non-configure builds may define CURL_WANTS_CA_BUNDLE_ENV */ -#if defined(CURL_WANTS_CA_BUNDLE_ENV) && !defined(CURL_CA_BUNDLE) -#define CURL_CA_BUNDLE getenv("CURL_CA_BUNDLE") -#endif - -/* - * Provide a mechanism to silence picky compilers, such as gcc 4.6+. - * Parameters should of course normally not be unused, but for example when - * we have multiple implementations of the same interface it may happen. - */ - -#if defined(__GNUC__) && ((__GNUC__ >= 3) || \ - ((__GNUC__ == 2) && defined(__GNUC_MINOR__) && (__GNUC_MINOR__ >= 7))) -# define UNUSED_PARAM __attribute__((__unused__)) -#else -# define UNUSED_PARAM /*NOTHING*/ -#endif - -/* - * Include macros and defines that should only be processed once. - */ - -#ifndef __SETUP_ONCE_H -#include "setup_once.h" -#endif - -/* - * Definition of our NOP statement Object-like macro - */ - -#ifndef Curl_nop_stmt -# define Curl_nop_stmt do { } WHILE_FALSE -#endif - -/* - * Ensure that Winsock and lwIP TCP/IP stacks are not mixed. - */ - -#if defined(__LWIP_OPT_H__) -# if defined(SOCKET) || \ - defined(USE_WINSOCK) || \ - defined(HAVE_WINSOCK_H) || \ - defined(HAVE_WINSOCK2_H) || \ - defined(HAVE_WS2TCPIP_H) -# error "Winsock and lwIP TCP/IP stack definitions shall not coexist!" -# endif -#endif - -/* - * Portable symbolic names for Winsock shutdown() mode flags. - */ - -#ifdef USE_WINSOCK -# define SHUT_RD 0x00 -# define SHUT_WR 0x01 -# define SHUT_RDWR 0x02 -#endif - -/* Define S_ISREG if not defined by system headers, f.e. MSVC */ -#if !defined(S_ISREG) && defined(S_IFMT) && defined(S_IFREG) -#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) -#endif - -#endif /* HEADER_CURL_SETUP_H */ diff --git a/lib/setup_once.h b/lib/setup_once.h deleted file mode 100644 index 2d55c4060..000000000 --- a/lib/setup_once.h +++ /dev/null @@ -1,570 +0,0 @@ -#ifndef HEADER_CURL_SETUP_ONCE_H -#define HEADER_CURL_SETUP_ONCE_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * 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 - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - ***************************************************************************/ - - -/******************************************************************** - * NOTICE * - * ======== * - * * - * Content of header files lib/setup_once.h and ares/setup_once.h * - * must be kept in sync. Modify the other one if you change this. * - * * - ********************************************************************/ - - -/* - * Inclusion of common header files. - */ - -#include -#include -#include -#include -#include - -#ifdef HAVE_ERRNO_H -#include -#endif - -#ifdef HAVE_SYS_TYPES_H -#include -#endif - -#ifdef NEED_MALLOC_H -#include -#endif - -#ifdef NEED_MEMORY_H -#include -#endif - -#ifdef HAVE_SYS_STAT_H -#include -#endif - -#ifdef HAVE_SYS_TIME_H -#include -#ifdef TIME_WITH_SYS_TIME -#include -#endif -#else -#ifdef HAVE_TIME_H -#include -#endif -#endif - -#ifdef WIN32 -#include -#include -#endif - -#if defined(HAVE_STDBOOL_H) && defined(HAVE_BOOL_T) -#include -#endif - -#ifdef HAVE_UNISTD_H -#include -#endif - -#ifdef __hpux -# if !defined(_XOPEN_SOURCE_EXTENDED) || defined(_KERNEL) -# ifdef _APP32_64BIT_OFF_T -# define OLD_APP32_64BIT_OFF_T _APP32_64BIT_OFF_T -# undef _APP32_64BIT_OFF_T -# else -# undef OLD_APP32_64BIT_OFF_T -# endif -# endif -#endif - -#ifdef HAVE_SYS_SOCKET_H -#include -#endif - -#ifdef __hpux -# if !defined(_XOPEN_SOURCE_EXTENDED) || defined(_KERNEL) -# ifdef OLD_APP32_64BIT_OFF_T -# define _APP32_64BIT_OFF_T OLD_APP32_64BIT_OFF_T -# undef OLD_APP32_64BIT_OFF_T -# endif -# endif -#endif - - -/* - * Definition of timeval struct for platforms that don't have it. - */ - -#ifndef HAVE_STRUCT_TIMEVAL -struct timeval { - long tv_sec; - long tv_usec; -}; -#endif - - -/* - * If we have the MSG_NOSIGNAL define, make sure we use - * it as the fourth argument of function send() - */ - -#ifdef HAVE_MSG_NOSIGNAL -#define SEND_4TH_ARG MSG_NOSIGNAL -#else -#define SEND_4TH_ARG 0 -#endif - - -#if defined(__minix) -/* Minix doesn't support recv on TCP sockets */ -#define sread(x,y,z) (ssize_t)read((RECV_TYPE_ARG1)(x), \ - (RECV_TYPE_ARG2)(y), \ - (RECV_TYPE_ARG3)(z)) - -#elif defined(HAVE_RECV) -/* - * The definitions for the return type and arguments types - * of functions recv() and send() belong and come from the - * configuration file. Do not define them in any other place. - * - * HAVE_RECV is defined if you have a function named recv() - * which is used to read incoming data from sockets. If your - * function has another name then don't define HAVE_RECV. - * - * If HAVE_RECV is defined then RECV_TYPE_ARG1, RECV_TYPE_ARG2, - * RECV_TYPE_ARG3, RECV_TYPE_ARG4 and RECV_TYPE_RETV must also - * be defined. - * - * HAVE_SEND is defined if you have a function named send() - * which is used to write outgoing data on a connected socket. - * If yours has another name then don't define HAVE_SEND. - * - * If HAVE_SEND is defined then SEND_TYPE_ARG1, SEND_QUAL_ARG2, - * SEND_TYPE_ARG2, SEND_TYPE_ARG3, SEND_TYPE_ARG4 and - * SEND_TYPE_RETV must also be defined. - */ - -#if !defined(RECV_TYPE_ARG1) || \ - !defined(RECV_TYPE_ARG2) || \ - !defined(RECV_TYPE_ARG3) || \ - !defined(RECV_TYPE_ARG4) || \ - !defined(RECV_TYPE_RETV) - /* */ - Error Missing_definition_of_return_and_arguments_types_of_recv - /* */ -#else -#define sread(x,y,z) (ssize_t)recv((RECV_TYPE_ARG1)(x), \ - (RECV_TYPE_ARG2)(y), \ - (RECV_TYPE_ARG3)(z), \ - (RECV_TYPE_ARG4)(0)) -#endif -#else /* HAVE_RECV */ -#ifndef sread - /* */ - Error Missing_definition_of_macro_sread - /* */ -#endif -#endif /* HAVE_RECV */ - - -#if defined(__minix) -/* Minix doesn't support send on TCP sockets */ -#define swrite(x,y,z) (ssize_t)write((SEND_TYPE_ARG1)(x), \ - (SEND_TYPE_ARG2)(y), \ - (SEND_TYPE_ARG3)(z)) - -#elif defined(HAVE_SEND) -#if !defined(SEND_TYPE_ARG1) || \ - !defined(SEND_QUAL_ARG2) || \ - !defined(SEND_TYPE_ARG2) || \ - !defined(SEND_TYPE_ARG3) || \ - !defined(SEND_TYPE_ARG4) || \ - !defined(SEND_TYPE_RETV) - /* */ - Error Missing_definition_of_return_and_arguments_types_of_send - /* */ -#else -#define swrite(x,y,z) (ssize_t)send((SEND_TYPE_ARG1)(x), \ - (SEND_TYPE_ARG2)(y), \ - (SEND_TYPE_ARG3)(z), \ - (SEND_TYPE_ARG4)(SEND_4TH_ARG)) -#endif -#else /* HAVE_SEND */ -#ifndef swrite - /* */ - Error Missing_definition_of_macro_swrite - /* */ -#endif -#endif /* HAVE_SEND */ - - -#if 0 -#if defined(HAVE_RECVFROM) -/* - * Currently recvfrom is only used on udp sockets. - */ -#if !defined(RECVFROM_TYPE_ARG1) || \ - !defined(RECVFROM_TYPE_ARG2) || \ - !defined(RECVFROM_TYPE_ARG3) || \ - !defined(RECVFROM_TYPE_ARG4) || \ - !defined(RECVFROM_TYPE_ARG5) || \ - !defined(RECVFROM_TYPE_ARG6) || \ - !defined(RECVFROM_TYPE_RETV) - /* */ - Error Missing_definition_of_return_and_arguments_types_of_recvfrom - /* */ -#else -#define sreadfrom(s,b,bl,f,fl) (ssize_t)recvfrom((RECVFROM_TYPE_ARG1) (s), \ - (RECVFROM_TYPE_ARG2 *)(b), \ - (RECVFROM_TYPE_ARG3) (bl), \ - (RECVFROM_TYPE_ARG4) (0), \ - (RECVFROM_TYPE_ARG5 *)(f), \ - (RECVFROM_TYPE_ARG6 *)(fl)) -#endif -#else /* HAVE_RECVFROM */ -#ifndef sreadfrom - /* */ - Error Missing_definition_of_macro_sreadfrom - /* */ -#endif -#endif /* HAVE_RECVFROM */ - - -#ifdef RECVFROM_TYPE_ARG6_IS_VOID -# define RECVFROM_ARG6_T int -#else -# define RECVFROM_ARG6_T RECVFROM_TYPE_ARG6 -#endif -#endif /* if 0 */ - - -/* - * Function-like macro definition used to close a socket. - */ - -#if defined(HAVE_CLOSESOCKET) -# define sclose(x) closesocket((x)) -#elif defined(HAVE_CLOSESOCKET_CAMEL) -# define sclose(x) CloseSocket((x)) -#elif defined(USE_LWIPSOCK) -# define sclose(x) lwip_close((x)) -#else -# define sclose(x) close((x)) -#endif - -/* - * Stack-independent version of fcntl() on sockets: - */ -#if defined(USE_LWIPSOCK) -# define sfcntl lwip_fcntl -#else -# define sfcntl fcntl -#endif - -/* - * Uppercase macro versions of ANSI/ISO is*() functions/macros which - * avoid negative number inputs with argument byte codes > 127. - */ - -#define ISSPACE(x) (isspace((int) ((unsigned char)x))) -#define ISDIGIT(x) (isdigit((int) ((unsigned char)x))) -#define ISALNUM(x) (isalnum((int) ((unsigned char)x))) -#define ISXDIGIT(x) (isxdigit((int) ((unsigned char)x))) -#define ISGRAPH(x) (isgraph((int) ((unsigned char)x))) -#define ISALPHA(x) (isalpha((int) ((unsigned char)x))) -#define ISPRINT(x) (isprint((int) ((unsigned char)x))) -#define ISUPPER(x) (isupper((int) ((unsigned char)x))) -#define ISLOWER(x) (islower((int) ((unsigned char)x))) -#define ISASCII(x) (isascii((int) ((unsigned char)x))) - -#define ISBLANK(x) (int)((((unsigned char)x) == ' ') || \ - (((unsigned char)x) == '\t')) - -#define TOLOWER(x) (tolower((int) ((unsigned char)x))) - - -/* - * 'bool' stuff compatible with HP-UX headers. - */ - -#if defined(__hpux) && !defined(HAVE_BOOL_T) - typedef int bool; -# define false 0 -# define true 1 -# define HAVE_BOOL_T -#endif - - -/* - * 'bool' exists on platforms with , i.e. C99 platforms. - * On non-C99 platforms there's no bool, so define an enum for that. - * On C99 platforms 'false' and 'true' also exist. Enum uses a - * global namespace though, so use bool_false and bool_true. - */ - -#ifndef HAVE_BOOL_T - typedef enum { - bool_false = 0, - bool_true = 1 - } bool; - -/* - * Use a define to let 'true' and 'false' use those enums. There - * are currently no use of true and false in libcurl proper, but - * there are some in the examples. This will cater for any later - * code happening to use true and false. - */ -# define false bool_false -# define true bool_true -# define HAVE_BOOL_T -#endif - - -/* - * Redefine TRUE and FALSE too, to catch current use. With this - * change, 'bool found = 1' will give a warning on MIPSPro, but - * 'bool found = TRUE' will not. Change tested on IRIX/MIPSPro, - * AIX 5.1/Xlc, Tru64 5.1/cc, w/make test too. - */ - -#ifndef TRUE -#define TRUE true -#endif -#ifndef FALSE -#define FALSE false -#endif - - -/* - * Macro WHILE_FALSE may be used to build single-iteration do-while loops, - * avoiding compiler warnings. Mostly intended for other macro definitions. - */ - -#define WHILE_FALSE while(0) - -#if defined(_MSC_VER) && !defined(__POCC__) -# undef WHILE_FALSE -# if (_MSC_VER < 1500) -# define WHILE_FALSE while(1, 0) -# else -# define WHILE_FALSE \ -__pragma(warning(push)) \ -__pragma(warning(disable:4127)) \ -while(0) \ -__pragma(warning(pop)) -# endif -#endif - - -/* - * Typedef to 'int' if sig_atomic_t is not an available 'typedefed' type. - */ - -#ifndef HAVE_SIG_ATOMIC_T -typedef int sig_atomic_t; -#define HAVE_SIG_ATOMIC_T -#endif - - -/* - * Convenience SIG_ATOMIC_T definition - */ - -#ifdef HAVE_SIG_ATOMIC_T_VOLATILE -#define SIG_ATOMIC_T static sig_atomic_t -#else -#define SIG_ATOMIC_T static volatile sig_atomic_t -#endif - - -/* - * Default return type for signal handlers. - */ - -#ifndef RETSIGTYPE -#define RETSIGTYPE void -#endif - - -/* - * Macro used to include code only in debug builds. - */ - -#ifdef DEBUGBUILD -#define DEBUGF(x) x -#else -#define DEBUGF(x) do { } WHILE_FALSE -#endif - - -/* - * Macro used to include assertion code only in debug builds. - */ - -#if defined(DEBUGBUILD) && defined(HAVE_ASSERT_H) -#define DEBUGASSERT(x) assert(x) -#else -#define DEBUGASSERT(x) do { } WHILE_FALSE -#endif - - -/* - * Macro SOCKERRNO / SET_SOCKERRNO() returns / sets the *socket-related* errno - * (or equivalent) on this platform to hide platform details to code using it. - */ - -#ifdef USE_WINSOCK -#define SOCKERRNO ((int)WSAGetLastError()) -#define SET_SOCKERRNO(x) (WSASetLastError((int)(x))) -#else -#define SOCKERRNO (errno) -#define SET_SOCKERRNO(x) (errno = (x)) -#endif - - -/* - * Macro ERRNO / SET_ERRNO() returns / sets the NOT *socket-related* errno - * (or equivalent) on this platform to hide platform details to code using it. - */ - -#ifdef WIN32 -#define ERRNO ((int)GetLastError()) -#define SET_ERRNO(x) (SetLastError((DWORD)(x))) -#else -#define ERRNO (errno) -#define SET_ERRNO(x) (errno = (x)) -#endif - - -/* - * Portable error number symbolic names defined to Winsock error codes. - */ - -#ifdef USE_WINSOCK -#undef EBADF /* override definition in errno.h */ -#define EBADF WSAEBADF -#undef EINTR /* override definition in errno.h */ -#define EINTR WSAEINTR -#undef EINVAL /* override definition in errno.h */ -#define EINVAL WSAEINVAL -#undef EWOULDBLOCK /* override definition in errno.h */ -#define EWOULDBLOCK WSAEWOULDBLOCK -#undef EINPROGRESS /* override definition in errno.h */ -#define EINPROGRESS WSAEINPROGRESS -#undef EALREADY /* override definition in errno.h */ -#define EALREADY WSAEALREADY -#undef ENOTSOCK /* override definition in errno.h */ -#define ENOTSOCK WSAENOTSOCK -#undef EDESTADDRREQ /* override definition in errno.h */ -#define EDESTADDRREQ WSAEDESTADDRREQ -#undef EMSGSIZE /* override definition in errno.h */ -#define EMSGSIZE WSAEMSGSIZE -#undef EPROTOTYPE /* override definition in errno.h */ -#define EPROTOTYPE WSAEPROTOTYPE -#undef ENOPROTOOPT /* override definition in errno.h */ -#define ENOPROTOOPT WSAENOPROTOOPT -#undef EPROTONOSUPPORT /* override definition in errno.h */ -#define EPROTONOSUPPORT WSAEPROTONOSUPPORT -#define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT -#undef EOPNOTSUPP /* override definition in errno.h */ -#define EOPNOTSUPP WSAEOPNOTSUPP -#define EPFNOSUPPORT WSAEPFNOSUPPORT -#undef EAFNOSUPPORT /* override definition in errno.h */ -#define EAFNOSUPPORT WSAEAFNOSUPPORT -#undef EADDRINUSE /* override definition in errno.h */ -#define EADDRINUSE WSAEADDRINUSE -#undef EADDRNOTAVAIL /* override definition in errno.h */ -#define EADDRNOTAVAIL WSAEADDRNOTAVAIL -#undef ENETDOWN /* override definition in errno.h */ -#define ENETDOWN WSAENETDOWN -#undef ENETUNREACH /* override definition in errno.h */ -#define ENETUNREACH WSAENETUNREACH -#undef ENETRESET /* override definition in errno.h */ -#define ENETRESET WSAENETRESET -#undef ECONNABORTED /* override definition in errno.h */ -#define ECONNABORTED WSAECONNABORTED -#undef ECONNRESET /* override definition in errno.h */ -#define ECONNRESET WSAECONNRESET -#undef ENOBUFS /* override definition in errno.h */ -#define ENOBUFS WSAENOBUFS -#undef EISCONN /* override definition in errno.h */ -#define EISCONN WSAEISCONN -#undef ENOTCONN /* override definition in errno.h */ -#define ENOTCONN WSAENOTCONN -#define ESHUTDOWN WSAESHUTDOWN -#define ETOOMANYREFS WSAETOOMANYREFS -#undef ETIMEDOUT /* override definition in errno.h */ -#define ETIMEDOUT WSAETIMEDOUT -#undef ECONNREFUSED /* override definition in errno.h */ -#define ECONNREFUSED WSAECONNREFUSED -#undef ELOOP /* override definition in errno.h */ -#define ELOOP WSAELOOP -#ifndef ENAMETOOLONG /* possible previous definition in errno.h */ -#define ENAMETOOLONG WSAENAMETOOLONG -#endif -#define EHOSTDOWN WSAEHOSTDOWN -#undef EHOSTUNREACH /* override definition in errno.h */ -#define EHOSTUNREACH WSAEHOSTUNREACH -#ifndef ENOTEMPTY /* possible previous definition in errno.h */ -#define ENOTEMPTY WSAENOTEMPTY -#endif -#define EPROCLIM WSAEPROCLIM -#define EUSERS WSAEUSERS -#define EDQUOT WSAEDQUOT -#define ESTALE WSAESTALE -#define EREMOTE WSAEREMOTE -#endif - - -/* - * Actually use __32_getpwuid() on 64-bit VMS builds for getpwuid() - */ - -#if defined(__VMS) && \ - defined(__INITIAL_POINTER_SIZE) && (__INITIAL_POINTER_SIZE == 64) -#define getpwuid __32_getpwuid -#endif - - -/* - * Macro argv_item_t hides platform details to code using it. - */ - -#ifdef __VMS -#define argv_item_t __char_ptr32 -#else -#define argv_item_t char * -#endif - - -/* - * We use this ZERO_NULL to avoid picky compiler warnings, - * when assigning a NULL pointer to a function pointer var. - */ - -#define ZERO_NULL 0 - - -#endif /* HEADER_CURL_SETUP_ONCE_H */ - diff --git a/lib/share.c b/lib/share.c index 477c35b0b..b21c9f685 100644 --- a/lib/share.c +++ b/lib/share.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #include #include "urldata.h" diff --git a/lib/share.h b/lib/share.h index b9e6c2538..9a5128e93 100644 --- a/lib/share.h +++ b/lib/share.h @@ -22,7 +22,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #include #include "cookie.h" #include "urldata.h" diff --git a/lib/slist.c b/lib/slist.c index 4ddebb609..92c699ec9 100644 --- a/lib/slist.c +++ b/lib/slist.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #include "curl_memory.h" #include "slist.h" diff --git a/lib/smtp.c b/lib/smtp.c index 9a759abca..2ad2ac691 100644 --- a/lib/smtp.c +++ b/lib/smtp.c @@ -28,7 +28,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifndef CURL_DISABLE_SMTP diff --git a/lib/sockaddr.h b/lib/sockaddr.h index 522a2199f..6a2151c9d 100644 --- a/lib/sockaddr.h +++ b/lib/sockaddr.h @@ -22,7 +22,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" struct Curl_sockaddr_storage { union { diff --git a/lib/socks.c b/lib/socks.c index 13a756a40..51bb94664 100644 --- a/lib/socks.c +++ b/lib/socks.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #if !defined(CURL_DISABLE_PROXY) diff --git a/lib/socks.h b/lib/socks.h index 0ce0bd044..dc4670b24 100644 --- a/lib/socks.h +++ b/lib/socks.h @@ -22,7 +22,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifdef CURL_DISABLE_PROXY #define Curl_SOCKS4(a,b,c,d,e,f) CURLE_NOT_BUILT_IN diff --git a/lib/socks_gssapi.c b/lib/socks_gssapi.c index 02dd485f1..1f840bd4e 100644 --- a/lib/socks_gssapi.c +++ b/lib/socks_gssapi.c @@ -21,7 +21,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifndef CURL_DISABLE_PROXY diff --git a/lib/socks_sspi.c b/lib/socks_sspi.c index 6e95e3c35..b4b23e014 100644 --- a/lib/socks_sspi.c +++ b/lib/socks_sspi.c @@ -21,7 +21,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #if defined(USE_WINDOWS_SSPI) && !defined(CURL_DISABLE_PROXY) diff --git a/lib/speedcheck.c b/lib/speedcheck.c index ca2323f57..ea17a5975 100644 --- a/lib/speedcheck.c +++ b/lib/speedcheck.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #include #include "urldata.h" diff --git a/lib/speedcheck.h b/lib/speedcheck.h index fc40e7d0c..786cd1215 100644 --- a/lib/speedcheck.h +++ b/lib/speedcheck.h @@ -22,7 +22,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #include "timeval.h" diff --git a/lib/splay.c b/lib/splay.c index b6664e6df..3570712d4 100644 --- a/lib/splay.c +++ b/lib/splay.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #include "splay.h" diff --git a/lib/splay.h b/lib/splay.h index 49a6dec41..5f9ef24cc 100644 --- a/lib/splay.h +++ b/lib/splay.h @@ -21,7 +21,7 @@ * KIND, either express or implied. * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" struct Curl_tree { struct Curl_tree *smaller; /* smaller node */ diff --git a/lib/ssh.c b/lib/ssh.c index 1cc4bcd4c..8eb2e9fc9 100644 --- a/lib/ssh.c +++ b/lib/ssh.c @@ -22,7 +22,7 @@ /* #define CURL_LIBSSH2_DEBUG */ -#include "setup.h" +#include "curl_setup.h" #ifdef USE_LIBSSH2 diff --git a/lib/ssh.h b/lib/ssh.h index bf43fdf3a..ff2e16be9 100644 --- a/lib/ssh.h +++ b/lib/ssh.h @@ -22,7 +22,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifdef HAVE_LIBSSH2_H #include diff --git a/lib/sslgen.c b/lib/sslgen.c index 67dd71fa6..48758742a 100644 --- a/lib/sslgen.c +++ b/lib/sslgen.c @@ -43,7 +43,7 @@ http://httpd.apache.org/docs-2.0/ssl/ssl_intro.html */ -#include "setup.h" +#include "curl_setup.h" #include "urldata.h" #define SSLGEN_C diff --git a/lib/sslgen.h b/lib/sslgen.h index 2369b552c..17ad8e343 100644 --- a/lib/sslgen.h +++ b/lib/sslgen.h @@ -21,7 +21,7 @@ * KIND, either express or implied. * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifndef MD5_DIGEST_LENGTH #define MD5_DIGEST_LENGTH 16 /* fixed size */ diff --git a/lib/ssluse.c b/lib/ssluse.c index 8f9fce4c8..c4c465c2c 100644 --- a/lib/ssluse.c +++ b/lib/ssluse.c @@ -30,7 +30,7 @@ * Sampo Kellomaki 1998. */ -#include "setup.h" +#include "curl_setup.h" #ifdef HAVE_LIMITS_H #include diff --git a/lib/ssluse.h b/lib/ssluse.h index 5375a6a65..bdec2b513 100644 --- a/lib/ssluse.h +++ b/lib/ssluse.h @@ -22,7 +22,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifdef USE_SSLEAY /* diff --git a/lib/strdup.c b/lib/strdup.c index 27014354d..3b776b184 100644 --- a/lib/strdup.c +++ b/lib/strdup.c @@ -22,7 +22,7 @@ /* * This file is 'mem-include-scan' clean. See test 1132. */ -#include "setup.h" +#include "curl_setup.h" #include "strdup.h" diff --git a/lib/strdup.h b/lib/strdup.h index 4edbcd7d4..49af9117e 100644 --- a/lib/strdup.h +++ b/lib/strdup.h @@ -21,7 +21,7 @@ * KIND, either express or implied. * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifndef HAVE_STRDUP extern char *curlx_strdup(const char *str); diff --git a/lib/strequal.c b/lib/strequal.c index 89ad8a6e8..f69c5bf9e 100644 --- a/lib/strequal.c +++ b/lib/strequal.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifdef HAVE_STRINGS_H #include diff --git a/lib/strerror.c b/lib/strerror.c index 0c82a53e4..58c6dc310 100644 --- a/lib/strerror.c +++ b/lib/strerror.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifdef HAVE_STRERROR_R # if (!defined(HAVE_POSIX_STRERROR_R) && \ diff --git a/lib/strtok.c b/lib/strtok.c index 94eac0e64..0d31351f4 100644 --- a/lib/strtok.c +++ b/lib/strtok.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifndef HAVE_STRTOK_R #include diff --git a/lib/strtok.h b/lib/strtok.h index 8baf77948..1147d70d3 100644 --- a/lib/strtok.h +++ b/lib/strtok.h @@ -21,7 +21,7 @@ * KIND, either express or implied. * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #include #ifndef HAVE_STRTOK_R diff --git a/lib/strtoofft.c b/lib/strtoofft.c index c61459de8..03a97e8c4 100644 --- a/lib/strtoofft.c +++ b/lib/strtoofft.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #include "strtoofft.h" diff --git a/lib/strtoofft.h b/lib/strtoofft.h index 08b0e6d91..b812a67a0 100644 --- a/lib/strtoofft.h +++ b/lib/strtoofft.h @@ -22,7 +22,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" /* * Determine which string to integral data type conversion function we use diff --git a/lib/telnet.c b/lib/telnet.c index a64da090f..77d8b7b6b 100644 --- a/lib/telnet.c +++ b/lib/telnet.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifndef CURL_DISABLE_TELNET diff --git a/lib/tftp.c b/lib/tftp.c index 97276ea99..282460bda 100644 --- a/lib/tftp.c +++ b/lib/tftp.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifndef CURL_DISABLE_TFTP diff --git a/lib/timeval.h b/lib/timeval.h index b464ae406..3f1b9ea70 100644 --- a/lib/timeval.h +++ b/lib/timeval.h @@ -27,7 +27,7 @@ * as well as the library. Do not mix with library internals! */ -#include "setup.h" +#include "curl_setup.h" struct timeval curlx_tvnow(void); diff --git a/lib/transfer.c b/lib/transfer.c index 6194908d6..6be43ea34 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #include "strtoofft.h" #include "strequal.h" diff --git a/lib/url.c b/lib/url.c index 58befecab..c107d2c51 100644 --- a/lib/url.c +++ b/lib/url.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #ifdef HAVE_NETINET_IN_H #include diff --git a/lib/url.h b/lib/url.h index ab6d3d048..a026e90e8 100644 --- a/lib/url.h +++ b/lib/url.h @@ -21,7 +21,7 @@ * KIND, either express or implied. * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" /* * Prototypes for library-wide functions provided by url.c diff --git a/lib/urldata.h b/lib/urldata.h index cd50f623f..576872d70 100644 --- a/lib/urldata.h +++ b/lib/urldata.h @@ -24,7 +24,7 @@ /* This file is for lib internal stuff */ -#include "setup.h" +#include "curl_setup.h" #define PORT_FTP 21 #define PORT_FTPS 990 diff --git a/lib/version.c b/lib/version.c index ef8353ae2..d39fe0c1d 100644 --- a/lib/version.c +++ b/lib/version.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #include #include "urldata.h" diff --git a/lib/warnless.c b/lib/warnless.c index 9cc7be9d3..b1eaa96ea 100644 --- a/lib/warnless.c +++ b/lib/warnless.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #if defined(__INTEL_COMPILER) && defined(__unix__) diff --git a/lib/wildcard.c b/lib/wildcard.c index 6f4c7380c..7130d5e49 100644 --- a/lib/wildcard.c +++ b/lib/wildcard.c @@ -20,7 +20,7 @@ * ***************************************************************************/ -#include "setup.h" +#include "curl_setup.h" #include "wildcard.h" #include "llist.h" -- cgit v1.2.3