From 24d07cfdd2b660d11e3ba7f5e77a6c690bfff8ad Mon Sep 17 00:00:00 2001 From: Valentin Bartenev Date: Fri, 9 Feb 2018 19:07:55 +0300 Subject: Made nxt_assert() statements to be compiled only with debug. --- src/nxt_log.h | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'src/nxt_log.h') diff --git a/src/nxt_log.h b/src/nxt_log.h index e32feb14..f5e60129 100644 --- a/src/nxt_log.h +++ b/src/nxt_log.h @@ -122,6 +122,15 @@ nxt_log_debug(_log, ...) \ } while (0) +#define nxt_assert(c) \ + do { \ + if (nxt_slow_path(!(c))) { \ + nxt_thread_log_alert("%s:%d assertion failed: %s", \ + __FILE__, __LINE__, #c); \ + nxt_abort(); \ + } \ + } while (0) + #else #define nxt_debug(...) @@ -129,6 +138,8 @@ nxt_log_debug(_log, ...) \ #define \ nxt_log_debug(...) +#define nxt_assert(c) + #endif @@ -170,17 +181,4 @@ NXT_EXPORT extern nxt_log_t nxt_main_log; NXT_EXPORT extern nxt_str_t nxt_log_levels[]; -#define nxt_assert(c) \ - do { \ - if (nxt_fast_path(c)) { \ - break; \ - \ - } else { \ - nxt_thread_log_alert("%s:%d assertion failed: %s", \ - __FILE__, __LINE__, #c ); \ - nxt_abort(); \ - } \ - } while (0) - - #endif /* _NXT_LOG_H_INCLUDED_ */ -- cgit