mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-07 22:04:33 +02:00
Build fix for --enable-debug.
This commit is contained in:
parent
1e637dbbd4
commit
e0c452bb00
@ -24,14 +24,20 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#ifdef NDEBUG
|
#ifdef NDEBUG
|
||||||
# define ASSERT(expr) ((void)0)
|
# if defined(__clang__) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
|
||||||
|
# define ASSERT(expr) __builtin_unreachable()
|
||||||
|
# else
|
||||||
|
# define ASSERT(expr) ((void)0)
|
||||||
|
# endif
|
||||||
#else /* NDEBUG */
|
#else /* NDEBUG */
|
||||||
# define ASSERT(expr) define ASSERT(expr) ((expr) ? 0 : icinga_assert_fail(#expr, __FILE__, __LINE__))
|
# define ASSERT(expr) ((expr) ? 0 : icinga_assert_fail(#expr, __FILE__, __LINE__))
|
||||||
#endif /* NDEBUG */
|
#endif /* NDEBUG */
|
||||||
|
|
||||||
#define VERIFY(expr) ((expr) ? 0 : icinga_assert_fail(#expr, __FILE__, __LINE__))
|
#define VERIFY(expr) ((expr) ? 0 : icinga_assert_fail(#expr, __FILE__, __LINE__))
|
||||||
|
|
||||||
inline void icinga_assert_fail(const char *expr, const char *file, int line)
|
int icinga_assert_fail(const char *expr, const char *file, int line) __attribute__((noreturn));
|
||||||
|
|
||||||
|
inline int icinga_assert_fail(const char *expr, const char *file, int line)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "%s:%d: assertion failed: %s\n", file, line, expr);
|
fprintf(stderr, "%s:%d: assertion failed: %s\n", file, line, expr);
|
||||||
abort();
|
abort();
|
||||||
|
@ -21,12 +21,12 @@
|
|||||||
#define OBJECT_H
|
#define OBJECT_H
|
||||||
|
|
||||||
#include "base/i2-base.h"
|
#include "base/i2-base.h"
|
||||||
|
#include "base/debug.h"
|
||||||
#include <boost/thread/thread.hpp>
|
#include <boost/thread/thread.hpp>
|
||||||
|
|
||||||
#ifndef _DEBUG
|
#ifndef _DEBUG
|
||||||
#include <boost/thread/mutex.hpp>
|
#include <boost/thread/mutex.hpp>
|
||||||
#else /* _DEBUG */
|
#else /* _DEBUG */
|
||||||
#include "base/utility.h"
|
|
||||||
#include <boost/thread/recursive_mutex.hpp>
|
#include <boost/thread/recursive_mutex.hpp>
|
||||||
#endif /* _DEBUG */
|
#endif /* _DEBUG */
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user