diff --git a/src/include/assert.h b/src/include/assert.h index a85452a17e8a2..c52ccea4ea33d 100644 --- a/src/include/assert.h +++ b/src/include/assert.h @@ -76,10 +76,6 @@ extern void __ceph_assertf_fail(const char *assertion, const char *file, int lin __attribute__ ((__noreturn__)); extern void __ceph_assert_warn(const char *assertion, const char *file, int line, const char *function); -#define ceph_assert(expr) \ - ((expr) \ - ? __CEPH_ASSERT_VOID_CAST (0) \ - : __ceph_assert_fail (__STRING(expr), __FILE__, __LINE__, __CEPH_ASSERT_FUNCTION)) #define assert_warn(expr) \ ((expr) \ @@ -128,6 +124,10 @@ using namespace ceph; ((expr) \ ? __CEPH_ASSERT_VOID_CAST (0) \ : __ceph_assert_fail (__STRING(expr), __FILE__, __LINE__, __CEPH_ASSERT_FUNCTION)) +#define ceph_assert(expr) \ + ((expr) \ + ? __CEPH_ASSERT_VOID_CAST (0) \ + : __ceph_assert_fail (__STRING(expr), __FILE__, __LINE__, __CEPH_ASSERT_FUNCTION)) // Named by analogy with printf. Along with an expression, takes a format // string and parameters which are printed if the assertion fails. @@ -135,3 +135,7 @@ using namespace ceph; ((expr) \ ? __CEPH_ASSERT_VOID_CAST (0) \ : __ceph_assertf_fail (__STRING(expr), __FILE__, __LINE__, __CEPH_ASSERT_FUNCTION, __VA_ARGS__)) +#define ceph_assertf(expr, ...) \ + ((expr) \ + ? __CEPH_ASSERT_VOID_CAST (0) \ + : __ceph_assertf_fail (__STRING(expr), __FILE__, __LINE__, __CEPH_ASSERT_FUNCTION, __VA_ARGS__))