From d90b08c09fd00001d48567913fdd308cbe9a7ecd Mon Sep 17 00:00:00 2001 From: Fritz Elfert Date: Sun, 27 Aug 2000 23:16:18 +0000 Subject: Added debug config option and modified an assert in Enum.h --- acconfig.h | 9 +++++++++ acinclude.m4 | 8 ++++++-- lib/Enum.h | 6 +++--- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/acconfig.h b/acconfig.h index 5ac67c2..d9c7cb1 100644 --- a/acconfig.h +++ b/acconfig.h @@ -42,7 +42,11 @@ /* Define this to your default mountpoint for plpnfsd */ #undef DMOUNTPOINT +/* Define this to enable debugging code */ +#undef DEBUG + @BOTTOM@ + /* Some reasonable defaults */ #ifndef PSIONHOSTNAME @@ -56,5 +60,10 @@ # define DONT_UPDATE_MTAB /* The mount table is obtained from the kernel (!?) */ #endif +/* Disable assert macro if DEBUG is not defined */ +#ifndef DEBUG +# define NDEBUG +#endif + #endif /* _CONFIG_H_ */ diff --git a/acinclude.m4 b/acinclude.m4 index d406121..c803b59 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -89,8 +89,12 @@ dnl this was AC_PROG_CC. I had to include it manualy, since I had to patch it *-*-sysv4.2uw*) CFLAGS="$CFLAGS -D_UNIXWARE";; esac - if test -z "$LDFLAGS" && test "$ac_use_debug_code" = "no" && test "$GCC" = "yes"; then - LDFLAGS="-s" + if test "$ac_use_debug_code" = "no"; then + if test -z "$LDFLAGS" && test "$GCC" = "yes"; then + LDFLAGS="-s" + fi + else + AC_DEFINE_UNQUOTED(DEBUG) fi diff --git a/lib/Enum.h b/lib/Enum.h index 9cb41ff..8dcaa1b 100644 --- a/lib/Enum.h +++ b/lib/Enum.h @@ -169,9 +169,9 @@ public: * version, assert, that it is really in the Range of * this Enumeration. */ - inline Enum& operator = (E init) { - value = init; - assert(inRange(init)); + inline Enum& operator = (E setval) { + value = setval; + assert(inRange(setval)); return *this; } -- cgit v1.2.3