diff options
| author | RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> | 2022-08-23 17:13:04 +0200 |
|---|---|---|
| committer | RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> | 2022-08-23 17:13:04 +0200 |
| commit | bbdcf5a704517d35a76ba8b666075da9ffe39ac4 (patch) | |
| tree | a36bec4f7c2802dfe5efc5cb2dfc902fec2a23b8 /gl/cdefs.h | |
| parent | fa1ac7ecb247faf58fe65740c0d40e0585f684c9 (diff) | |
| download | monitoring-plugins-bbdcf5a.tar.gz | |
Sync with the latest Gnulib code (fa1ac7ec)
Diffstat (limited to 'gl/cdefs.h')
| -rw-r--r-- | gl/cdefs.h | 23 |
1 files changed, 13 insertions, 10 deletions
| @@ -1,4 +1,4 @@ | |||
| 1 | /* Copyright (C) 1992-2021 Free Software Foundation, Inc. | 1 | /* Copyright (C) 1992-2022 Free Software Foundation, Inc. |
| 2 | Copyright The GNU Toolchain Authors. | 2 | Copyright The GNU Toolchain Authors. |
| 3 | This file is part of the GNU C Library. | 3 | This file is part of the GNU C Library. |
| 4 | 4 | ||
| @@ -41,7 +41,9 @@ | |||
| 41 | Similarly for __has_builtin, etc. */ | 41 | Similarly for __has_builtin, etc. */ |
| 42 | #if (defined __has_attribute \ | 42 | #if (defined __has_attribute \ |
| 43 | && (!defined __clang_minor__ \ | 43 | && (!defined __clang_minor__ \ |
| 44 | || 3 < __clang_major__ + (5 <= __clang_minor__))) | 44 | || (defined __apple_build_version__ \ |
| 45 | ? 6000000 <= __apple_build_version__ \ | ||
| 46 | : 3 < __clang_major__ + (5 <= __clang_minor__)))) | ||
| 45 | # define __glibc_has_attribute(attr) __has_attribute (attr) | 47 | # define __glibc_has_attribute(attr) __has_attribute (attr) |
| 46 | #else | 48 | #else |
| 47 | # define __glibc_has_attribute(attr) 0 | 49 | # define __glibc_has_attribute(attr) 0 |
| @@ -143,7 +145,8 @@ | |||
| 143 | #define __bos0(ptr) __builtin_object_size (ptr, 0) | 145 | #define __bos0(ptr) __builtin_object_size (ptr, 0) |
| 144 | 146 | ||
| 145 | /* Use __builtin_dynamic_object_size at _FORTIFY_SOURCE=3 when available. */ | 147 | /* Use __builtin_dynamic_object_size at _FORTIFY_SOURCE=3 when available. */ |
| 146 | #if __USE_FORTIFY_LEVEL == 3 && __glibc_clang_prereq (9, 0) | 148 | #if __USE_FORTIFY_LEVEL == 3 && (__glibc_clang_prereq (9, 0) \ |
| 149 | || __GNUC_PREREQ (12, 0)) | ||
| 147 | # define __glibc_objsize0(__o) __builtin_dynamic_object_size (__o, 0) | 150 | # define __glibc_objsize0(__o) __builtin_dynamic_object_size (__o, 0) |
| 148 | # define __glibc_objsize(__o) __builtin_dynamic_object_size (__o, 1) | 151 | # define __glibc_objsize(__o) __builtin_dynamic_object_size (__o, 1) |
| 149 | #else | 152 | #else |
| @@ -161,15 +164,15 @@ | |||
| 161 | || (__builtin_constant_p (__l) && (__l) > 0)) | 164 | || (__builtin_constant_p (__l) && (__l) > 0)) |
| 162 | 165 | ||
| 163 | /* Length is known to be safe at compile time if the __L * __S <= __OBJSZ | 166 | /* Length is known to be safe at compile time if the __L * __S <= __OBJSZ |
| 164 | condition can be folded to a constant and if it is true. The -1 check is | 167 | condition can be folded to a constant and if it is true, or unknown (-1) */ |
| 165 | redundant because since it implies that __glibc_safe_len_cond is true. */ | ||
| 166 | #define __glibc_safe_or_unknown_len(__l, __s, __osz) \ | 168 | #define __glibc_safe_or_unknown_len(__l, __s, __osz) \ |
| 167 | (__glibc_unsigned_or_positive (__l) \ | 169 | ((__osz) == (__SIZE_TYPE__) -1 \ |
| 168 | && __builtin_constant_p (__glibc_safe_len_cond ((__SIZE_TYPE__) (__l), \ | 170 | || (__glibc_unsigned_or_positive (__l) \ |
| 169 | __s, __osz)) \ | 171 | && __builtin_constant_p (__glibc_safe_len_cond ((__SIZE_TYPE__) (__l), \ |
| 170 | && __glibc_safe_len_cond ((__SIZE_TYPE__) (__l), __s, __osz)) | 172 | (__s), (__osz))) \ |
| 173 | && __glibc_safe_len_cond ((__SIZE_TYPE__) (__l), (__s), (__osz)))) | ||
| 171 | 174 | ||
| 172 | /* Conversely, we know at compile time that the length is safe if the | 175 | /* Conversely, we know at compile time that the length is unsafe if the |
| 173 | __L * __S <= __OBJSZ condition can be folded to a constant and if it is | 176 | __L * __S <= __OBJSZ condition can be folded to a constant and if it is |
| 174 | false. */ | 177 | false. */ |
| 175 | #define __glibc_unsafe_len(__l, __s, __osz) \ | 178 | #define __glibc_unsafe_len(__l, __s, __osz) \ |
