From 6dfdf3aa5912649da22d5dc34c5b871419fa7650 Mon Sep 17 00:00:00 2001 From: Mike Smith Date: Sun, 2 Jun 2024 14:42:29 +0800 Subject: [PATCH] fix --- include/luisa/core/logging.h | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/include/luisa/core/logging.h b/include/luisa/core/logging.h index 62742bbea..a377b5e8c 100644 --- a/include/luisa/core/logging.h +++ b/include/luisa/core/logging.h @@ -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(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) \ No newline at end of file +#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)