]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
include/assert: Deprecate assert macro
authorAdam C. Emerson <aemerson@redhat.com>
Wed, 22 Aug 2018 16:39:41 +0000 (12:39 -0400)
committerAdam C. Emerson <aemerson@redhat.com>
Mon, 27 Aug 2018 13:09:01 +0000 (09:09 -0400)
Prior to switching callers to ceph_assert.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
src/include/assert.h

index e9505336062d6e8237eb7316bcb3020a892c9041..7bfa28c86ab75f94a937e50bb641d9f7d058a1e0 100644 (file)
@@ -82,6 +82,14 @@ 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);
 
+#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
@@ -136,7 +144,7 @@ using namespace ceph;
    {__STRING(expr), __FILE__, __LINE__, __CEPH_ASSERT_FUNCTION}; \
    ((expr) \
    ? _CEPH_ASSERT_VOID_CAST (0)        \
-   : __ceph_assert_fail(assert_data_ctx)); } while(false)
+   : __ceph_assert_fail_depr(assert_data_ctx)); } while(false)
 
 #define ceph_assert(expr)                                                      \
   do { static const ceph::assert_data assert_data_ctx = \