]> sjero.net Git - wget/commitdiff
Eschew config-post.h.
authorMicah Cowan <micah@cowan.name>
Fri, 19 Oct 2007 03:50:40 +0000 (20:50 -0700)
committerMicah Cowan <micah@cowan.name>
Fri, 19 Oct 2007 03:50:40 +0000 (20:50 -0700)
39 files changed:
ChangeLog
configure.ac
src/ChangeLog
src/Makefile.am
src/alloca.c
src/cmpt.c
src/config-post.h [deleted file]
src/connect.c
src/convert.c
src/cookies.c
src/ftp-basic.c
src/ftp-ls.c
src/ftp-opie.c
src/ftp.c
src/gen-md5.c
src/gnutls.c
src/hash.c
src/host.c
src/html-parse.c
src/html-url.c
src/http-ntlm.c
src/http.c
src/init.c
src/log.c
src/main.c
src/mswindows.c
src/netrc.c
src/openssl.c
src/progress.c
src/ptimer.c
src/recur.c
src/res.c
src/retr.c
src/spider.c
src/sysdep.h
src/url.c
src/utils.c
src/wget.h
src/xmalloc.c

index 7ede8309788c3620e3c2fba441a012d73de5dd82..e53dea3020036963b5ae6a09a1bcbb6520ebcf83 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,8 @@
        some point other than autoreconf.
        * Makefile.am: Put autogen.sh back in EXTRA_DIST. Just in case
        someone needs to rebuild configure.
+       * configure.ac: Removed config-post.h inclusion from bottom of
+       generated config.h.
 
 2007-10-16  Micah Cowan  <micah@cowan.name>
 
index f61baa110126667b8d6e1486871e051e0182ae5d..7ae240e2eb84dd7abcdd28c6b51cb07f3e80e0e3 100644 (file)
@@ -458,7 +458,4 @@ AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile util/Makefile
                  po/Makefile.in tests/Makefile tests/WgetTest.pm
                  lib/Makefile windows/Makefile])
 AC_CONFIG_HEADERS([src/config.h])
-AH_BOTTOM([
-#include "config-post.h"
-])
 AC_OUTPUT
index 7fdcb2b6852429fdae644806b21acf1419329bc5..6622308dcb6688705fbd2f19aef51a8299fd062a 100644 (file)
@@ -1,6 +1,17 @@
 2007-10-18  Micah Cowan  <micah@cowan.name>
 
-       * Makefile.am: version.c should not be distributed.
+       * Makefile.am: version.c should not be distributed. Removed
+       config-post.h.
+       * sysdep.h: Got contents of config-post.h
+       * config-post.h: Removed.
+       * wget.h: #include "config.h".
+       * alloca.c, cmpt.c, connect.c, convert.c, cookies.c,
+       ftp-basic.c, ftp-ls.c, ftp-opie.c, ftp.c, gen-md5.c, gnutls.c,
+       hash.c, host.c, html-parse.c, html-url.c, http-ntlm.c, http.c,
+       init.c, log.c, main.c, mswindows.c, netrc.c, openssl.c,
+       progress.c, ptimer.c, recur.c, res.c, retr.c, spider.c, url.c,
+       utils.c, xmalloc.c: Use wget.h at very top, and instead of
+       config.h.
 
 2007-10-15  Micah Cowan  <micah@cowan.name>
 
index 0c203f5cafc4a84b245f272a8d0f543446fab0a2..f1049efa40e62a4979859175e8d1c3812423be8f 100644 (file)
@@ -39,7 +39,7 @@ wget_SOURCES = cmpt.c connect.c convert.c cookies.c ftp.c ftp-basic.c \
               init.c log.c main.c netrc.c progress.c ptimer.c recur.c  \
               res.c retr.c snprintf.c spider.c url.c   \
               utils.c xmalloc.c                                \
