Skip to content

Commit

Permalink
sumtype: detect compilers with extensions off
Browse files Browse the repository at this point in the history
  • Loading branch information
mochaaP committed Jan 2, 2025
1 parent 25c2d7c commit f728442
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion include/stc/sys/sumtype.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,10 @@ int main(void) {
c_EVAL(c_LOOP(_c_vartuple_var, T, __VA_ARGS__, (0),)) \
}

#if defined __GNUC__ || defined __clang__ || defined __TINYC__ || _MSC_VER >= 1939
#if (defined(__clang__) && !__is_identifier(__typeof__)) \
|| (defined(__GNUC__) && __has_builtin(__typeof__)) \
|| defined(__TINYC__) \
|| _MSC_FULL_VER >= 193933428
#define c_when(var) \
for (__typeof__(var) _match = (var); _match; _match = NULL) \
switch (_match->_any_.tag)
Expand Down

0 comments on commit f728442

Please sign in to comment.