+#define assert_se(expr) \
+ do { \
+ if (_unlikely(!(expr))) { \
+ log_error("Assertion '%s' failed at %s:%u, function %s(). Aborting.", \
+ #expr , __FILE__, __LINE__, __PRETTY_FUNCTION__); \
+ abort(); \
+ } \
+ } while (false) \
+
+/* We override the glibc assert() here. */
+#undef assert
+#ifdef NDEBUG
+#define assert(expr) do {} while(false)
+#else
+#define assert(expr) assert_se(expr)
+#endif