Skip to content

Commit d97b6d5

Browse files
committed
Fix compatibility with the latest Microchip XC16 compiler
1 parent 723e21a commit d97b6d5

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/common/tusb_compiler.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,14 @@
138138
#define TU_ATTR_BIT_FIELD_ORDER_BEGIN
139139
#define TU_ATTR_BIT_FIELD_ORDER_END
140140

141-
#if __has_attribute(__fallthrough__)
142-
#define TU_ATTR_FALLTHROUGH __attribute__((fallthrough))
143-
#else
141+
#if defined(__XC16)
144142
#define TU_ATTR_FALLTHROUGH do {} while (0) /* fallthrough */
143+
#else
144+
#if __has_attribute(__fallthrough__)
145+
#define TU_ATTR_FALLTHROUGH __attribute__((fallthrough))
146+
#else
147+
#define TU_ATTR_FALLTHROUGH do {} while (0) /* fallthrough */
148+
#endif
145149
#endif
146150

147151
// Endian conversion use well-known host to network (big endian) naming

0 commit comments

Comments
 (0)