#include "livestatus/orfilter.h"
#include "livestatus/andfilter.h"
#include "icinga/externalcommandprocessor.h"
-#include "base/utility.h"
+#include "base/debug.h"
#include "base/convert.h"
#include "base/objectlock.h"
#include "base/logger_fwd.h"
consolelogger.h \
convert.cpp \
convert.h \
+ debug.h \
dictionary.cpp \
dictionary.h \
dynamicobject.cpp \
#include "base/exception.h"
#include "base/objectlock.h"
#include "base/utility.h"
+#include "base/debug.h"
#include <sstream>
#include <boost/algorithm/string/classification.hpp>
#include <boost/thread/thread.hpp>
#include "base/array.h"
#include "base/objectlock.h"
-#include "base/utility.h"
+#include "base/debug.h"
#include <cJSON.h>
#include <boost/make_shared.hpp>
#include <boost/foreach.hpp>
--- /dev/null
+/******************************************************************************
+ * Icinga 2 *
+ * Copyright (C) 2012 Icinga Development Team (http://www.icinga.org/) *
+ * *
+ * This program is free software; you can redistribute it and/or *
+ * modify it under the terms of the GNU General Public License *
+ * as published by the Free Software Foundation; either version 2 *
+ * of the License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the Free Software Foundation *
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
+ ******************************************************************************/
+
+#ifndef DEBUG_H
+#define DEBUG_H
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#ifdef NDEBUG
+# define ASSERT(expr) ((void)0)
+#else /* NDEBUG */
+# define ASSERT(expr) define ASSERT(expr) ((expr) ? 0 : icinga_assert_fail(#expr, __FILE__, __LINE__))
+#endif /* NDEBUG */
+
+#define VERIFY(expr) ((expr) ? 0 : icinga_assert_fail(#expr, __FILE__, __LINE__))
+
+inline void icinga_assert_fail(const char *expr, const char *file, int line)
+{
+ fprintf(stderr, "%s:%d: assertion failed: %s\n", file, line, expr);
+ abort();
+}
+
+#endif /* DEBUG_H */
#include "base/dictionary.h"
#include "base/objectlock.h"
-#include "base/utility.h"
+#include "base/debug.h"
#include <cJSON.h>
#include <boost/tuple/tuple.hpp>
#include <boost/make_shared.hpp>
#include "base/netstring.h"
#include "base/registry.h"
#include "base/stdiostream.h"
-#include "base/utility.h"
+#include "base/debug.h"
#include "base/objectlock.h"
#include "base/logger_fwd.h"
#include "base/exception.h"
******************************************************************************/
#include "base/dynamictype.h"
-#include "base/utility.h"
+#include "base/debug.h"
#include "base/objectlock.h"
using namespace icinga;
#include "base/i2-base.h"
#include "base/registry.h"
#include "base/dynamicobject.h"
-#include "base/utility.h"
+#include "base/debug.h"
#include <map>
#include <set>
#include <boost/function.hpp>
******************************************************************************/
#include "base/netstring.h"
-#include "base/utility.h"
+#include "base/debug.h"
#include <sstream>
using namespace icinga;
******************************************************************************/
#include "base/objectlock.h"
-#include "base/utility.h"
+#include "base/debug.h"
using namespace icinga;
#include "base/dynamictype.h"
#include "base/logger_fwd.h"
#include "base/objectlock.h"
-#include "base/utility.h"
+#include "base/debug.h"
using namespace icinga;
m_Language = bag->Get("language");
m_Code = bag->Get("code");
-}
\ No newline at end of file
+}
#include "base/threadpool.h"
#include "base/logger_fwd.h"
#include "base/convert.h"
+#include "base/debug.h"
#include "base/utility.h"
#include <sstream>
#include <iostream>
#include "base/timer.h"
#include "base/application.h"
+#include "base/debug.h"
#include "base/utility.h"
#include "base/logger_fwd.h"
#include <boost/bind.hpp>
#include "base/tlsstream.h"
#include "base/stream_bio.h"
#include "base/objectlock.h"
+#include "base/debug.h"
#include "base/utility.h"
#include "base/exception.h"
#include <boost/bind.hpp>
}
-#ifdef _DEBUG
-# include <cassert>
-# define ASSERT(expr) assert(expr)
-#else /* _DEBUG */
-# define ASSERT(expr) __builtin_unreachable()
-#endif /* _DEBUG */
-
#endif /* UTILITY_H */
#include "base/dynamictype.h"
#include "base/objectlock.h"
#include "base/logger_fwd.h"
-#include "base/utility.h"
+#include "base/debug.h"
#include <sstream>
#include <boost/tuple/tuple.hpp>
#include <boost/smart_ptr/make_shared.hpp>
#include "config/expression.h"
#include "config/expressionlist.h"
#include "base/objectlock.h"
-#include "base/utility.h"
+#include "base/debug.h"
#include "base/array.h"
#include <sstream>
#include <boost/tuple/tuple.hpp>
#include "icinga/eventcommand.h"
#include "base/dynamictype.h"
#include "base/objectlock.h"
-#include "base/utility.h"
+#include "base/debug.h"
#include <boost/smart_ptr/make_shared.hpp>
#include <boost/foreach.hpp>
#include <boost/tuple/tuple.hpp>
#include "base/timer.h"
#include "base/convert.h"
#include "base/scriptfunction.h"
-#include "base/utility.h"
+#include "base/debug.h"
#include "config/configitembuilder.h"
#include "config/configcompilercontext.h"
#include <boost/tuple/tuple.hpp>
#include "base/logger_fwd.h"
#include "base/objectlock.h"
#include "base/convert.h"
+#include "base/debug.h"
+#include "base/utility.h"
#include "base/timer.h"
#include <boost/smart_ptr/make_shared.hpp>
#include "base/exception.h"
#include "base/objectlock.h"
#include "base/logger_fwd.h"
-#include "base/utility.h"
+#include "base/debug.h"
#include <boost/smart_ptr/make_shared.hpp>
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/classification.hpp>
#include "ido/dbtype.h"
#include "ido/dbconnection.h"
#include "base/objectlock.h"
-#include "base/utility.h"
+#include "base/debug.h"
#include <boost/thread/once.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/foreach.hpp>