-              config-post.h connect.h convert.h cookies.h              \
+              connect.h convert.h cookies.h            \
               ftp.h gen-md5.h hash.h host.h html-parse.h \
               http.h http-ntlm.h init.h log.h mswindows.h netrc.h \
               options.h progress.h ptimer.h recur.h res.h retr.h \
index 2722830332420ef144569f575b96fec26af7cce4..fd08295c78f5a593a73df327f6fce36547a06bd7 100644 (file)
@@ -21,6 +21,8 @@
    allocating any.  It is a good idea to use alloca(0) in
    your main control loop, etc. to force garbage collection.  */
 
+#include "wget.h"
+
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
@@ -88,7 +90,6 @@ typedef char *pointer;
    Callers below should use malloc.  */
 
 #ifndef emacs
-#include "wget.h"
 #define malloc xmalloc
 #define free xfree
 #endif
index 291056a4c20863296002f9c0e4e456bbb2112e59..ff60842da01a100127cba238d017bc06168a0d1a 100644 (file)
@@ -27,7 +27,7 @@ modify this file, you may extend this exception to your version of the
 file, but you are not obligated to do so.  If you do not wish to do
 so, delete this exception statement from your version.  */
 
-#include <config.h>
+#include "wget.h"
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -40,8 +40,6 @@ so, delete this exception statement from your version.  */
 
 #include <errno.h>
 
-#include "wget.h"
-
 /* Some systems lack certain functions normally taken for granted.
    For example, Windows doesn't have strptime, and some systems don't
    have a usable fnmatch.  This file should contain fallback
diff --git a/src/config-post.h b/src/config-post.h
deleted file mode 100644 (file)
index f3cbec3..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/* Some autoconf-unrelated preprocessor magic that needs to be done
-   *before* including the system includes and therefore cannot belong
-   in sysdep.h.
-
-   Everything else related to system tweaking belongs to sysdep.h.
-
-   This file is included at the bottom of config.h.  */
-
-/* Testing for __sun is not enough because it's also defined on SunOS.  */
-#ifdef __sun
-# ifdef __SVR4
-#  define solaris
-# endif
-#endif
-
-/* The "namespace tweaks" below attempt to set a friendly "compilation
-   environment" under popular operating systems.  Default compilation
-   environment often means that some functions that are "extensions"
-   are not declared -- `strptime' is one example.
-
-   But non-default environments can expose bugs in the system header
-   files, crippling compilation in _very_ non-obvious ways.  Because
-   of that, we define them only on well-tested architectures where we
-   know they will work.  */
-
-#undef NAMESPACE_TWEAKS
-
-#ifdef solaris
-# define NAMESPACE_TWEAKS
-#endif
-
-#ifdef __linux__
-# define NAMESPACE_TWEAKS
-#endif
-
-#ifdef NAMESPACE_TWEAKS
-
-/* Request the "Unix 98 compilation environment". */
-#define _XOPEN_SOURCE 500
-
-/* For Solaris: request everything else that is available and doesn't
-   conflict with the above.  */
-#define __EXTENSIONS__
-
-/* For Linux: request features of 4.3BSD and SVID (System V Interface
-   Definition). */
-#define _SVID_SOURCE
-#define _BSD_SOURCE
-
-/* Under glibc-based systems we want all GNU extensions as well.  This
-   declares some unnecessary cruft, but also useful functions such as
-   timegm, FNM_CASEFOLD extension to fnmatch, memrchr, etc.  */
-#define _GNU_SOURCE
-
-#endif /* NAMESPACE_TWEAKS */
-
-
-/* Alloca declaration, based on recommendation in the Autoconf manual.
-   These have to be after the above namespace tweaks, but before any
-   non-preprocessor code.  */
-
-#if HAVE_ALLOCA_H
-# include <alloca.h>
-#elif defined WINDOWS
-# include <malloc.h>
-# ifndef alloca
-#  define alloca _alloca
-# endif
-#elif defined __GNUC__
-# define alloca __builtin_alloca
-#elif defined _AIX
-# define alloca __alloca
-#else
-# include <stddef.h>
-# ifdef  __cplusplus
-extern "C"
-# endif
-void *alloca (size_t);
-#endif
index 6664c0afaa8c81b776bed17a1407a17626539205..19cca8235b63d650f5e0fe16467b7b177c22e7d5 100644 (file)
@@ -27,7 +27,7 @@ modify this file, you may extend this exception to your version of the
 file, but you are not obligated to do so.  If you do not wish to do
 so, delete this exception statement from your version.  */
 
