From 38ea4d5dadc634855ee1027c21cc0b1769197014 Mon Sep 17 00:00:00 2001 From: hniksic Date: Tue, 7 Oct 2003 17:05:51 -0700 Subject: [PATCH] [svn] Renamed DEBUG to ENABLE_DEBUG. --- ChangeLog | 4 ++++ configure.in | 4 ++-- src/ChangeLog | 7 +++++++ src/config.h.in | 2 +- src/host.c | 2 +- src/http.c | 2 +- src/init.c | 2 +- src/log.c | 4 ++-- src/main.c | 6 +++--- src/options.h | 4 ++-- src/wget.h | 15 ++++++++------- windows/Makefile.src | 2 +- 12 files changed, 33 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index dfd42046..1d16804d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2003-10-08 Hrvoje Niksic + + * configure.in: Renamed DEBUG to ENABLE_DEBUG. + 2003-10-04 Hrvoje Niksic * libtool.m4: New file with contents imported from libtool. diff --git a/configure.in b/configure.in index 681b157b..3476f89e 100644 --- a/configure.in +++ b/configure.in @@ -71,8 +71,8 @@ test x"${USE_DIGEST}" = xyes && AC_DEFINE(USE_DIGEST) AC_ARG_ENABLE(debug, [ --disable-debug disable support for debugging output], -DEBUG=$enableval, DEBUG=yes) -test x"${DEBUG}" = xyes && AC_DEFINE(DEBUG) +ENABLE_DEBUG=$enableval, ENABLE_DEBUG=yes) +test x"${ENABLE_DEBUG}" = xyes && AC_DEFINE(ENABLE_DEBUG) wget_need_md5=no diff --git a/src/ChangeLog b/src/ChangeLog index 91905e6e..bc2d7573 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2003-10-08 Hrvoje Niksic + + * config.h.in: Renamed DEBUG to ENABLE_DEBUG. ENABLE_DEBUG is, I + think, a better name, because it implies that debugging output is + merely possible, not "on by default", as might be construed from + just DEBUG. + 2003-10-08 Hrvoje Niksic * ftp.c (has_insecure_name_p): Define it here. diff --git a/src/config.h.in b/src/config.h.in index 46807377..b9fc24b8 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -101,7 +101,7 @@ char *alloca (); #undef USE_DIGEST /* Define if you want the debug output support compiled in. */ -#undef DEBUG +#undef ENABLE_DEBUG /* Define if you have sys/time.h header. */ #undef HAVE_SYS_TIME_H diff --git a/src/host.c b/src/host.c index 489adbcc..601487ae 100644 --- a/src/host.c +++ b/src/host.c @@ -585,7 +585,7 @@ cache_host_lookup (const char *host, struct address_list *al) ++al->refcount; hash_table_put (host_name_addresses_map, xstrdup_lower (host), al); -#ifdef DEBUG +#ifdef ENABLE_DEBUG if (opt.debug) { int i; diff --git a/src/http.c b/src/http.c index cd48d9b9..20010de0 100644 --- a/src/http.c +++ b/src/http.c @@ -1136,7 +1136,7 @@ Accept: %s\r\n\ hs->error = xstrdup (error); if ((statcode != -1) -#ifdef DEBUG +#ifdef ENABLE_DEBUG && !opt.debug #endif ) diff --git a/src/init.c b/src/init.c index 8d586b17..0cd65ae5 100644 --- a/src/init.c +++ b/src/init.c @@ -128,7 +128,7 @@ static struct { { "convertlinks", &opt.convert_links, cmd_boolean }, { "cookies", &opt.cookies, cmd_boolean }, { "cutdirs", &opt.cut_dirs, cmd_number }, -#ifdef DEBUG +#ifdef ENABLE_DEBUG { "debug", &opt.debug, cmd_boolean }, #endif { "deleteafter", &opt.delete_after, cmd_boolean }, diff --git a/src/log.c b/src/log.c index 578b0c1f..8ef12520 100644 --- a/src/log.c +++ b/src/log.c @@ -509,7 +509,7 @@ logprintf (enum log_options o, const char *fmt, ...) while (!done); } -#ifdef DEBUG +#ifdef ENABLE_DEBUG /* The same as logprintf(), but does anything only if opt.debug is non-zero. */ void @@ -535,7 +535,7 @@ debug_logprintf (const char *fmt, ...) while (!done); } } -#endif /* DEBUG */ +#endif /* ENABLE_DEBUG */ /* Open FILE and set up a logging stream. If FILE cannot be opened, exit with status of 1. */ diff --git a/src/main.c b/src/main.c index 42ba42d2..b69fb002 100644 --- a/src/main.c +++ b/src/main.c @@ -459,12 +459,12 @@ hpVqvdkKsxmNWrHSLcFbEY:G:g:T:U:O:l:n:i:o:a:t:D:A:R:P:B:e:Q:X:I:w:C:", setoptval ("continue", "on"); break; case 'd': -#ifdef DEBUG +#ifdef ENABLE_DEBUG setoptval ("debug", "on"); -#else /* not DEBUG */ +#else fprintf (stderr, _("%s: debug support not compiled in.\n"), exec_name); -#endif /* not DEBUG */ +#endif break; case 'E': setoptval ("htmlextension", "on"); diff --git a/src/options.h b/src/options.h index 9df52f0a..9895e825 100644 --- a/src/options.h +++ b/src/options.h @@ -130,9 +130,9 @@ struct options int save_headers; /* Do we save headers together with file? */ -#ifdef DEBUG +#ifdef ENABLE_DEBUG int debug; /* Debugging on/off */ -#endif /* DEBUG */ +#endif int timestamping; /* Whether to use time-stamping. */ diff --git a/src/wget.h b/src/wget.h index 4dfe86bd..e742d47a 100644 --- a/src/wget.h +++ b/src/wget.h @@ -34,9 +34,10 @@ so, delete this exception statement from your version. */ #ifndef WGET_H #define WGET_H -#ifndef DEBUG -# define NDEBUG /* To kill off assertions */ -#endif /* not DEBUG */ +/* Disable assertions when debug support is not compiled in. */ +#ifndef ENABLE_DEBUG +# define NDEBUG +#endif /* Define this if you want primitive but extensive malloc debugging. It will make Wget extremely slow, so only do it in development @@ -65,7 +66,7 @@ so, delete this exception statement from your version. */ /* No-op version of gettext, used for constant strings. */ #define N_(string) (string) -/* I18N NOTE: You will notice that none of the DEBUG messages are +/* I18N NOTE: You will notice that none of the DEBUGP messages are marked as translatable. This is intentional, for a few reasons: 1) The debug messages are not meant for the users to look at, but @@ -90,11 +91,11 @@ so, delete this exception statement from your version. */ #define DO_NOTHING do {} while (0) /* Print X if debugging is enabled; a no-op otherwise. */ -#ifdef DEBUG +#ifdef ENABLE_DEBUG # define DEBUGP(x) do { if (opt.debug) { debug_logprintf x; } } while (0) -#else /* not DEBUG */ +#else /* not ENABLE_DEBUG */ # define DEBUGP(x) DO_NOTHING -#endif /* not DEBUG */ +#endif /* not ENABLE_DEBUG */ /* Make gcc check for the format of logmsg() and debug_logmsg(). */ #ifdef __GNUC__ diff --git a/windows/Makefile.src b/windows/Makefile.src index 98e3b132..c881c7f7 100644 --- a/windows/Makefile.src +++ b/windows/Makefile.src @@ -46,7 +46,7 @@ CC = cl LD = link CFLAGS = /nologo /MT /W0 /O2 -#DEBUGCF = /DDEBUG /Zi /Od #/Fd /FR +#DEBUGCF = /DENABLE_DEBUG /Zi /Od #/Fd /FR CPPFLAGS = DEFS = /DWINDOWS /D_CONSOLE /DHAVE_CONFIG_H /DSYSTEM_WGETRC=\"wgetrc\" LDFLAGS = /subsystem:console /incremental:no /warn:3 -- 2.39.2