From: Adam C. Emerson Date: Wed, 22 Aug 2018 16:39:41 +0000 (-0400) Subject: include/assert: Deprecate assert macro X-Git-Tag: v14.0.1~475^2~35 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f65549ce24bcadb34266d659d73baddbcad0e11e;p=ceph.git include/assert: Deprecate assert macro Prior to switching callers to ceph_assert. Signed-off-by: Adam C. Emerson --- diff --git a/src/include/assert.h b/src/include/assert.h index e9505336062d..7bfa28c86ab7 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 = \