diff --git a/ChangeLog b/ChangeLog index 0e3f29fb..7c17082b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2014-06-11 Giuseppe Scrivano + * configure.ac: Do not depend on always defined macros. + * vms/vms.h: Likewise. + * Makefile.am: Remove @VAR@ with $FOO. * util/Makefile.am: Likewise. diff --git a/configure.ac b/configure.ac index fe35c2e2..029b2fed 100644 --- a/configure.ac +++ b/configure.ac @@ -146,8 +146,7 @@ AC_C_VOLATILE dnl Check for basic headers, even though we expect them to exist and dnl #include them unconditionally in the code. Their detection is -dnl still needed because test programs used by Autoconf macros check -dnl for STDC_HEADERS, HAVE_SYS_TYPES_H, etc. before using them. +dnl still needed because test programs used by Autoconf macros check. dnl Without the checks they will fail to be included in test programs, dnl which will subsequently fail. AC_HEADER_STDC @@ -188,9 +187,7 @@ AC_CHECK_TYPES([uint32_t, uintptr_t, intptr_t, int64_t]) AC_CHECK_TYPES(sig_atomic_t, [], [], [ #include #include -#if HAVE_INTTYPES_H -# include -#endif +#include #include ]) diff --git a/src/ChangeLog b/src/ChangeLog index 4a163ce1..2d950b17 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,16 @@ 2014-06-11 Giuseppe Scrivano + * connect.c: Do not depend on always defined macros. + * convert.c: Likewise. + * css-url.c: Likewise. + * hash.c: Likewise. + * mswindows.h: Likewise. + * netrc.c: Likewise. + * progress.c: Likewise. + * sysdep.h: Likewise. + * utils.c: Likewise. + * wget.h: Likewise. + * Makefile.am: Remove @VAR@ with $FOO. * DESCRIP_MODS.MMS: Remove terminating empty lines. diff --git a/src/connect.c b/src/connect.c index 1e4a44ba..1fb18192 100644 --- a/src/connect.c +++ b/src/connect.c @@ -59,10 +59,7 @@ as that of the covered work. */ #include "connect.h" #include "hash.h" -/* Apparently needed for Interix: */ -#ifdef HAVE_STDINT_H -# include -#endif +#include /* Define sockaddr_storage where unavailable (presumably on IPv4-only hosts). */ diff --git a/src/convert.c b/src/convert.c index 6731ac01..31a831be 100644 --- a/src/convert.c +++ b/src/convert.c @@ -465,7 +465,7 @@ write_backup_file (const char *file, downloaded_file_t downloaded_file_return) converted_files = make_string_hash_table (0); /* We can get called twice on the same URL thanks to the - convert_all_links() call in main(). If we write the .orig file + convert_all_links() call in main. If we write the .orig file each time in such a case, it'll end up containing the first-pass conversion, not the original file. So, see if we've already been called on this file. */ @@ -835,7 +835,7 @@ register_download (const char *url, const char *file) hash_table_put (dl_url_file_map, xstrdup (url), xstrdup (file)); } -/* Register that FROM has been redirected to TO. This assumes that TO +/* Register that FROM has been redirected to "TO". This assumes that TO is successfully downloaded and already registered using register_download() above. */ diff --git a/src/css-url.c b/src/css-url.c index da786736..c6057983 100644 --- a/src/css-url.c +++ b/src/css-url.c @@ -41,11 +41,7 @@ as that of the covered work. */ #include #include -#ifdef HAVE_STRING_H -# include -#else -# include -#endif +#include #include #include #include diff --git a/src/hash.c b/src/hash.c index af8e583f..393c7752 100644 --- a/src/hash.c +++ b/src/hash.c @@ -55,11 +55,7 @@ as that of the covered work. */ # endif # include # define c_tolower(x) tolower ((unsigned char) (x)) -# ifdef HAVE_STDINT_H -# include -# else - typedef unsigned long uintptr_t; -# endif +# include #endif #include "hash.h" diff --git a/src/mswindows.h b/src/mswindows.h index e614d843..3b815f00 100644 --- a/src/mswindows.h +++ b/src/mswindows.h @@ -57,13 +57,6 @@ as that of the covered work. */ /* Declares getpid(). */ #include -#ifndef S_ISDIR -# define S_ISDIR(m) (((m) & (_S_IFMT)) == (_S_IFDIR)) -#endif -#ifndef S_ISLNK -# define S_ISLNK(a) 0 -#endif - /* We have strcasecmp and strncasecmp, just under different names. */ #ifndef HAVE_STRCASECMP # define strcasecmp stricmp @@ -90,18 +83,6 @@ typedef __int64 wgint; # define strtoll_type __int64 #endif -/* Windows has no symlink, therefore no lstat. Without symlinks lstat - is equivalent to stat anyway. */ -#define lstat stat - -/* Define LFS aliases for stat and fstat. */ -#ifdef stat_alias -# define stat(f, b) stat_alias (f, b) -#endif -#ifdef fstat_alias -# define fstat(f, b) fstat_alias (f, b) -#endif - #define PATH_SEPARATOR '\\' /* Additional declarations needed for IPv6: */ diff --git a/src/netrc.c b/src/netrc.c index bad574d0..dec9e2a3 100644 --- a/src/netrc.c +++ b/src/netrc.c @@ -161,8 +161,6 @@ search_netrc (const char *host, const char **acc, const char **passwd, #ifdef STANDALONE -#include - /* Normally, these functions would be defined by your package. */ # define xmalloc malloc # define xfree free diff --git a/src/progress.c b/src/progress.c index 0c809eb1..df36e2cb 100644 --- a/src/progress.c +++ b/src/progress.c @@ -36,9 +36,7 @@ as that of the covered work. */ #include #include #include -#ifdef HAVE_WCHAR_H -# include -#endif +#include #include "progress.h" #include "utils.h" diff --git a/src/sysdep.h b/src/sysdep.h index 069882a7..3159c996 100644 --- a/src/sysdep.h +++ b/src/sysdep.h @@ -78,35 +78,15 @@ as that of the covered work. */ These have to be after the above namespace tweaks, but before any non-preprocessor code. */ -#if HAVE_ALLOCA_H -# include -#elif defined WINDOWS -# include -# ifndef alloca -# define alloca _alloca -# endif -#elif defined __GNUC__ -# define alloca __builtin_alloca -#elif defined _AIX -# define alloca __alloca -#else -# include -# ifdef __cplusplus -extern "C" -# endif -void *alloca (size_t); -#endif +#include /* Must include these, so we can test for the missing stat macros and define them as necessary. */ #include #include -#ifdef HAVE_INTTYPES_H - /* Compaq C V6.5-303 (dtk) on HP Tru64 UNIX V5.1B (Rev. 2650) needs: */ -# include -# include -#endif +#include +#include #ifdef WINDOWS /* Windows doesn't have some functions normally found on Unix-like @@ -121,34 +101,6 @@ void *alloca (size_t); /* Provided by gnulib on systems that don't have it: */ # include -/* Needed for compilation under OS/2 and MSDOS */ -#if defined(__EMX__) || defined(MSDOS) -# ifndef S_ISLNK -# define S_ISLNK(m) 0 -# endif -# ifndef lstat -# define lstat stat -# endif -#endif /* __EMX__ || MSDOS */ - -/* Reportedly, stat() macros are broken on some old systems. Those - systems will have to fend for themselves, as I will not introduce - new code to handle it. - - However, I will add code for *missing* macros, and the following - are reportedly missing from many systems. */ -#ifndef S_ISLNK -# define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) -#endif -#ifndef S_ISDIR -# define S_ISDIR(m) (((m) & (_S_IFMT)) == (_S_IFDIR)) -#endif -#ifndef S_ISREG -# define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG) -#endif - -/* These are needed so we can #define struct_stat to struct _stati64 - under Windows. */ #ifndef struct_stat # define struct_stat struct stat #endif @@ -156,6 +108,8 @@ void *alloca (size_t); # define struct_fstat struct stat #endif +#include + /* For CHAR_BIT, LONG_MAX, etc. */ #include @@ -163,9 +117,6 @@ void *alloca (size_t); # define CHAR_BIT 8 #endif -/* From gnulib, simplified to assume a signed type. */ -#define TYPE_MAXIMUM(t) ((t) (~ (~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)))) - /* These are defined in cmpt.c if missing, so we must declare them. */ #ifndef HAVE_STRCASECMP @@ -212,23 +163,7 @@ int vsnprintf (char *str, size_t count, const char *fmt, va_list arg); # define SYSTEM_FNMATCH #endif -#ifdef SYSTEM_FNMATCH -# include -#else /* not SYSTEM_FNMATCH */ -/* Define fnmatch flags. Undef them first to avoid warnings in case - an evil library include chose to include system fnmatch.h. */ -# undef FNM_PATHNAME -# undef FNM_NOESCAPE -# undef FNM_PERIOD -# undef FNM_NOMATCH - -# define FNM_PATHNAME (1 << 0) /* No wildcard can ever match `/'. */ -# define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */ -# define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */ -# define FNM_NOMATCH 1 - -int fnmatch (const char *, const char *, int); -#endif +#include /* Provide sig_atomic_t if the system doesn't. */ #ifndef HAVE_SIG_ATOMIC_T diff --git a/src/utils.c b/src/utils.c index e0a66473..ebce0b83 100644 --- a/src/utils.c +++ b/src/utils.c @@ -65,9 +65,7 @@ as that of the covered work. */ /* For TIOCGWINSZ and friends: */ #include -#ifdef HAVE_TERMIOS_H -# include -#endif +#include /* Needed for Unix version of run_with_timeout. */ #include diff --git a/src/wget.h b/src/wget.h index 6bdbe7a6..331e8e2d 100644 --- a/src/wget.h +++ b/src/wget.h @@ -72,12 +72,6 @@ as that of the covered work. */ variables. -- explanation partly taken from GNU make. */ #define N_(string) string -#if ! ENABLE_NLS -# undef HAVE_WCHAR_H -# undef HAVE_WCWIDTH -# undef HAVE_MBTOWC -#endif /* not ENABLE_NLS */ - #if HAVE_WCWIDTH && HAVE_MBTOWC # define USE_NLS_PROGRESS_BAR 1 #else diff --git a/vms/vms.h b/vms/vms.h index d65aeda2..6053df12 100644 --- a/vms/vms.h +++ b/vms/vms.h @@ -49,16 +49,6 @@ int utime( const char *path, const struct utimbuf *times); #endif /* __CRTL_VER < 70300000 */ -/* Emergency substitution of stat() for lstat() for VAX and VMS CRTL - before V7.3-1. -*/ -#if defined(__VAX) || __CRTL_VER < 70301000 - -#define lstat( __p1, __p2) stat( __p1, __p2) - -#endif /* defined(__VAX) || __CRTL_VER < 70301000 */ - - /* Global storage. */ /* VMS destination file system type. < 0: unset/unknown