From 932106f54c35b815756d518b236448b9884d6bde Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Tue, 25 Oct 2005 07:05:03 +0000 Subject: Efficiency hack: call tor_fix_source_file late, not early. Add "BUG" domain. Domains are now bitmasks... just in case. Make some err msgs non-general. svn:r5309 --- src/common/util.h | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'src/common/util.h') diff --git a/src/common/util.h b/src/common/util.h index 1019b5807d..c80bbd6666 100644 --- a/src/common/util.h +++ b/src/common/util.h @@ -39,23 +39,23 @@ #error "Sorry; we don't support building with NDEBUG." #else #ifdef OLD_LOG_INTERFACE -#define tor_assert(expr) do { \ - if (!(expr)) { \ - log(LOG_ERR, "%s:%d: %s: Assertion %s failed; aborting.", \ - _SHORT_FILE_, __LINE__, __FUNCTION__, #expr); \ - fprintf(stderr,"%s:%d %s: Assertion %s failed; aborting.\n", \ - _SHORT_FILE_, __LINE__, __FUNCTION__, #expr); \ - abort(); /* unreached */ \ - } } while (0) +#define tor_assert(expr) do { \ + if (!(expr)) { \ + log(LOG_ERR, "%s:%d: %s: Assertion %s failed; aborting.", \ + _SHORT_FILE_, __LINE__, __FUNCTION__, #expr); \ + fprintf(stderr,"%s:%d %s: Assertion %s failed; aborting.\n", \ + _SHORT_FILE_, __LINE__, __FUNCTION__, #expr); \ + abort(); /* unreached */ \ + } } while (0) #else -#define tor_assert(expr) do { \ - if (!(expr)) { \ - log(LOG_ERR, LD_GENERAL, "%s:%d: %s: Assertion %s failed; aborting.", \ - _SHORT_FILE_, __LINE__, __FUNCTION__, #expr); \ - fprintf(stderr,"%s:%d %s: Assertion %s failed; aborting.\n", \ - _SHORT_FILE_, __LINE__, __FUNCTION__, #expr); \ - abort(); /* unreached */ \ - } } while (0) +#define tor_assert(expr) do { \ + if (!(expr)) { \ + log(LOG_ERR, LD_BUG, "%s:%d: %s: Assertion %s failed; aborting.", \ + _SHORT_FILE_, __LINE__, __FUNCTION__, #expr); \ + fprintf(stderr,"%s:%d %s: Assertion %s failed; aborting.\n", \ + _SHORT_FILE_, __LINE__, __FUNCTION__, #expr); \ + abort(); /* unreached */ \ + } } while (0) #endif #endif -- cgit v1.2.3-54-g00ecf