From ae9991054f70e5136f09d6676fd09e2bc41ee2ea Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 27 Jun 2016 11:23:31 -0700 Subject: [PATCH] include/assert: define ceph_assert[f] that mirror assert[f] We will transition to these. Signed-off-by: Sage Weil --- src/include/assert.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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__))