Introduced njs_assert() macro.
diff --git a/src/njs_assert.h b/src/njs_assert.h
new file mode 100644
index 0000000..55583ca
--- /dev/null
+++ b/src/njs_assert.h
@@ -0,0 +1,27 @@
+
+/*
+ * Copyright (C) Dmitry Volyntsev
+ * Copyright (C) NGINX, Inc.
+ */
+
+#ifndef _NJS_ASSERT_H_INCLUDED_
+#define _NJS_ASSERT_H_INCLUDED_
+
+#if (NJS_DEBUG)
+
+#define njs_assert(condition)                                                 \
+    do {                                                                      \
+        if (!(condition)) {                                                   \
+            njs_stderror("Assertion \"%s\" failed at %s:%d\n", #condition,    \
+                         __FILE__, __LINE__);                                 \
+            abort();                                                          \
+        }                                                                     \
+    } while (0)
+
+#else
+
+#define njs_assert(condition) (void) (condition)
+
+#endif
+
+#endif /* _NJS_ASSERT_H_INCLUDED_ */
diff --git a/src/njs_main.h b/src/njs_main.h
index f59791d..9884d2b 100644
--- a/src/njs_main.h
+++ b/src/njs_main.h
@@ -36,6 +36,7 @@
 #include <njs_chb.h>
 #include <njs_utils.h>
 #include <njs_sprintf.h>
+#include <njs_assert.h>
 
 #include <njs_pcre.h>
 #include <njs_regex.h>