X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2Fmoof%2Fdebug.hh;h=a131ce950458ad2cc7d5f06fc41de5f729b6c889;hp=837340f242eb7bef7999e7dd7ab1913d3a0cf3c3;hb=62f3ceaff75a6b08cb1aec9a465773bb81a2d79d;hpb=449366f5f32d24f2a2a6589da6e16b2bf0d61773 diff --git a/src/moof/debug.hh b/src/moof/debug.hh index 837340f..a131ce9 100644 --- a/src/moof/debug.hh +++ b/src/moof/debug.hh @@ -1,28 +1,28 @@ -/*] Copyright (c) 2009-2010, Charles McGarvey [************************** +/*] Copyright (c) 2009-2011, Charles McGarvey [***************************** **] All rights reserved. * -* vi:ts=4 sw=4 tw=75 -* * Distributable under the terms and conditions of the 2-clause BSD license; * see the file COPYING for a complete text of the license. * -**************************************************************************/ +*****************************************************************************/ #ifndef _MOOF_DEBUG_HH_ #define _MOOF_DEBUG_HH_ +#include + +#include + + /** * \file debug.hh * Debugging facilities. */ -#include // exit - -#include - -#include - +#define STRINGIZE(X) #X +#define QUOTE_MACRO(X) STRINGIZE(X) +#define FILELINE __FILE__":"QUOTE_MACRO(__LINE__) #undef ASSERT #ifdef NDEBUG @@ -33,9 +33,9 @@ * assertion is false. * \param X test to perform. */ -#define ASSERT(X) if (!(X)) moof::log_error \ - << "false assertion at " << __FILE__ << ":" << __LINE__ << ", " \ - << #X, exit(1) +#define ASSERT(X) \ + if (!(X)) moof::log_error \ + << "false assertion at " << FILELINE << ", " << #X, std::terminate() #endif