mariadb/innobase/include/ut0dbg.h
unknown a7d2204348 InnoDB cleanup: eliminate IB__FILE__
innobase/btr/btr0cur.c:
  Replace IB__FILE__ with __FILE__
innobase/btr/btr0sea.c:
  Replace IB__FILE__ with __FILE__
innobase/buf/buf0buf.c:
  Replace IB__FILE__ with __FILE__
  Add const qualifiers
innobase/ibuf/ibuf0ibuf.c:
  Replace IB__FILE__ with __FILE__
innobase/include/buf0buf.h:
  Replace IB__FILE__ with __FILE__
  Add const qualifiers
innobase/include/buf0buf.ic:
  Replace IB__FILE__ with __FILE__
innobase/include/mem0mem.h:
  Replace IB__FILE__ with __FILE__
  Add const qualifiers
innobase/include/mem0mem.ic:
  Add const qualifiers
innobase/include/mtr0mtr.h:
  Replace IB__FILE__ with __FILE__
  Add const qualifiers
innobase/include/mtr0mtr.ic:
  Add const qualifiers
innobase/include/pars0pars.h:
  Add const qualifiers
innobase/include/sync0arr.h:
  Add const qualifiers
innobase/include/sync0ipm.ic:
  Replace IB__FILE__ with __FILE__
innobase/include/sync0rw.h:
  Replace IB__FILE__ with __FILE__
  Add const qualifiers
innobase/include/sync0rw.ic:
  Add const qualifiers
innobase/include/sync0sync.h:
  Replace IB__FILE__ with __FILE__
  Add const qualifiers
innobase/include/sync0sync.ic:
  Add const qualifiers
innobase/include/univ.i:
  Remove IB__FILE__
innobase/include/ut0dbg.h:
  Replace IB__FILE__ with __FILE__
innobase/lock/lock0lock.c:
  Replace IB__FILE__ with __FILE__
innobase/log/log0recv.c:
  Replace IB__FILE__ with __FILE__
innobase/mem/mem0mem.c:
  Add const qualifiers
innobase/pars/pars0pars.c:
  Add const qualifiers
innobase/sync/sync0arr.c:
  Add const qualifiers
innobase/sync/sync0rw.c:
  Replace IB__FILE__ with __FILE__
  Add const qualifiers
innobase/sync/sync0sync.c:
  Add const qualifiers
innobase/trx/trx0rec.c:
  Replace IB__FILE__ with __FILE__
2004-05-14 16:06:21 +03:00

63 lines
1.7 KiB
C

/*********************************************************************
Debug utilities for Innobase
(c) 1994, 1995 Innobase Oy
Created 1/30/1994 Heikki Tuuri
**********************************************************************/
#ifndef ut0dbg_h
#define ut0dbg_h
#include "univ.i"
#include <stdlib.h>
#include "os0thread.h"
extern ulint ut_dbg_zero; /* This is used to eliminate
compiler warnings */
extern ibool ut_dbg_stop_threads;
extern ulint* ut_dbg_null_ptr;
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) do {\
if (!((ulint)(EXPR) + ut_dbg_zero)) {\
ut_print_timestamp(stderr);\
fprintf(stderr, ut_dbg_msg_assert_fail,\
os_thread_pf(os_thread_get_curr_id()), __FILE__,\
(ulint)__LINE__);\
fputs("InnoDB: Failing assertion: " #EXPR "\n", stderr);\
fputs(ut_dbg_msg_trap, stderr);\
ut_dbg_stop_threads = TRUE;\
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()), __FILE__, (ulint)__LINE__);\
os_thread_sleep(1000000000);\
}\
} while (0)
#define ut_error do {\
ut_print_timestamp(stderr);\
fprintf(stderr, ut_dbg_msg_assert_fail,\
os_thread_pf(os_thread_get_curr_id()), __FILE__, (ulint)__LINE__);\
fprintf(stderr, ut_dbg_msg_trap);\
ut_dbg_stop_threads = TRUE;\
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) do {EXPR;} while (0)
#else
#define ut_ad(EXPR)
#define ut_d(EXPR)
#endif
#define UT_NOT_USED(A) A = A
#endif