-#include <config.h>
+#include "wget.h"
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -50,8 +50,6 @@ so, delete this exception statement from your version.  */
 #ifdef HAVE_SYS_SELECT_H
 # include <sys/select.h>
 #endif /* HAVE_SYS_SELECT_H */
-
-#include "wget.h"
 #include "utils.h"
 #include "host.h"
 #include "connect.h"
index 8f04ed0c95b82c686797c7c9bc276b39c3ae7ae8..e706154d34c5d7e5556f43004ef2a3557db5105f 100644 (file)
@@ -26,7 +26,7 @@ modify this file, you may extend this exception to your version of the
 file, but you are not obligated to do so.  If you do not wish to do
 so, delete this exception statement from your version.  */
 
-#include <config.h>
+#include "wget.h"
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -36,8 +36,6 @@ so, delete this exception statement from your version.  */
 #endif /* HAVE_UNISTD_H */
 #include <errno.h>
 #include <assert.h>
-
-#include "wget.h"
 #include "convert.h"
 #include "url.h"
 #include "recur.h"
index 0f54f665e9073b70f71015f3a50bf2a93b27cced..9045e83bcb4f7f835821115d0d571f8d14a22207 100644 (file)
@@ -42,7 +42,7 @@ so, delete this exception statement from your version.  */
    sites that do send Set-Cookie2 also emit Set-Cookie for
    compatibility.  */
 
-#include <config.h>
+#include "wget.h"
 
 #include <stdio.h>
 #include <string.h>
@@ -50,8 +50,6 @@ so, delete this exception statement from your version.  */
 #include <assert.h>
 #include <errno.h>
 #include <time.h>
-
-#include "wget.h"
 #include "utils.h"
 #include "hash.h"
 #include "cookies.h"
index 4920f72523052679d049103bf4d04e8f2f55654f..4e91a7e39e24f3184d8b61df99318f08ae3f291d 100644 (file)
@@ -27,7 +27,7 @@ modify this file, you may extend this exception to your version of the
 file, but you are not obligated to do so.  If you do not wish to do
 so, delete this exception statement from your version.  */
 
-#include <config.h>
+#include "wget.h"
 
 #include <assert.h>
 #include <stdio.h>
@@ -38,8 +38,6 @@ so, delete this exception statement from your version.  */
 #ifdef HAVE_UNISTD_H
 # include <unistd.h>
 #endif
-
-#include "wget.h"
 #include "utils.h"
 #include "connect.h"
 #include "host.h"
index b056572ed6400ed334d4d32c5dd52adcb71fa5d8..35350bb1bbb6a70ea1993ac423475bcc3407158f 100644 (file)
@@ -27,7 +27,7 @@ modify this file, you may extend this exception to your version of the
 file, but you are not obligated to do so.  If you do not wish to do
 so, delete this exception statement from your version.  */
 
-#include <config.h>
+#include "wget.h"
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -37,8 +37,6 @@ so, delete this exception statement from your version.  */
 #endif
 #include <errno.h>
 #include <time.h>
-
-#include "wget.h"
 #include "utils.h"
 #include "ftp.h"
 #include "url.h"
