Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike-Leo-Smith committed Jun 2, 2024
1 parent 148cc57 commit 6dfdf3a
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions include/luisa/core/logging.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,13 @@ LC_CORE_API void log_flush() noexcept;
#define LUISA_NOT_IMPLEMENTED() \
LUISA_ERROR_WITH_LOCATION("Not implemented.")

#define LUISA_ASSERT(x, fmt, ...) \
do { \
auto _luisa_cond_x = static_cast<bool>(x); \
LUISA_ASSUME(_luisa_cond_x); \
if (!_luisa_cond_x) [[unlikely]] { \
auto msg = luisa::format( \
fmt __VA_OPT__(, ) __VA_ARGS__); \
LUISA_ERROR_WITH_LOCATION( \
"Assertion '{}' failed: {}", \
#x, msg); \
} \
} while (false)
#define LUISA_ASSERT(x, fmt, ...) \
do { \
if (!(x)) [[unlikely]] { \
auto msg = luisa::format( \
fmt __VA_OPT__(, ) __VA_ARGS__); \
LUISA_ERROR_WITH_LOCATION( \
"Assertion '{}' failed: {}", \
#x, msg); \
} \
} while (false)

0 comments on commit 6dfdf3a

Please sign in to comment.