diff options
Diffstat (limited to 'innobase/include/ut0dbg.h')
-rw-r--r-- | innobase/include/ut0dbg.h | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/innobase/include/ut0dbg.h b/innobase/include/ut0dbg.h index 9b07d5da488..085b4811a73 100644 --- a/innobase/include/ut0dbg.h +++ b/innobase/include/ut0dbg.h @@ -10,7 +10,6 @@ Created 1/30/1994 Heikki Tuuri #define ut0dbg_h #include "univ.i" -#include <assert.h> #include <stdlib.h> #include "os0thread.h" @@ -24,7 +23,7 @@ extern const char* ut_dbg_msg_assert_fail; extern const char* ut_dbg_msg_trap; extern const char* ut_dbg_msg_stop; -#define ut_a(EXPR)\ +#define ut_a(EXPR) do {\ if (!((ulint)(EXPR) + ut_dbg_zero)) {\ ut_print_timestamp(stderr);\ fprintf(stderr, ut_dbg_msg_assert_fail,\ @@ -33,38 +32,32 @@ extern const char* ut_dbg_msg_stop; fputs("InnoDB: Failing assertion: " #EXPR "\n", stderr);\ fputs(ut_dbg_msg_trap, stderr);\ ut_dbg_stop_threads = TRUE;\ - (*ut_dbg_null_ptr)++;\ + if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = NULL;\ }\ if (ut_dbg_stop_threads) {\ fprintf(stderr, ut_dbg_msg_stop,\ os_thread_pf(os_thread_get_curr_id()), IB__FILE__, (ulint)__LINE__);\ os_thread_sleep(1000000000);\ - } + }\ +} while (0) -#define ut_error\ +#define ut_error do {\ ut_print_timestamp(stderr);\ fprintf(stderr, ut_dbg_msg_assert_fail,\ os_thread_pf(os_thread_get_curr_id()), IB__FILE__, (ulint)__LINE__);\ fprintf(stderr, ut_dbg_msg_trap);\ ut_dbg_stop_threads = TRUE;\ - (*ut_dbg_null_ptr)++; + if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = NULL;\ +} while (0) #ifdef UNIV_DEBUG #define ut_ad(EXPR) ut_a(EXPR) -#define ut_d(EXPR) {EXPR;} +#define ut_d(EXPR) do {EXPR;} while (0) #else #define ut_ad(EXPR) #define ut_d(EXPR) #endif - #define UT_NOT_USED(A) A = A - - - - - - #endif - |