older compiler than gcc 5 does not have __has_attribute

This commit is contained in:
Hin-Tak Leung 2020-12-04 22:05:28 +00:00
parent 71321134f6
commit 28b9319379

View file

@ -16,7 +16,7 @@
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(5,4,0)
#if __has_attribute(__fallthrough__)
#if defined(__has_attribute) && __has_attribute(__fallthrough__)
# define fallthrough __attribute__((__fallthrough__))
#else
# define fallthrough do {} while (0) /* fallthrough */