1 /* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
9 # define ASSERT(expr) ((void)0)
11 # define ASSERT(expr) ((expr) ? 0 : icinga_assert_fail(#expr, __FILE__, __LINE__))
14 #define VERIFY(expr) ((expr) ? 0 : icinga_assert_fail(#expr, __FILE__, __LINE__))
17 # define NORETURNPRE __declspec(noreturn)
23 # define NORETURNPOST __attribute__((noreturn))
28 NORETURNPRE int icinga_assert_fail(const char *expr, const char *file, int line) NORETURNPOST;
31 # pragma warning( push )
32 # pragma warning( disable : 4646 ) /* function declared with __declspec(noreturn) has non-void return type */
35 inline int icinga_assert_fail(const char *expr, const char *file, int line)
37 fprintf(stderr, "%s:%d: assertion failed: %s\n", file, line, expr);
40 #if !defined(__GNUC__) && !defined(_MSC_VER)
42 #endif /* !defined(__GNUC__) && !defined(_MSC_VER) */
46 # pragma warning( pop )