summaryrefslogtreecommitdiff
path: root/src/stdafx.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/stdafx.h')
-rw-r--r--src/stdafx.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/stdafx.h b/src/stdafx.h
index 4616212f1..43e52ff27 100644
--- a/src/stdafx.h
+++ b/src/stdafx.h
@@ -156,6 +156,17 @@
#else
#define FINAL
#endif
+
+ /* Use fallthrough attribute where supported */
+ #if __GNUC__ >= 7
+ #if __cplusplus > 201402L // C++17
+ #define FALLTHROUGH [[fallthrough]]
+ #else
+ #define FALLTHROUGH __attribute__((fallthrough))
+ #endif
+ #else
+ #define FALLTHROUGH
+ #endif
#endif /* __GNUC__ */
#if defined(__WATCOMC__)
@@ -164,6 +175,7 @@
#define GCC_PACK
#define WARN_FORMAT(string, args)
#define FINAL
+ #define FALLTHROUGH
#include <malloc.h>
#endif /* __WATCOMC__ */
@@ -235,6 +247,13 @@
#define WARN_FORMAT(string, args)
#define FINAL sealed
+ /* fallthrough attribute, VS 2017 */
+ #if (_MSC_VER >= 1910)
+ #define FALLTHROUGH [[fallthrough]]
+ #else
+ #define FALLTHROUGH
+ #endif
+
#if defined(WINCE)
int CDECL vsnprintf(char *str, size_t size, const char *format, va_list ap);
#endif