Main Page   Reference Manual   Compound List   File List  

libecc/debug.h

Go to the documentation of this file.
00001 //
00011 //
00012 // This file is part of the libecc package.
00013 // Copyright (C) 2002, by
00014 // 
00015 // Carlo Wood, Run on IRC <carlo@alinoe.com>
00016 // RSA-1024 0x624ACAD5 1997-01-26                    Sign & Encrypt
00017 // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6  F6 F6 55 DD 1C DC FF 61
00018 //
00019 // This program is free software; you can redistribute it and/or
00020 // modify it under the terms of the GNU General Public License
00021 // as published by the Free Software Foundation; either version 2
00022 // of the License, or (at your option) any later version.
00023 // 
00024 // This program is distributed in the hope that it will be useful,
00025 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00026 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00027 // GNU General Public License for more details.
00028 // 
00029 // You should have received a copy of the GNU General Public License
00030 // along with this program; if not, write to the Free Software
00031 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00032 
00033 #ifndef LIBECC_DEBUG_H
00034 #define LIBECC_DEBUG_H
00035 
00036 #ifndef CWDEBUG
00037 
00038 #include <iostream>
00039 
00040 #define AllocTag1(p)
00041 #define AllocTag2(p, desc)
00042 #define AllocTag_dynamic_description(p, x)
00043 #define AllocTag(p, x)
00044 #define Debug(x)
00045 #define Dout(a, b)
00046 #define DoutFatal(a, b) LibcwDoutFatal(::std, , a, b)
00047 #define ForAllDebugChannels(STATEMENT)
00048 #define ForAllDebugObjects(STATEMENT)
00049 #define LibcwDebug(dc_namespace, x)
00050 #define LibcwDout(a, b, c, d)
00051 #define LibcwDoutFatal(a, b, c, d) do { ::std::cerr << d << ::std::endl; ::std::exit(254); } while(1)
00052 #define NEW(x) new x
00053 #define CWDEBUG_ALLOC 0
00054 #define CWDEBUG_MAGIC 0
00055 #define CWDEBUG_LOCATION 0
00056 #define CWDEBUG_LIBBFD 0
00057 #define CWDEBUG_DEBUG 0
00058 #define CWDEBUG_DEBUGOUTPUT 0
00059 #define CWDEBUG_DEBUGM 0
00060 #define CWDEBUG_DEBUGT 0
00061 #define CWDEBUG_MARKER 0
00062 
00063 #else // CWDEBUG
00064 
00065 #ifndef DEBUGCHANNELS
00066 #define DEBUGCHANNELS ::libecc::debug::channels
00067 #endif
00068 #include <libcw/debug.h>
00069 
00070 namespace libecc {
00071   namespace debug {
00072     namespace channels {
00073       namespace dc {
00074         using namespace ::libcw::debug::channels::dc;
00075 
00076         extern ::libcw::debug::channel_ct ecc;
00077 
00078       } // namespace dc
00079     } // namespace DEBUGCHANNELS
00080   }
00081 }
00082 
00083 #endif // CWDEBUG
00084 
00085 // Define private debug output macros for use in header files of the library.
00086 #ifdef CWDEBUG
00087 #define LibEccDout(cntrl, data) LibcwDout(DEBUGCHANNELS, libcw::debug::libcw_do, cntrl, data)
00088 #define LibEccDoutFatal(cntrl, data) LibcwDoutFatal(DEBUGCHANNELS, libcw::debug::libcw_do, cntrl, data)
00089 #else
00090 #define LibEccDout(cntrl, data)
00091 #define LibEccDoutFatal(cntrl, data) LibcwDoutFatal(::std, , cntrl, data)
00092 #endif
00093 
00094 #endif // LIBECC_DEBUG_H
Copyright © 2002 Carlo Wood.  All rights reserved.