diff options
Diffstat (limited to 'include/acpi/platform/acgcc.h')
-rw-r--r-- | include/acpi/platform/acgcc.h | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/include/acpi/platform/acgcc.h b/include/acpi/platform/acgcc.h index 7d63d03cf507..ac80111f503c 100644 --- a/include/acpi/platform/acgcc.h +++ b/include/acpi/platform/acgcc.h @@ -3,28 +3,20 @@ * * Name: acgcc.h - GCC specific defines, etc. * - * Copyright (C) 2000 - 2020, Intel Corp. + * Copyright (C) 2000 - 2022, Intel Corp. * *****************************************************************************/ #ifndef __ACGCC_H__ #define __ACGCC_H__ -/* - * Use compiler specific <stdarg.h> is a good practice for even when - * -nostdinc is specified (i.e., ACPI_USE_STANDARD_HEADERS undefined. - */ #ifndef va_arg -#ifdef ACPI_USE_BUILTIN_STDARG -typedef __builtin_va_list va_list; -#define va_start(v, l) __builtin_va_start(v, l) -#define va_end(v) __builtin_va_end(v) -#define va_arg(v, l) __builtin_va_arg(v, l) -#define va_copy(d, s) __builtin_va_copy(d, s) +#ifdef __KERNEL__ +#include <linux/stdarg.h> #else #include <stdarg.h> -#endif -#endif +#endif /* __KERNEL__ */ +#endif /* ! va_arg */ #define ACPI_INLINE __inline__ @@ -54,4 +46,19 @@ typedef __builtin_va_list va_list; #define ACPI_USE_NATIVE_MATH64 +/* GCC did not support __has_attribute until 5.1. */ + +#ifndef __has_attribute +#define __has_attribute(x) 0 +#endif + +/* + * Explicitly mark intentional explicit fallthrough to silence + * -Wimplicit-fallthrough in GCC 7.1+. + */ + +#if __has_attribute(__fallthrough__) +#define ACPI_FALLTHROUGH __attribute__((__fallthrough__)) +#endif + #endif /* __ACGCC_H__ */ |