]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
include/assert: define ceph_assert[f] that mirror assert[f]
authorSage Weil <sage@redhat.com>
Mon, 27 Jun 2016 18:23:31 +0000 (11:23 -0700)
committerSage Weil <sage@redhat.com>
Tue, 28 Jun 2016 20:13:46 +0000 (16:13 -0400)
We will transition to these.

Signed-off-by: Sage Weil <sage@redhat.com>
src/include/assert.h

index a85452a17e8a2afac1f4d7505c82cfc3a0e3bad0..c52ccea4ea33d2fde30b7849a7ea1e9adc63e163 100644 (file)
@@ -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__))