Commit | Line | Data |
---|---|---|
95857638 | 1 | /* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 */ |
1da177e4 LT |
2 | /****************************************************************************** |
3 | * | |
4 | * Name: acgcc.h - GCC specific defines, etc. | |
5 | * | |
487ea80a | 6 | * Copyright (C) 2000 - 2022, Intel Corp. |
1da177e4 | 7 | * |
95857638 | 8 | *****************************************************************************/ |
1da177e4 LT |
9 | |
10 | #ifndef __ACGCC_H__ | |
11 | #define __ACGCC_H__ | |
12 | ||
84676b87 | 13 | #ifndef va_arg |
136f2820 | 14 | #ifdef __KERNEL__ |
c0891ac1 | 15 | #include <linux/stdarg.h> |
136f2820 | 16 | #else |
136f2820 MBM |
17 | #include <stdarg.h> |
18 | #endif /* __KERNEL__ */ | |
136f2820 | 19 | #endif /* ! va_arg */ |
5fb3ab84 | 20 | |
8f40f171 LM |
21 | #define ACPI_INLINE __inline__ |
22 | ||
f9f4601f RM |
23 | /* Function name is used for debug output. Non-ANSI, compiler-dependent */ |
24 | ||
d5c003b4 | 25 | #define ACPI_GET_FUNCTION_NAME __func__ |
f9f4601f | 26 | |
b8e4d893 BM |
27 | /* |
28 | * This macro is used to tag functions as "printf-like" because | |
1da177e4 LT |
29 | * some compilers (like GCC) can catch printf format string problems. |
30 | */ | |
b8e4d893 | 31 | #define ACPI_PRINTF_LIKE(c) __attribute__ ((__format__ (__printf__, c, c+1))) |
1da177e4 | 32 | |
b8e4d893 BM |
33 | /* |
34 | * Some compilers complain about unused variables. Sometimes we don't want to | |
f9f4601f | 35 | * use all the variables (for example, _acpi_module_name). This allows us |
fd589a8f | 36 | * to tell the compiler warning in a per-variable manner that a variable |
1da177e4 LT |
37 | * is unused. |
38 | */ | |
39 | #define ACPI_UNUSED_VAR __attribute__ ((unused)) | |
40 | ||
7b09d8fd LZ |
41 | /* GCC supports __VA_ARGS__ in macros */ |
42 | ||
43 | #define COMPILER_VA_MACRO 1 | |
44 | ||
65082bfc LZ |
45 | /* GCC supports native multiply/shift on 32-bit platforms */ |
46 | ||
47 | #define ACPI_USE_NATIVE_MATH64 | |
48 | ||
c1a7c2ce ND |
49 | /* GCC did not support __has_attribute until 5.1. */ |
50 | ||
51 | #ifndef __has_attribute | |
52 | #define __has_attribute(x) 0 | |
53 | #endif | |
54 | ||
55 | /* | |
e527db8f | 56 | * Explicitly mark intentional explicit fallthrough to silence |
c1a7c2ce ND |
57 | * -Wimplicit-fallthrough in GCC 7.1+. |
58 | */ | |
59 | ||
60 | #if __has_attribute(__fallthrough__) | |
61 | #define ACPI_FALLTHROUGH __attribute__((__fallthrough__)) | |
62 | #endif | |
63 | ||
4be44fcd | 64 | #endif /* __ACGCC_H__ */ |