Better fallthrough annotation macro.

This commit is contained in:
Jasmine Iwanek
2023-08-09 19:44:56 -04:00
parent 2c5240e07f
commit 81bb5e564b
50 changed files with 94 additions and 239 deletions

View File

@@ -55,8 +55,13 @@ extern int strnicmp(const char *s1, const char *s2, size_t n);
# define off64_t off_t
#endif
#if !defined (__APPLE__) && !defined(__clang__)
# define FALLTHROUGH_ANNOTATION
#if __has_attribute(fallthrough)
# define fallthrough __attribute__((fallthrough))
#else
# if __has_attribute(__fallthrough__)
# define fallthrough __attribute__((__fallthrough__))
# endif
# define fallthrough do {} while (0) /* fallthrough */
#endif
#ifdef _MSC_VER

View File

@@ -18,8 +18,13 @@
#ifndef EMU_PLAT_FALLTHROUGH_H
#define EMU_PLAT_FALLTHROUGH_H
#if !defined (__APPLE__) && !defined(__clang__)
# define FALLTHROUGH_ANNOTATION
#if __has_attribute(__fallthrough__)
# define fallthrough __attribute__((__fallthrough__))
#else
# if __has_attribute(fallthrough)
# define fallthrough __attribute__((fallthrough))
# endif
# define fallthrough do {} while (0) /* fallthrough */
#endif
#endif /*EMU_PLAT_FALLTHROUGH_H*/