summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_log.h
diff options
context:
space:
mode:
authorValentin Bartenev <vbart@nginx.com>2018-02-09 19:07:55 +0300
committerValentin Bartenev <vbart@nginx.com>2018-02-09 19:07:55 +0300
commit24d07cfdd2b660d11e3ba7f5e77a6c690bfff8ad (patch)
treed1b85adebedad36ef9d71d00279f3fd380aa62ce /src/nxt_log.h
parentfc496c19ac124c7412e1539d15dd99decc4ecd33 (diff)
downloadunit-24d07cfdd2b660d11e3ba7f5e77a6c690bfff8ad.tar.gz
unit-24d07cfdd2b660d11e3ba7f5e77a6c690bfff8ad.tar.bz2
Made nxt_assert() statements to be compiled only with debug.
Diffstat (limited to 'src/nxt_log.h')
-rw-r--r--src/nxt_log.h24
1 files changed, 11 insertions, 13 deletions
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_ */