sysdefs.h: Add FALLTHROUGH macro

This commit is contained in:
Lasse Collin 2025-01-01 15:08:51 +02:00
parent e34dbd6a0a
commit f31c3a6647
No known key found for this signature in database
GPG Key ID: 38EE757D69184620
1 changed files with 9 additions and 0 deletions

View File

@ -203,4 +203,13 @@ typedef unsigned char _Bool;
# define lzma_attr_alloc_size(x)
#endif
#if __STDC_VERSION__ >= 202311
# define FALLTHROUGH [[__fallthrough__]]
#elif (defined(__GNUC__) && __GNUC__ >= 7) \
|| (defined(__clang_major__) && __clang_major__ >= 10)
# define FALLTHROUGH __attribute__((__fallthrough__))
#else
# define FALLTHROUGH ((void)0)
#endif
#endif