]> Dogcows Code - chaz/yoink/blob - src/moof/debug.hh
use only triangles; no quads
[chaz/yoink] / src / moof / debug.hh
1
2 /*] Copyright (c) 2009-2010, Charles McGarvey [**************************
3 **] All rights reserved.
4 *
5 * vi:ts=4 sw=4 tw=75
6 *
7 * Distributable under the terms and conditions of the 2-clause BSD license;
8 * see the file COPYING for a complete text of the license.
9 *
10 **************************************************************************/
11
12 #ifndef _MOOF_DEBUG_HH_
13 #define _MOOF_DEBUG_HH_
14
15 /**
16 * \file debug.hh
17 * Debugging facilities.
18 */
19
20 #include <cstdlib> // exit
21
22 #include <stlplus/portability/debug.hpp>
23
24 #include <moof/log.hh>
25
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) if (!(X)) moof::log_error \
37 << "false assertion at " << __FILE__ << ":" << __LINE__ << ", " \
38 << #X, exit(1)
39 #endif
40
41
42 #endif // _MOOF_DEBUG_HH_
43
This page took 0.032685 seconds and 4 git commands to generate.