From f65549ce24bcadb34266d659d73baddbcad0e11e Mon Sep 17 00:00:00 2001 From: "Adam C. Emerson" Date: Wed, 22 Aug 2018 12:39:41 -0400 Subject: [PATCH] include/assert: Deprecate assert macro Prior to switching callers to ceph_assert. Signed-off-by: Adam C. Emerson --- src/include/assert.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/include/assert.h b/src/include/assert.h index e9505336062d6..7bfa28c86ab75 100644 --- a/src/include/assert.h +++ b/src/include/assert.h @@ -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 #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 = \ -- 2.39.5