Skip to content

Commit

Permalink
Update '__STDC_VERSION__' check with C23
Browse files Browse the repository at this point in the history
`__STDC_VERSION__` will be defined as 202311L for C23.
  • Loading branch information
Explorer09 authored and BenBE committed Apr 22, 2024
1 parent 4c0e965 commit 30618c5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,8 @@ ssize_t Compat_readlink(openat_arg_t dirfd,
# endif
#endif

/* C23 will guarantee static_assert is a keyword or a macro */
/* FIXME: replace 202300L with proper value once C23 is published */
#if (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 202300L
/* C23 guarantees static_assert is a keyword or a macro */
#if (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 202311L
# if !defined(static_assert)
# define static_assert(expr, msg) _Static_assert(expr, msg)
# endif
Expand Down

0 comments on commit 30618c5

Please sign in to comment.