Skip to content

Commit b5b3614

Browse files
static_assert replaced with _Statis_assert if __has_feature(c_static_assert)
`static_assert` is not always available. `_Static_assert` in combination with `__has_feature(c_static_assert)` is already being used in the project.
1 parent 91e9e20 commit b5b3614

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/source.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2034,8 +2034,10 @@ _dispatch_kevent_qos_s _dispatch_kevent_timeout[] = {
20342034
};
20352035
#define DISPATCH_KEVENT_TIMEOUT_COUNT \
20362036
((sizeof(_dispatch_kevent_timeout) / sizeof(_dispatch_kevent_timeout[0])))
2037-
static_assert(DISPATCH_KEVENT_TIMEOUT_COUNT == DISPATCH_TIMER_INDEX_COUNT - 1,
2037+
#if __has_feature(c_static_assert)
2038+
_Static_assert(DISPATCH_KEVENT_TIMEOUT_COUNT == DISPATCH_TIMER_INDEX_COUNT - 1,
20382039
"should have a kevent for everything but disarm (ddt assumes this)");
2040+
#endif
20392041

20402042
#define DISPATCH_KEVENT_COALESCING_WINDOW_INIT(qos, ms) \
20412043
[DISPATCH_TIMER_QOS_##qos] = 2ull * (ms) * NSEC_PER_MSEC

0 commit comments

Comments
 (0)