From 094c1ca741dd17733e92500c94fa288ff35d129a Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Sat, 15 Aug 2026 09:35:04 -0700 Subject: [PATCH] Fix windows build --- src/base/sn/sn.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/base/sn/sn.h b/src/base/sn/sn.h index 9508ae60c..43150488c 100644 --- a/src/base/sn/sn.h +++ b/src/base/sn/sn.h @@ -288,11 +288,9 @@ enum sn_obj_type_enum SN_OBJ_TYPE_COUNT }; -#ifdef __cplusplus -static_assert(SN_OBJ_TYPE_COUNT <= UINT8_MAX, "sn_obj_type_t cannot represent every object type"); -#else -_Static_assert(SN_OBJ_TYPE_COUNT <= UINT8_MAX, "sn_obj_type_t cannot represent every object type"); -#endif +// Use a negative-size array as a compile-time check because ABC is also built +// as C by MSVC, whose C frontend does not accept the C11 _Static_assert keyword. +typedef char sn_obj_type_count_must_fit_in_uint8_t[(SN_OBJ_TYPE_COUNT <= UINT8_MAX) ? 1 : -1]; typedef enum sn_mux_fanin_t {