zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit b7a98d0d590c4c71a9378a98f2984cbc04d503dd (tree)
parent a76e98e7d517037054fdf2edcb908c129465109f
Author: Federico Di Pierro <nierro92@gmail.com>
Date:   Fri, 30 Aug 2024 14:55:24 +0200

lib: guard definition of `strl{cat,cpy}` against glibc version when _FORTIFY_SOURCE is enabled.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>

Diffstat:
Mlib/libc/include/generic-glibc/bits/string_fortified.h | 9+++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/lib/libc/include/generic-glibc/bits/string_fortified.h b/lib/libc/include/generic-glibc/bits/string_fortified.h @@ -150,6 +150,11 @@ __NTH (strncat (__fortify_clang_overload_arg (char *, __restrict, __dest), __glibc_objsize (__dest)); } +/* + * strlcpy and strlcat introduced in glibc 2.38 + * https://sourceware.org/git/?p=glibc.git;a=commit;h=2e0bbbfbf95fc9e22692e93658a6fbdd2d4554da + */ +#if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 38) || __GLIBC__ > 2 #ifdef __USE_MISC extern size_t __strlcpy_chk (char *__dest, const char *__src, size_t __n, size_t __destlen) __THROW; @@ -186,5 +191,6 @@ __NTH (strlcat (__fortify_clang_overload_arg (char *, __restrict, __dest), return __strlcat_alias (__dest, __src, __n); } #endif /* __USE_MISC */ +#endif /* glibc v2.38 and later */ -#endif /* bits/string_fortified.h */ -\ No newline at end of file +#endif /* bits/string_fortified.h */