From 267152505b6b41de09a44db0fcbf01b55499853e Mon Sep 17 00:00:00 2001 From: Hin-Tak Leung Date: Fri, 4 Dec 2020 23:20:13 +0000 Subject: [PATCH] better fix for older compiler than gcc 5 Reference: kernel's include/linux/compiler_attributes.h --- sound-compatible-4.18.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sound-compatible-4.18.h b/sound-compatible-4.18.h index c9fe0f6..eefa7de 100644 --- a/sound-compatible-4.18.h +++ b/sound-compatible-4.18.h @@ -16,7 +16,11 @@ #endif #if LINUX_VERSION_CODE < KERNEL_VERSION(5,4,0) -#if defined(__has_attribute) && __has_attribute(__fallthrough__) +#ifndef __has_attribute +# define __has_attribute(x) __GCC4_has_attribute_##x +# define __GCC4_has_attribute___fallthrough__ 0 +#endif +#if __has_attribute(__fallthrough__) # define fallthrough __attribute__((__fallthrough__)) #else # define fallthrough do {} while (0) /* fallthrough */