From c4478030767a7312dd32c5cfb8ef26d731d68e06 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 12 Oct 2006 19:43:47 +0200 Subject: [PATCH] thr_alarm.c, thr_lock.c, my_global.h: Avoid multiple define of DBUG_OFF (bug#21749) mysys/thr_alarm.c: Avoid multiple define of DBUG_OFF (bug#21749) mysys/thr_lock.c: Avoid multiple define of DBUG_OFF (bug#21749) include/my_global.h: Avoid multiple define of DBUG_OFF (bug#21749) --- include/my_global.h | 9 +++++++-- mysys/thr_alarm.c | 3 +-- mysys/thr_lock.c | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/include/my_global.h b/include/my_global.h index 39947735f3c..a7ec41068b3 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -614,12 +614,17 @@ C_MODE_END #define _STATIC_VARARGS(X) X #define _PC(X) X +/* The DBUG_ON flag always takes precedence over default DBUG_OFF */ #if defined(DBUG_ON) && defined(DBUG_OFF) #undef DBUG_OFF #endif -#if defined(_lint) && !defined(DBUG_OFF) -#define DBUG_OFF +/* We might be forced to turn debug off, if not turned off already */ +#if (defined(FORCE_DBUG_OFF) || defined(_lint)) && !defined(DBUG_OFF) +# define DBUG_OFF +# ifdef DBUG_ON +# undef DBUG_ON +# endif #endif #include diff --git a/mysys/thr_alarm.c b/mysys/thr_alarm.c index dcb41837d96..c55cc32b47d 100644 --- a/mysys/thr_alarm.c +++ b/mysys/thr_alarm.c @@ -15,8 +15,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* To avoid problems with alarms in debug code, we disable DBUG here */ -#undef DBUG_OFF -#define DBUG_OFF +#define FORCE_DBUG_OFF #include #if defined(THREAD) && !defined(DONT_USE_THR_ALARM) diff --git a/mysys/thr_lock.c b/mysys/thr_lock.c index 36cb83ae754..a2c42ee326c 100644 --- a/mysys/thr_lock.c +++ b/mysys/thr_lock.c @@ -72,7 +72,7 @@ multiple read locks. */ #if !defined(MAIN) && !defined(DBUG_OFF) && !defined(EXTRA_DEBUG) -#define DBUG_OFF +#define FORCE_DBUG_OFF #endif #include "mysys_priv.h"