summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorReimu NotMoe <[email protected]>2023-04-17 20:20:22 +0800
committerReimu NotMoe <[email protected]>2023-04-17 20:20:22 +0800
commitd97b6d57de0b2586624dec51b37ccd699a0314a6 (patch)
treee1fdf54d9d384c82956705019abe56e9902d9e0a /src
parent723e21ad6a97d17c406f83b5ff6ae6571c611e86 (diff)
Fix compatibility with the latest Microchip XC16 compiler
Diffstat (limited to 'src')
-rw-r--r--src/common/tusb_compiler.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/common/tusb_compiler.h b/src/common/tusb_compiler.h
index 713bbb8d4..a1794584d 100644
--- a/src/common/tusb_compiler.h
+++ b/src/common/tusb_compiler.h
@@ -138,10 +138,14 @@
#define TU_ATTR_BIT_FIELD_ORDER_BEGIN
#define TU_ATTR_BIT_FIELD_ORDER_END
- #if __has_attribute(__fallthrough__)
- #define TU_ATTR_FALLTHROUGH __attribute__((fallthrough))
- #else
+ #if defined(__XC16)
#define TU_ATTR_FALLTHROUGH do {} while (0) /* fallthrough */
+ #else
+ #if __has_attribute(__fallthrough__)
+ #define TU_ATTR_FALLTHROUGH __attribute__((fallthrough))
+ #else
+ #define TU_ATTR_FALLTHROUGH do {} while (0) /* fallthrough */
+ #endif
#endif
// Endian conversion use well-known host to network (big endian) naming