XE_RTP_PASTE_FOREACH(ACTION_, COMMA, (__VA_ARGS__)) \
}
+/*
+ * Note: ARRAY_SIZE() cannot be used here because it expands through
+ * __must_be_array() -> __BUILD_BUG_ON_ZERO_MSG() -> _Static_assert inside
+ * sizeof(struct{}), which clang < 21 rejects when the compound literal
+ * contains non-compile-time-constant initializers.
+ */
#define XE_RTP_TABLE_SR(...) { \
.entries = (const struct xe_rtp_entry_sr[]){__VA_ARGS__}, \
- .n_entries = ARRAY_SIZE(((const struct xe_rtp_entry_sr[]){__VA_ARGS__})), \
+ .n_entries = sizeof((const struct xe_rtp_entry_sr[]){__VA_ARGS__}) / \
+ sizeof(struct xe_rtp_entry_sr), \
}
#define XE_RTP_TABLE(...) { \
.entries = (const struct xe_rtp_entry[]){__VA_ARGS__}, \
- .n_entries = ARRAY_SIZE(((const struct xe_rtp_entry[]){__VA_ARGS__})), \
+ .n_entries = sizeof((const struct xe_rtp_entry[]){__VA_ARGS__}) / \
+ sizeof(struct xe_rtp_entry), \
}
#define XE_RTP_PROCESS_CTX_INITIALIZER(arg__) _Generic((arg__), \