]> git.ipfire.org Git - thirdparty/libbsd.git/commitdiff
include: Adjust reallocarray() per glibc adoption
authorGuillem Jover <guillem@hadrons.org>
Wed, 5 Oct 2022 10:08:31 +0000 (12:08 +0200)
committerGuillem Jover <guillem@hadrons.org>
Wed, 5 Oct 2022 10:31:49 +0000 (12:31 +0200)
On glibc 2.29 reallocarray() was moved to _DEFAULT_SOURCE.

Closes: !20
Based-on-patch-by: Callum Farmer <gmbr3@opensuse.org>
Signed-off-by: Guillem Jover <guillem@hadrons.org>
include/bsd/stdlib.h

index ac60dc6e51d3f9343f1668d303b0f33c54208e3e..5732fd1c4c942b89d68ec0fe05a3774815d657e7 100644 (file)
@@ -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);