index 2159298a1a91d50a72ff7fd730fd0a97ebf3cdc5..713e14c07212c6ae88098f2560fac63c3403cf98 100644 (file)
@@ -27,13 +27,12 @@ modify this file, you may extend this exception to your version of the
 file, but you are not obligated to do so.  If you do not wish to do
 so, delete this exception statement from your version.  */
 
-#include <config.h>
+#include "wget.h"
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
-#include "wget.h"
 #include "gen-md5.h"
 #include "ftp.h"
 
index 302714afda99cd78bd0187ca7b8b8051d66f669c..04d240764bbe2d03c9d8e5daec55ea68c753dadb 100644 (file)
--- a/src/ftp.c
+++ b/src/ftp.c
@@ -27,7 +27,7 @@ modify this file, you may extend this exception to your version of the
 file, but you are not obligated to do so.  If you do not wish to do
 so, delete this exception statement from your version.  */
 
-#include <config.h>
+#include "wget.h"
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -39,7 +39,6 @@ so, delete this exception statement from your version.  */
 #include <errno.h>
 #include <time.h>
 
-#include "wget.h"
 #include "utils.h"
 #include "url.h"
 #include "retr.h"
index 8003c9792dd91162dac36bab962c9347f1eed0ad..1e97277b04444236ac8fbaa193b66ac5fa5f8e2a 100644 (file)
@@ -27,7 +27,6 @@ modify this file, you may extend this exception to your version of the
 file, but you are not obligated to do so.  If you do not wish to do
 so, delete this exception statement from your version.  */
 
-#include <config.h>
 #include "wget.h"
 
 #include "gen-md5.h"
index 92c078076ed9ab23503563d14fbed80245099da6..a7c253f1b3e6678acf2348a68476cdaba008dad5 100644 (file)
@@ -26,7 +26,7 @@ modify this file, you may extend this exception to your version of the
 file, but you are not obligated to do so.  If you do not wish to do
 so, delete this exception statement from your version.  */
 
-#include <config.h>
+#include "wget.h"
 
 #include <assert.h>
 #include <errno.h>
@@ -39,7 +39,6 @@ so, delete this exception statement from your version.  */
 #include <gnutls/gnutls.h>
 #include <gnutls/x509.h>
 
-#include "wget.h"
 #include "utils.h"
 #include "connect.h"
 #include "url.h"
index cb65c7f7661b4bcd6e770e1ff300e6111e8459a2..e3fac111bf85d318b5d7736a122ca33bf2b5ee21 100644 (file)
@@ -30,8 +30,8 @@ so, delete this exception statement from your version.  */
 /* With -DSTANDALONE, this file can be compiled outside Wget source
    tree.  To test, also use -DTEST.  */
 
-#ifdef HAVE_CONFIG_H
-# include <config.h>
+#ifndef STANDALONE
+# include "wget.h"
 #endif
 
 #include <stdio.h>
@@ -42,7 +42,6 @@ so, delete this exception statement from your version.  */
 
 #ifndef STANDALONE
 /* Get Wget's utility headers. */
-# include "wget.h"
 # include "utils.h"
 #else
 /* Make do without them. */
index f6b0f1636ee8e13654064a97f5625fae1b36c81e..60da2541bc8d01e2d68543d9ff6ca53d14a04b08 100644 (file)
@@ -27,7 +27,7 @@ modify this file, you may extend this exception to your version of the
 file, but you are not obligated to do so.  If you do not wish to do
 so, delete this exception statement from your version.  */
 
-#include <config.h>
+#include "wget.h"
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -48,7 +48,6 @@ so, delete this exception statement from your version.  */
 
 #include <errno.h>
 
-#include "wget.h"
 #include "utils.h"
 #include "host.h"
 #include "url.h"
index a72688e3fa4aeacb58c2de87ea02e5a84e674cef..b98843e38ccf8c11c76bc975ca87c01d0ae39a4a 100644 (file)
@@ -88,7 +88,7 @@ so, delete this exception statement from your version.  */
 /* To test as standalone, compile with `-DSTANDALONE -I.'.  You'll
    still need Wget headers to compile.  */
 
-#include <config.h>
+#include "wget.h"
 
 #ifdef STANDALONE
 # define I_REALLY_WANT_CTYPE_MACROS
@@ -99,7 +99,6 @@ so, delete this exception statement from your version.  */
 #include <string.h>
 #include <assert.h>
 
-#include "wget.h"
 #include "html-parse.h"
 
 #ifdef STANDALONE
index 6a96f6c20ec0a66a825dfbcfcb1118692c6f8efe..3ab7f7fe02127410bf8f3781874cf74fc701e203 100644 (file)
@@ -27,7 +27,7 @@ modify this file, you may extend this exception to your version of the
 file, but you are not obligated to do so.  If you do not wish to do
 so, delete this exception statement from your version.  */
 
-#include <config.h>
+#include "wget.h"
 
 #include <stdio.h>
 #include <string.h>
@@ -35,7 +35,6 @@ so, delete this exception statement from your version.  */
 #include <errno.h>
 #include <assert.h>
 
-#include "wget.h"
 #include "html-parse.h"
 #include "url.h"
 #include "utils.h"
index 5ca8e85c11317ea39515a6945570c8b860daac34..6109ed9debed9cb2acbac2222d6ab8ce7362ae8b 100644 (file)
@@ -27,7 +27,7 @@ modify this file, you may extend this exception to your version of the
 file, but you are not obligated to do so.  If you do not wish to do
 so, delete this exception statement from your version.  */
 
-#include <config.h>
+#include "wget.h"
 
 /* NTLM details:
    
@@ -44,7 +44,6 @@ so, delete this exception statement from your version.  */
 #include <openssl/md4.h>
 #include <openssl/opensslv.h>
 
-#include "wget.h"
 #include "utils.h"
 #include "http-ntlm.h"
 
index e6f48aa2b2b8c1832d902461ae3069f567d0dd66..5a746da4d825d33e11faff6bd7b10d43a0e86143 100644 (file)
@@ -27,7 +27,7 @@ modify this file, you may extend this exception to your version of the
 file, but you are not obligated to do so.  If you do not wish to do
 so, delete this exception statement from your version.  */
 
-#include <config.h>
+#include "wget.h"
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -40,7 +40,6 @@ so, delete this exception statement from your version.  */
 #include <time.h>
 #include <locale.h>
 
-#include "wget.h"
 #include "hash.h"
 #include "http.h"
 #include "utils.h"
index 8000d73cc50919abd7617f021bc49e1d276ef971..71a5ecec8f92a60aaf2a22204737afe255c5e659 100644 (file)
@@ -27,7 +27,7 @@ modify this file, you may extend this exception to your version of the
 file, but you are not obligated to do so.  If you do not wish to do
 so, delete this exception statement from your version.  */
 
-#include <config.h>
+#include "wget.h"
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -42,7 +42,6 @@ so, delete this exception statement from your version.  */
 #endif
 #include <assert.h>
 
-#include "wget.h"
 #include "utils.h"
 #include "init.h"
 #include "host.h"
index 5cce3513da0af0cc061051d5598f530382d56291..357925d3d1c2814b33e3d779546014c2269b3656 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -27,7 +27,7 @@ modify this file, you may extend this exception to your version of the
 file, but you are not obligated to do so.  If you do not wish to do
 so, delete this exception statement from your version.  */
 
-#include <config.h>
+#include "wget.h"
 
 #include <stdio.h>
 #include <string.h>
@@ -39,7 +39,6 @@ so, delete this exception statement from your version.  */
 #include <assert.h>
 #include <errno.h>
 
-#include "wget.h"
 #include "utils.h"
 #include "log.h"
 
index 4c1a70e2ecee982f919bde0d53220dba920ac404..7e36e5d83f6a59fe4809e70e4c213241a5dbdf2f 100644 (file)
@@ -27,7 +27,7 @@ modify this file, you may extend this exception to your version of the
 file, but you are not obligated to do so.  If you do not wish to do
 so, delete this exception statement from your version.  */
 
-#include <config.h>
+#include "wget.h"
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -43,7 +43,6 @@ so, delete this exception statement from your version.  */
 #include <errno.h>
 #include <time.h>
 
-#include "wget.h"
 #include "utils.h"
 #include "init.h"
 #include "retr.h"
index 1bf8df93d31940990c72d586bf2cdf0752a37e57..2844c025eed7b8340a8eedf24162668e11dc1d2c 100644 (file)
@@ -27,7 +27,7 @@ modify this file, you may extend this exception to your version of the
 file, but you are not obligated to do so.  If you do not wish to do
 so, delete this exception statement from your version.  */
 
-#include <config.h>
+#include "wget.h"
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -38,7 +38,6 @@ so, delete this exception statement from your version.  */
 
 #define INHIBIT_WRAP /* avoid wrapping of socket, bind, ... */
 
-#include "wget.h"
 #include "utils.h"
 #include "url.h"
 
index 485e0757cf28130d1d33b3178493336c74c6cf78..c50b25810ccd8cd0af2629e0c4053f3ceec7fe9d 100644 (file)
@@ -29,16 +29,13 @@ so, delete this exception statement from your version.  */
 /* This file used to be kept in synch with the code in Fetchmail, but
    the latter has diverged since.  */
 
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include "wget.h"
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <errno.h>
 
-#include "wget.h"
 #include "utils.h"
 #include "netrc.h"
 #include "init.h"
index aa44cbaac52a0b5b2b5a80c461b928e4498ce3bd..296463f9ea4ddba2d7a1728743fd842b4881a222 100644 (file)
@@ -28,7 +28,7 @@ modify this file, you may extend this exception to your version of the
 file, but you are not obligated to do so.  If you do not wish to do
 so, delete this exception statement from your version.  */
 
-#include <config.h>
+#include "wget.h"
 
 #include <assert.h>
 #include <errno.h>
@@ -42,7 +42,6 @@ so, delete this exception statement from your version.  */
 #include <openssl/err.h>
 #include <openssl/rand.h>
 
-#include "wget.h"
 #include "utils.h"
 #include "connect.h"
 #include "url.h"
index 6dd96018b3c1e13b0d11def47b4f7dfa6eeb1d9d..debd03e8e690bef2c033c3b36934ad7f8cb9896b 100644 (file)
@@ -27,7 +27,7 @@ modify this file, you may extend this exception to your version of the
 file, but you are not obligated to do so.  If you do not wish to do
 so, delete this exception statement from your version.  */
 
-#include <config.h>
+#include "wget.h"
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -38,7 +38,6 @@ so, delete this exception statement from your version.  */
 #endif
 #include <signal.h>
 
-#include "wget.h"
 #include "progress.h"
 #include "utils.h"
 #include "retr.h"
index 33ed913fefdb085b289443a22eef28cd7ae0b635..bce8a3e5ffe5f1448510762e3829c8e2d2b3b56a 100644 (file)
@@ -49,7 +49,7 @@ so, delete this exception statement from your version.  */
      double secs = ptimer_measure ();
      printf ("The loop took %.2fs\n", secs);  */
 
-#include <config.h>
+#include "wget.h"
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -70,7 +70,6 @@ so, delete this exception statement from your version.  */
 # include <windows.h>
 #endif
 
-#include "wget.h"
 #include "ptimer.h"
 
 /* Depending on the OS, one and only one of PTIMER_POSIX,
index 87440b41c8c7351a89f364673c950d85b3f620d5..8d7b0940488a8f535a3f7a7e96435c26ed9ad814 100644 (file)
@@ -27,7 +27,7 @@ modify this file, you may extend this exception to your version of the
 file, but you are not obligated to do so.  If you do not wish to do
 so, delete this exception statement from your version.  */
 
