Module Name: src Committed By: martin Date: Sun Oct 13 10:39:53 UTC 2024
Modified Files: src/include [netbsd-10]: stdlib.h Log Message: Pull up following revision(s) (requested by riastradh in ticket #954): include/stdlib.h: revision 1.127 stdlib.h: Expose reallocarray only for POSIX 2024 or NetBSD/OpenBSD. reallocarray(3) is new in POSIX 2024, so it should not be exposed if you ask for an older POSIX standard like _POSIX_C_SOURCE=200809L. PR standards/58741 To generate a diff of this commit: cvs rdiff -u -r1.125.2.1 -r1.125.2.2 src/include/stdlib.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/include/stdlib.h diff -u src/include/stdlib.h:1.125.2.1 src/include/stdlib.h:1.125.2.2 --- src/include/stdlib.h:1.125.2.1 Fri Oct 11 19:03:24 2024 +++ src/include/stdlib.h Sun Oct 13 10:39:53 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: stdlib.h,v 1.125.2.1 2024/10/11 19:03:24 martin Exp $ */ +/* $NetBSD: stdlib.h,v 1.125.2.2 2024/10/13 10:39:53 martin Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -117,7 +117,6 @@ void *malloc(size_t); void qsort(void *, size_t, size_t, int (*)(const void *, const void *)); int rand(void); void *realloc(void *, size_t); -void *reallocarray(void *, size_t, size_t); void srand(unsigned); double strtod(const char * __restrict, char ** __restrict); long strtol(const char * __restrict, char ** __restrict, int); @@ -395,6 +394,11 @@ size_t wcstombs_l(char * __restrict, co # endif /* _NETBSD_SOURCE */ #endif /* _POSIX_C_SOURCE >= 200809 || _NETBSD_SOURCE */ +#if (_POSIX_C_SOURCE - 0) >= 202405L || \ + defined(_NETBSD_SOURCE) || defined(_OPENBSD_SOURCE) +void *reallocarray(void *, size_t, size_t); +#endif /* _POSIX_C_SOURCE >= 202405L || _NETBSD_SOURCE || _OPENBSD_SOURCE */ + __END_DECLS #endif /* !_STDLIB_H_ */