diff options
author | Ethan Johnston <rocketstrong600@gmail.com> | 2020-02-03 18:36:57 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-03 18:36:57 +0300 |
commit | 49580d5c8d2bc280a58b6eea10949a5ff13e36b1 (patch) | |
tree | a7cb75b2c0fc25b82cf52bac8a6f5b130b1b21a5 | |
parent | fefc5f563a33963b9998f0475ad050813b30adcb (diff) |
fix for older gcc versions
fixes clockless_trinket.h:326:24: error: expected primary-expression before '__attribute__' on older gcc versions
added endif
-rw-r--r-- | platforms/avr/clockless_trinket.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/platforms/avr/clockless_trinket.h b/platforms/avr/clockless_trinket.h index 312e9a88..8b7b88b9 100644 --- a/platforms/avr/clockless_trinket.h +++ b/platforms/avr/clockless_trinket.h @@ -323,7 +323,11 @@ protected: #define DUSE (0xFF - (DADVANCE-1)) // Silence compiler warnings about switch/case that is explicitly intended to fall through. -#define FL_FALLTHROUGH __attribute__ ((fallthrough)); +#if defined(__GNUC__) && __GNUC__ >= 7 + #define FL_FALLTHROUGH __attribute__ ((fallthrough)); +#else + #define FL_FALLTHROUGH ((void)0); +#endif /* __GNUC__ >= 7 */ // This method is made static to force making register Y available to use for data on AVR - if the method is non-static, then // gcc will use register Y for the this pointer. |