-#include <config.h>
+#include "wget.h"
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -38,7 +38,6 @@ so, delete this exception statement from your version.  */
 #include <errno.h>
 #include <assert.h>
 
-#include "wget.h"
 #include "url.h"
 #include "recur.h"
 #include "utils.h"
index 0aea66f35f177734ed043f94df58869ddcba4135..1f46f6d1df7332b93e2ab9b71859f5c0283ec375 100644 (file)
--- a/src/res.c
+++ b/src/res.c
@@ -66,9 +66,7 @@ so, delete this exception statement from your version.  */
    res_match_path, res_register_specs, res_get_specs, and
    res_retrieve_file.  */
 
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include "wget.h"
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -76,7 +74,6 @@ so, delete this exception statement from your version.  */
 #include <errno.h>
 #include <assert.h>
 
-#include "wget.h"
 #include "utils.h"
 #include "hash.h"
 #include "url.h"
index 3234286baa8ea48c16a97d62ec52a49561ccc821..53bc5ee3e7543e67dc56571fb21925bc5f4d691c 100644 (file)
@@ -27,7 +27,7 @@ modify this file, you may extend this exception to your version of the
 file, but you are not obligated to do so.  If you do not wish to do
 so, delete this exception statement from your version.  */
 
-#include <config.h>
+#include "wget.h"
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -38,7 +38,6 @@ so, delete this exception statement from your version.  */
 #include <string.h>
 #include <assert.h>
 
-#include "wget.h"
 #include "utils.h"
 #include "retr.h"
 #include "progress.h"
index 37122ad10f51d283f7912fec4d37af93e1f5bcac..391efc288f0e590ef9c564f0ec264633faa28b73 100644 (file)
@@ -26,13 +26,12 @@ modify this file, you may extend this exception to your version of the
 file, but you are not obligated to do so.  If you do not wish to do
 so, delete this exception statement from your version.  */
 
-#include <config.h>
+#include "wget.h"
 
 #include <stdio.h>
 #include <errno.h>
 #include <assert.h>
 
-#include "wget.h"
 #include "spider.h"
 #include "url.h"
 #include "utils.h"
index 9f775ce77583949285288c8ad75eec0c7d09388d..580e3d55b3fd1312d7418e1460fd70d42876d902 100644 (file)
@@ -33,6 +33,78 @@ so, delete this exception statement from your version.  */
 #ifndef SYSDEP_H
 #define SYSDEP_H
 
+/* Testing for __sun is not enough because it's also defined on SunOS.  */
+#ifdef __sun
+# ifdef __SVR4
+#  define solaris
+# endif
+#endif
+
+/* The "namespace tweaks" below attempt to set a friendly "compilation
+   environment" under popular operating systems.  Default compilation
+   environment often means that some functions that are "extensions"
+   are not declared -- `strptime' is one example.
+
+   But non-default environments can expose bugs in the system header
+   files, crippling compilation in _very_ non-obvious ways.  Because
+   of that, we define them only on well-tested architectures where we
+   know they will work.  */
+
+#undef NAMESPACE_TWEAKS
+
+#ifdef solaris
+# define NAMESPACE_TWEAKS
+#endif
+
+#ifdef __linux__
+# define NAMESPACE_TWEAKS
+#endif
+
+#ifdef NAMESPACE_TWEAKS
+
+/* Request the "Unix 98 compilation environment". */
+#define _XOPEN_SOURCE 500
+
+/* For Solaris: request everything else that is available and doesn't
+   conflict with the above.  */
+#define __EXTENSIONS__
+
+/* For Linux: request features of 4.3BSD and SVID (System V Interface
+   Definition). */
+#define _SVID_SOURCE
+#define _BSD_SOURCE
+
+/* Under glibc-based systems we want all GNU extensions as well.  This
+   declares some unnecessary cruft, but also useful functions such as
+   timegm, FNM_CASEFOLD extension to fnmatch, memrchr, etc.  */
+#define _GNU_SOURCE
+
+#endif /* NAMESPACE_TWEAKS */
+
+
+/* Alloca declaration, based on recommendation in the Autoconf manual.
+   These have to be after the above namespace tweaks, but before any
+   non-preprocessor code.  */
+
+#if HAVE_ALLOCA_H
+# include <alloca.h>
+#elif defined WINDOWS
+# include <malloc.h>
+# ifndef alloca
+#  define alloca _alloca
+# endif
+#elif defined __GNUC__
+# define alloca __builtin_alloca
+#elif defined _AIX
+# define alloca __alloca
+#else
+# include <stddef.h>
+# ifdef  __cplusplus
+extern "C"
+# endif
+void *alloca (size_t);
+#endif
+
 /* Must include these, so we can test for the missing stat macros and
    define them as necessary.  */
 #include <sys/types.h>
