From f9ed9885c82fe7887417fe1bdd7a084d032bf377 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 6 May 2011 21:59:41 -0700 Subject: [PATCH] assert: make our assert clobber any others too Two can play this game, /usr/include/assert.h! Signed-off-by: Sage Weil --- src/include/assert.h | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/include/assert.h b/src/include/assert.h index 98199b8764470..62e79490ed302 100644 --- a/src/include/assert.h +++ b/src/include/assert.h @@ -56,21 +56,11 @@ extern void __ceph_assert_fail(const char *assertion, const char *file, int line __attribute__ ((__noreturn__)); extern void __ceph_assert_warn(const char *assertion, const char *file, int line, const char *function); -// wipe any prior assert definition -#ifdef assert -# undef assert -#endif - #define ceph_assert(expr) \ ((expr) \ ? __CEPH_ASSERT_VOID_CAST (0) \ : __ceph_assert_fail (__STRING(expr), __FILE__, __LINE__, __ASSERT_FUNCTION)) -#define assert(expr) \ - ((expr) \ - ? __CEPH_ASSERT_VOID_CAST (0) \ - : __ceph_assert_fail (__STRING(expr), __FILE__, __LINE__, __ASSERT_FUNCTION)) - #define assert_warn(expr) \ ((expr) \ ? __CEPH_ASSERT_VOID_CAST (0) \ @@ -113,3 +103,12 @@ using namespace ceph; #endif +// wipe any prior assert definition +#ifdef assert +# undef assert +#endif + +#define assert(expr) \ + ((expr) \ + ? __CEPH_ASSERT_VOID_CAST (0) \ + : __ceph_assert_fail (__STRING(expr), __FILE__, __LINE__, __ASSERT_FUNCTION)) -- 2.39.5