diff options
Diffstat (limited to 'include/linux/compiler_attributes.h')
| -rw-r--r-- | include/linux/compiler_attributes.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/linux/compiler_attributes.h b/include/linux/compiler_attributes.h index 19f32b0c29af..6b318efd8a74 100644 --- a/include/linux/compiler_attributes.h +++ b/include/linux/compiler_attributes.h | |||
| @@ -34,6 +34,7 @@ | |||
| 34 | #ifndef __has_attribute | 34 | #ifndef __has_attribute |
| 35 | # define __has_attribute(x) __GCC4_has_attribute_##x | 35 | # define __has_attribute(x) __GCC4_has_attribute_##x |
| 36 | # define __GCC4_has_attribute___assume_aligned__ (__GNUC_MINOR__ >= 9) | 36 | # define __GCC4_has_attribute___assume_aligned__ (__GNUC_MINOR__ >= 9) |
| 37 | # define __GCC4_has_attribute___copy__ 0 | ||
| 37 | # define __GCC4_has_attribute___designated_init__ 0 | 38 | # define __GCC4_has_attribute___designated_init__ 0 |
| 38 | # define __GCC4_has_attribute___externally_visible__ 1 | 39 | # define __GCC4_has_attribute___externally_visible__ 1 |
| 39 | # define __GCC4_has_attribute___noclone__ 1 | 40 | # define __GCC4_has_attribute___noclone__ 1 |
| @@ -101,6 +102,19 @@ | |||
| 101 | #define __attribute_const__ __attribute__((__const__)) | 102 | #define __attribute_const__ __attribute__((__const__)) |
| 102 | 103 | ||
| 103 | /* | 104 | /* |
| 105 | * Optional: only supported since gcc >= 9 | ||
| 106 | * Optional: not supported by clang | ||
| 107 | * Optional: not supported by icc | ||
| 108 | * | ||
| 109 | * gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-copy-function-attribute | ||
| 110 | */ | ||
| 111 | #if __has_attribute(__copy__) | ||
| 112 | # define __copy(symbol) __attribute__((__copy__(symbol))) | ||
| 113 | #else | ||
| 114 | # define __copy(symbol) | ||
| 115 | #endif | ||
| 116 | |||
| 117 | /* | ||
| 104 | * Don't. Just don't. See commit 771c035372a0 ("deprecate the '__deprecated' | 118 | * Don't. Just don't. See commit 771c035372a0 ("deprecate the '__deprecated' |
| 105 | * attribute warnings entirely and for good") for more information. | 119 | * attribute warnings entirely and for good") for more information. |
| 106 | * | 120 | * |
