older compiler than gcc 5 does not have __has_attribute
fix for older compiler than gcc 5 Reference: kernel's include/linux/compiler_attributes.h
This commit is contained in:
parent
5c9e04cd57
commit
b380ebfb26
1 changed files with 4 additions and 0 deletions
|
@ -16,6 +16,10 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(5,4,0)
|
#if LINUX_VERSION_CODE < KERNEL_VERSION(5,4,0)
|
||||||
|
#ifndef __has_attribute
|
||||||
|
# define __has_attribute(x) __GCC4_has_attribute_##x
|
||||||
|
# define __GCC4_has_attribute___fallthrough__ 0
|
||||||
|
#endif
|
||||||
#if __has_attribute(__fallthrough__)
|
#if __has_attribute(__fallthrough__)
|
||||||
# define fallthrough __attribute__((__fallthrough__))
|
# define fallthrough __attribute__((__fallthrough__))
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Reference in a new issue