Lets keep our version of opftpd in the CVS
[oftpd.git] / src / daemon_assert.h
1 #ifndef DAEMON_ASSERT_H
2 #define DAEMON_ASSERT_H
3
4 #ifdef NDEBUG
5
6 #define daemon_assert(expr)
7
8 #else
9
10 void daemon_assert_fail(const char *assertion,
11                         const char *file,
12                         int line,
13                         const char *function);
14
15 #define daemon_assert(expr)                                                   \
16            ((expr) ? 0 :                                                      \
17             (daemon_assert_fail(__STRING(expr), __FILE__, __LINE__, __func__)))
18
19 #endif
20
21 #endif /* DAEMON_ASSERT_H */