Fix to only use FALL_THROUGH macro for GCC 7.1 or later.

This commit is contained in:
David Garske
2017-05-11 15:52:32 -07:00
parent 7c7503449f
commit 53a837b230

View File

@ -162,13 +162,14 @@
#endif
/* GCC 7 has new switch() fall-through detection */
#ifndef FALL_THROUGH
#if defined(__GNUC__)
#define FALL_THROUGH __attribute__ ((fallthrough))
#else
#define FALL_THROUGH
#if defined(__GNUC__)
#if ((__GNUC__ > 7) || ((__GNUC__ == 7) && (__GNUC_MINOR__ >= 1)))
#define FALL_THROUGH __attribute__ ((fallthrough));
#endif
#endif
#ifndef FALL_THROUGH
#define FALL_THROUGH
#endif
/* Micrium will use Visual Studio for compilation but not the Win32 API */
#if defined(_WIN32) && !defined(MICRIUM) && !defined(FREERTOS) && \