00001 // /////////////////////////////////////////////////////////////////////////// 00002 // xrb_debug.hpp by Victor Dods, created 2005/07/03 00003 // /////////////////////////////////////////////////////////////////////////// 00004 // Unless a different license was explicitly granted in writing by the 00005 // copyright holder (Victor Dods), this software is freely distributable under 00006 // the terms of the GNU General Public License, version 2. Any works deriving 00007 // from this work must also be released under the GNU GPL. See the included 00008 // file LICENSE for details. 00009 // /////////////////////////////////////////////////////////////////////////// 00010 00011 #if !defined(_XRB_DEBUG_HPP_) 00012 #define _XRB_DEBUG_HPP_ 00013 00014 // don't include xrb.h here, because xrb.h includes this file. 00015 00016 // debugging level (determines which asserts are compiled in/out) 00017 #if !defined(XRB_DEBUG_LEVEL) 00018 #define XRB_DEBUG_LEVEL 3 00019 #endif // !defined(XRB_DEBUG_LEVEL) 00020 00021 // make sure NDEBUG is not defined (used to compile out assert()) 00022 #if defined(NDEBUG) 00023 #undef NDEBUG 00024 #endif // defined(NDEBUG) 00025 00026 // macro which allows an expression to easily be compiled out 00027 // for non debug builds (for XRB_DEBUG_LEVEL < 1) 00028 #if XRB_DEBUG_LEVEL >= 1 00029 #define DEBUG1_CODE(x) x 00030 #else // XRB_DEBUG_LEVEL < 1 00031 #define DEBUG1_CODE(x) 00032 #endif // XRB_DEBUG_LEVEL < 1 00033 00034 // macro which allows an expression to easily be compiled out 00035 // for non debug builds (for XRB_DEBUG_LEVEL < 2) 00036 #if XRB_DEBUG_LEVEL >= 2 00037 #define DEBUG2_CODE(x) x 00038 #else // XRB_DEBUG_LEVEL < 2 00039 #define DEBUG2_CODE(x) 00040 #endif // XRB_DEBUG_LEVEL < 2 00041 00042 // macro which allows an expression to easily be compiled out 00043 // for non debug builds (for XRB_DEBUG_LEVEL < 3) 00044 #if XRB_DEBUG_LEVEL >= 3 00045 #define DEBUG3_CODE(x) x 00046 #else // XRB_DEBUG_LEVEL < 3 00047 #define DEBUG3_CODE(x) 00048 #endif // XRB_DEBUG_LEVEL < 3 00049 00050 #endif // !defined(_XRB_DEBUG_HPP_) 00051