From: Guillem Jover Date: Wed, 5 Oct 2022 10:08:31 +0000 (+0200) Subject: include: Adjust reallocarray() per glibc adoption X-Git-Tag: 0.11.7~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=03fccd150512ad22c9e27e5d597bf02190ee93cf;p=thirdparty%2Flibbsd.git include: Adjust reallocarray() per glibc adoption On glibc 2.29 reallocarray() was moved to _DEFAULT_SOURCE. Closes: !20 Based-on-patch-by: Callum Farmer Signed-off-by: Guillem Jover --- diff --git a/include/bsd/stdlib.h b/include/bsd/stdlib.h index ac60dc6..5732fd1 100644 --- a/include/bsd/stdlib.h +++ b/include/bsd/stdlib.h @@ -77,7 +77,8 @@ int sradixsort(const unsigned char **base, int nmemb, void *reallocf(void *ptr, size_t size); #if !defined(__GLIBC__) || \ !__GLIBC_PREREQ(2, 26) || \ - !defined(_GNU_SOURCE) + (__GLIBC_PREREQ(2, 26) && !__GLIBC_PREREQ(2, 29) && !defined(_GNU_SOURCE)) || \ + (__GLIBC_PREREQ(2, 29) && !defined(_DEFAULT_SOURCE)) void *reallocarray(void *ptr, size_t nmemb, size_t size); #endif void *recallocarray(void *ptr, size_t oldnmemb, size_t nmemb, size_t size);