From b380ebfb26031336f4d43812c4d9e2dab5f09b08 Mon Sep 17 00:00:00 2001 From: Hin-Tak Leung Date: Fri, 4 Dec 2020 22:05:28 +0000 Subject: [PATCH] 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 --- sound-compatible-4.18.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sound-compatible-4.18.h b/sound-compatible-4.18.h index faed848..eefa7de 100644 --- a/sound-compatible-4.18.h +++ b/sound-compatible-4.18.h @@ -16,6 +16,10 @@ #endif #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__) # define fallthrough __attribute__((__fallthrough__)) #else