index 31dc09f654220847ae10836a520d8b13e9815023..2f6dc784939eaf27dd469d7f0169301b1ec4384c 100644 (file)
--- a/src/url.c
+++ b/src/url.c
@@ -27,7 +27,7 @@ modify this file, you may extend this exception to your version of the
 file, but you are not obligated to do so.  If you do not wish to do
 so, delete this exception statement from your version.  */
 
-#include <config.h>
+#include "wget.h"
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -38,7 +38,6 @@ so, delete this exception statement from your version.  */
 #include <errno.h>
 #include <assert.h>
 
-#include "wget.h"
 #include "utils.h"
 #include "url.h"
 #include "host.h"  /* for is_valid_ipv6_address */
index 003b364029fc08ccb2b561941bcbc2d28f058c99..5e31e0e16873e152e8c1fca2bf0454aae164cb81 100644 (file)
@@ -27,7 +27,7 @@ modify this file, you may extend this exception to your version of the
 file, but you are not obligated to do so.  If you do not wish to do
 so, delete this exception statement from your version.  */
 
-#include <config.h>
+#include "wget.h"
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -80,7 +80,6 @@ so, delete this exception statement from your version.  */
 # define USE_SIGNAL_TIMEOUT
 #endif
 
-#include "wget.h"
 #include "utils.h"
 #include "hash.h"
 
index 9d3020646f1647fcb23db5be83f955655f019099..8dcb9f047a454ffa020fbbdf4d29aac3f754feb3 100644 (file)
@@ -35,6 +35,11 @@ so, delete this exception statement from your version.  */
 #ifndef WGET_H
 #define WGET_H
 
+#include "config.h"
+
+/* Include these, so random files need not include them.  */
+#include "sysdep.h"
+
 /* Disable assertions when debug support is not compiled in. */
 #ifndef ENABLE_DEBUG
 # define NDEBUG
@@ -76,9 +81,6 @@ so, delete this exception statement from your version.  */
    debug problems with Wget.  If I get them in a language I don't
    understand, debugging will become a new challenge of its own!  */
 
-
-/* Include these, so random files need not include them.  */
-#include "sysdep.h"
 /* locale independent replacement for ctype.h */
 #include "c-ctype.h"
 
index b003373b629d86ea30e4a5ed5d9b62d214282823..ac80fb38c996e3e20990d4ca1e75a2f42907d27f 100644 (file)
@@ -27,7 +27,7 @@ modify this file, you may extend this exception to your version of the
 file, but you are not obligated to do so.  If you do not wish to do
 so, delete this exception statement from your version.  */
 
-#include <config.h>
+#include "wget.h"
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -35,7 +35,6 @@ so, delete this exception statement from your version.  */
 #include <errno.h>
 #include <assert.h>
 
-#include "wget.h"
 #include "xmalloc.h"
 #include "hash.h"               /* for hash_pointer */