]> Dogcows Code - chaz/yoink/blob - src/moof/debug.hh
fixed documentation about where to find licenses
[chaz/yoink] / src / moof / debug.hh
1
2 /*] Copyright (c) 2009-2011, Charles McGarvey [*****************************
3 **] All rights reserved.
4 *
5 * Distributable under the terms and conditions of the 2-clause BSD license;
6 * see the file COPYING for a complete text of the license.
7 *
8 *****************************************************************************/
9
10 #ifndef _MOOF_DEBUG_HH_
11 #define _MOOF_DEBUG_HH_
12
13 #include <exception>
14
15 #include <moof/log.hh>
16
17
18 /**
19 * \file debug.hh
20 * Debugging facilities.
21 */
22
23 #define STRINGIZE(X) #X
24 #define QUOTE_MACRO(X) STRINGIZE(X)
25 #define FILELINE __FILE__":"QUOTE_MACRO(__LINE__)
26
27 #undef ASSERT
28 #ifdef NDEBUG
29 #define ASSERT(X)
30 #else
31 /**
32 * Macro which tests an assertion and issues a log_error() and exits if the
33 * assertion is false.
34 * \param X test to perform.
35 */
36 #define ASSERT(X) \
37 if (!(X)) moof::log_error \
38 << "false assertion at " << FILELINE << ", " << #X, std::terminate()
39 #endif
40
41
42 #endif // _MOOF_DEBUG_HH_
43
This page took 0.029783 seconds and 4 git commands to generate.