Class documentation of Concepts

Loading...
Searching...
No Matches
debug.hh
Go to the documentation of this file.
1
6#ifndef debug_hh
7#define debug_hh
8
9#ifdef DEBUG
10
11#include <iomanip>
12#include <sys/types.h>
13
14#if defined (__GNUC__) || defined(__SUNPRO_CC)
15// # ifdef __GNUC__
16// # define DEBUG_FUNCTION __PRETTY_FUNCTION__
17// # else
18# define DEBUG_FUNCTION __func__
19// # endif
20#else
21# define __PRETTY_FUNCTION__ "(unknown)"
22# define DEBUG_FUNCTION __PRETTY_FUNCTION__
23#endif
24
25namespace concepts {
26 char* shorten(const char* FILE);
27}
28
29#define DEBUGL(doit, msg)\
30DPL(doit, "␛[34m[" << concepts::shorten(__FILE__) << ':' << std::setw(4) \
31 << __LINE__ << "]␛[m " << DEBUG_FUNCTION << " --", msg)
32
33#define DPL(doit, msg, var)\
34if(doit!=0) std::cout << msg << " " << var << std::endl;
35
36#define DP(doit, msg, var)\
37if(doit!=0) std::cout << msg << " " << var;
38
39#else
40# define DEBUGL(doit, msg)
41# define DP(doit, msg, var)
42# define DPL(doit, msg, var)
43# ifndef NDEBUG
44# define NDEBUG // discard assertions
45# endif
46#endif
47
48#include <iostream>
49#include <cassert>
50#include <iomanip>
51#include <cstring>
52
53#endif // debug_hh
54
Set< F > makeSet(uint n, const F &first,...)
Definition set.hh:320