summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_log.h
diff options
context:
space:
mode:
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_ */