Attempt to placate the OSX buildslaves, which do not appreciate multiple

definitions of `assert'
This commit is contained in:
John Esmet 2014-03-02 20:37:25 -05:00
parent a01e76b3e5
commit 4595401019

View file

@ -140,6 +140,9 @@ extern void (*do_assert_hook)(void); // Set this to a function you want called a
#define assert_zero(expr) toku_do_assert((expr) == 0, #expr, __FUNCTION__, __FILE__, __LINE__, get_maybe_error_errno())
#define assert_equals(expr, expected) toku_do_assert((expr) == (expected), (expected), #expr, __FUNCTION__, __FILE__, __LINE__, get_maybe_error_errno())
#else
#ifdef assert
# undef assert // some compilers do not like multiple definitions of a single macro - so undef the existing assert def here
#endif
#define assert(expr) ((expr) ? (void)0 : toku_do_assert_fail(#expr, __FUNCTION__, __FILE__, __LINE__, get_maybe_error_errno()))
#define assert_zero(expr) ((expr) == 0 ? (void)0 : toku_do_assert_zero_fail((uintptr_t)(expr), #expr, __FUNCTION__, __FILE__, __LINE__, get_maybe_error_errno()))
#define assert_equals(expr, expected) ((expr) == (expected) ? (void)0 : toku_do_assert_expected_fail((uintptr_t)(expr), (uintptr_t)(expected), #expr, __FUNCTION__, __FILE__, __LINE__, get_maybe_error_errno()))