Skip to content

Commit

Permalink
Cleanup FMT_ASSERT
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaut committed Apr 19, 2024
1 parent ee0c335 commit f746a59
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions include/fmt/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -371,17 +371,17 @@ template <typename T> constexpr auto const_check(T value) -> T { return value; }
FMT_NORETURN FMT_API void assert_fail(const char* file, int line,
const char* message);

#ifndef FMT_ASSERT
# ifdef NDEBUG
#if defined(FMT_ASSERT)
// Use the provided definition.
#elif defined(NDEBUG)
// FMT_ASSERT is not empty to avoid -Wempty-body.
# define FMT_ASSERT(condition, message) \
fmt::detail::ignore_unused((condition), (message))
# else
# define FMT_ASSERT(condition, message) \
((condition) /* void() fails with -Winvalid-constexpr on clang 4.0.1 */ \
? (void)0 \
: fmt::detail::assert_fail(__FILE__, __LINE__, (message)))
# endif
# define FMT_ASSERT(condition, message) \
fmt::detail::ignore_unused((condition), (message))
#else
# define FMT_ASSERT(condition, message) \
((condition) /* void() fails with -Winvalid-constexpr on clang 4.0.1 */ \
? (void)0 \
: fmt::detail::assert_fail(__FILE__, __LINE__, (message)))
#endif

#ifdef FMT_USE_INT128
Expand Down

0 comments on commit f746a59

Please sign in to comment.