File indexing completed on 2025-01-26 04:43:58

0001 /* ------------------------------------------------------------------------
0002 @NAME       : bt_debug.h
0003 @DESCRIPTION: Defines various macros needed for compile-time selection
0004               of debugging code.
0005 @GLOBALS    :
0006 @CREATED    :
0007 @MODIFIED   :
0008 @VERSION    : $Id: bt_debug.h,v 1.2 1999/11/29 01:13:10 greg Rel $
0009 @COPYRIGHT  : Copyright (c) 1996-99 by Gregory P. Ward.  All rights reserved.
0010 
0011               This file is part of the btparse library.  This library is
0012               free software; you can redistribute it and/or modify it under
0013               the terms of the GNU General Public License as
0014               published by the Free Software Foundation; either version 2
0015               of the License, or (at your option) any later version.
0016 -------------------------------------------------------------------------- */
0017 
0018 #ifndef BT_DEBUG_H
0019 #define BT_DEBUG_H
0020 
0021 /*
0022  * DEBUG      is the debug level -- an integer, defaults to 0
0023  * DBG_ACTION is a macro to conditionally execute a bit of code --
0024  *            must have compiled with DEBUG true, and the debug level
0025  *            must be >= `level' (the macro argument)
0026  */
0027 
0028 #ifndef DEBUG
0029 # define DEBUG 0
0030 #endif
0031 
0032 #if DEBUG
0033 # define DBG_ACTION(level,action) if (DEBUG >= level) { action; }
0034 #else
0035 # define DBG_ACTION(level,action)
0036 #endif
0037 
0038 #endif /* BT_DEBUG_H */