diff options
Diffstat (limited to 'include/acpi')
-rw-r--r-- | include/acpi/actypes.h | 6 | ||||
-rw-r--r-- | include/acpi/platform/acgcc.h | 15 |
2 files changed, 21 insertions, 0 deletions
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index 647cb11d0a0a..2a32593691bc 100644 --- a/include/acpi/actypes.h +++ b/include/acpi/actypes.h @@ -1286,4 +1286,10 @@ typedef enum { #define ACPI_OPT_END -1 +/* Definitions for explicit fallthrough */ + +#ifndef ACPI_FALLTHROUGH +#define ACPI_FALLTHROUGH do {} while(0) +#endif + #endif /* __ACTYPES_H__ */ diff --git a/include/acpi/platform/acgcc.h b/include/acpi/platform/acgcc.h index 7d63d03cf507..91f7a02c798a 100644 --- a/include/acpi/platform/acgcc.h +++ b/include/acpi/platform/acgcc.h @@ -54,4 +54,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 + +/* + * Explictly 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__ */ |