mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
glibc: strlcpy and strlcat arrived in glibc 2.38
So only expose these in generic-glibc/string.h if Zig is building a v2.38 (or later) glibc stub. Announcement of 2.38 that notes strlcpy and strlcat: https://lists.gnu.org/archive/html/info-gnu/2023-07/msg00010.html
This commit is contained in:
parent
8a82496520
commit
95a9053363
1 changed files with 6 additions and 0 deletions
6
lib/libc/include/generic-glibc/string.h
vendored
6
lib/libc/include/generic-glibc/string.h
vendored
|
|
@ -501,6 +501,11 @@ extern char *stpncpy (char *__restrict __dest,
|
|||
__THROW __nonnull ((1, 2));
|
||||
#endif
|
||||
|
||||
/*
|
||||
* 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
|
||||
/* Copy at most N - 1 characters from SRC to DEST. */
|
||||
extern size_t strlcpy (char *__restrict __dest,
|
||||
|
|
@ -513,6 +518,7 @@ extern size_t strlcat (char *__restrict __dest,
|
|||
const char *__restrict __src, size_t __n)
|
||||
__THROW __nonnull ((1, 2)) __attr_access ((__read_write__, 1, 3));
|
||||
#endif
|
||||
#endif /* glibc v2.38 and later */
|
||||
|
||||
#ifdef __USE_GNU
|
||||
/* Compare S1 and S2 as strings holding name & indices/version numbers. */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue