#define ldlog_p1(cct, sub, lvl) \
(cct->_conf->subsys.should_gather((sub), (lvl)))
-// NOTE: depend on magic value in _ASSERT_H so that we detect when
-// /usr/include/assert.h clobbers our fancier version.
#define dendl_impl std::flush; \
- _ASSERT_H->_log->submit_entry(_dout_e); \
+ _dout_cct->_log->submit_entry(_dout_e); \
} \
} while (0)
# include "acconfig.h"
#endif
-#ifdef __cplusplus
class CephContext;
namespace ceph {
struct BackTrace;
-#endif
/*
* For GNU, test specific version features. Otherwise (e.g. LLVM) we'll use
# define __CEPH_ASSERT_FUNCTION ((__const char *) 0)
#endif
-#ifdef __cplusplus
extern void register_assert_context(CephContext *cct);
-#endif
struct assert_data {
const char *assertion;
__attribute__ ((__noreturn__));
extern void __ceph_assert_warn(const char *assertion, const char *file, int line, const char *function);
-#ifndef CEPH_ASSERT_FAIL_DEPR
-#define CEPH_ASSERT_FAIL_DEPR
-[[deprecated, noreturn]]
-void inline __ceph_assert_fail_depr(const assert_data &ctx) {
- __ceph_assert_fail(ctx);
-}
-#endif
-
-#ifdef __cplusplus
-# define _CEPH_ASSERT_VOID_CAST static_cast<void>
-#else
-# define _CEPH_ASSERT_VOID_CAST (void)
-#endif
+#define _CEPH_ASSERT_VOID_CAST static_cast<void>
#define assert_warn(expr) \
((expr) \
? _CEPH_ASSERT_VOID_CAST (0) \
: __ceph_assert_warn (__STRING(expr), __FILE__, __LINE__, __CEPH_ASSERT_FUNCTION))
-#ifdef __cplusplus
}
using namespace ceph;
-#endif
/*
* ceph_abort aborts the program with a nice backtrace.
abort(); \
}
-#endif
-
-// wipe any prior assert definition
-#ifdef assert
-# undef assert
-#endif
-
-// make _ASSERT_H something that *must* have a value other than what
-// /usr/include/assert.h gives it (nothing!), so that we detect when
-// our assert is clobbered.
-#undef _ASSERT_H
-#define _ASSERT_H _dout_cct
-
-// make __ASSERT_FUNCTION empty (/usr/include/assert.h makes it a function)
-// and make our encoding macros break if it non-empty.
-#undef __ASSERT_FUNCTION
-#define __ASSERT_FUNCTION
-
-#define assert(expr) \
- do { static const ceph::assert_data assert_data_ctx = \
- {__STRING(expr), __FILE__, __LINE__, __CEPH_ASSERT_FUNCTION}; \
- ((expr) \
- ? _CEPH_ASSERT_VOID_CAST (0) \
- : __ceph_assert_fail_depr(assert_data_ctx)); } while(false)
-
#define ceph_assert(expr) \
do { static const ceph::assert_data assert_data_ctx = \
{__STRING(expr), __FILE__, __LINE__, __CEPH_ASSERT_FUNCTION}; \
((expr) \
? _CEPH_ASSERT_VOID_CAST (0) \
: __ceph_assertf_fail (__STRING(expr), __FILE__, __LINE__, __CEPH_ASSERT_FUNCTION, __VA_ARGS__))
+
+#endif