summaryrefslogtreecommitdiff
path: root/lib/stdlib.in.h
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2026-03-10 13:24:07 +0100
committerJörg Frings-Fürst <debian@jff.email>2026-03-10 13:24:07 +0100
commitcfd1f17f1a85d95ea12bca8dae42add7dad1ad11 (patch)
tree8016486f8ee7157213f2d09ff2491bfa9c94638a /lib/stdlib.in.h
parent14e4d584d0121031ec40e6c35869745f1747ff29 (diff)
parent1403307d6e2fb4e7b5d97a35f40d1e95134561ab (diff)
Merge branch 'release/debian/1.4.2-1'HEADdebian/1.4.2-1master
Diffstat (limited to 'lib/stdlib.in.h')
-rw-r--r--lib/stdlib.in.h169
1 files changed, 93 insertions, 76 deletions
diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h
index 6667f426..95237f2a 100644
--- a/lib/stdlib.in.h
+++ b/lib/stdlib.in.h
@@ -1,6 +1,6 @@
/* A GNU-like <stdlib.h>.
- Copyright (C) 1995, 2001-2004, 2006-2024 Free Software Foundation, Inc.
+ Copyright (C) 1995, 2001-2004, 2006-2026 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -54,7 +54,7 @@
/* This file uses _Noreturn, _GL_ATTRIBUTE_DEALLOC, _GL_ATTRIBUTE_MALLOC,
_GL_ATTRIBUTE_NODISCARD, _GL_ATTRIBUTE_NOTHROW, _GL_ATTRIBUTE_PURE,
- GNULIB_POSIXCHECK, HAVE_RAW_DECL_*. */
+ _GL_INLINE_HEADER_BEGIN, GNULIB_POSIXCHECK, HAVE_RAW_DECL_*. */
#if !_GL_CONFIG_H_INCLUDED
#error "Please include config.h first."
#endif
@@ -62,11 +62,6 @@
/* NetBSD 5.0 mis-defines NULL. */
#include <stddef.h>
-/* MirBSD 10 defines WEXITSTATUS in <sys/wait.h>, not in <stdlib.h>. */
-#if @GNULIB_SYSTEM_POSIX@ && !defined WEXITSTATUS
-# include <sys/wait.h>
-#endif
-
/* Solaris declares getloadavg() in <sys/loadavg.h>. */
#if (@GNULIB_GETLOADAVG@ || defined GNULIB_POSIXCHECK) && @HAVE_SYS_LOADAVG_H@
/* OpenIndiana has a bug: <sys/time.h> must be included before
@@ -75,6 +70,11 @@
# include <sys/loadavg.h>
#endif
+/* QNX declares getprogname() in <sys/process.h>. */
+#if (@GNULIB_GETPROGNAME@ || defined GNULIB_POSIXCHECK) && @HAVE_SYS_PROCESS_H@
+# include <sys/process.h>
+#endif
+
/* Native Windows platforms declare _mktemp() in <io.h>. */
#if defined _WIN32 && !defined __CYGWIN__
# include <io.h>
@@ -82,13 +82,6 @@
#if @GNULIB_RANDOM_R@
-/* OSF/1 5.1 declares 'struct random_data' in <random.h>, which is included
- from <stdlib.h> if _REENTRANT is defined. Include it whenever we need
- 'struct random_data'. */
-# if @HAVE_RANDOM_H@
-# include <random.h>
-# endif
-
# include <stdint.h>
# if !@HAVE_STRUCT_RANDOM_DATA@
@@ -119,17 +112,25 @@ struct random_data
# include <unistd.h>
#endif
-#if ((@GNULIB_STRTOL@ && @REPLACE_STRTOL@) || (@GNULIB_STRTOLL@ && @REPLACE_STRTOLL@) || (@GNULIB_STRTOUL@ && @REPLACE_STRTOUL@) || (@GNULIB_STRTOULL@ && @REPLACE_STRTOULL@)) && defined __cplusplus && !defined GNULIB_NAMESPACE && defined __GNUG__ && !defined __clang__ && defined __sun
+#if ((@GNULIB_STRTOL@ && @REPLACE_STRTOL@) || (@GNULIB_STRTOLL@ && @REPLACE_STRTOLL@) || (@GNULIB_STRTOUL@ && @REPLACE_STRTOUL@) || (@GNULIB_STRTOULL@ && @REPLACE_STRTOULL@)) && defined __cplusplus && !defined GNULIB_NAMESPACE && defined __GNUG__ && !defined __clang__ && (defined __sun || defined _AIX)
/* When strtol, strtoll, strtoul, or strtoull is going to be defined as a macro
below, this may cause compilation errors later in the libstdc++ header files
(that are part of GCC), such as:
error: 'rpl_strtol' is not a member of 'std'
To avoid this, include the relevant header files here, before these symbols
- get defined as macros. But do so only on Solaris 11 (where it is needed),
- not on mingw (where it would cause other compilation errors). */
+ get defined as macros. But do so only on Solaris 11 and AIX (where it is
+ needed), not on mingw (where it would cause other compilation errors). */
# include <string>
#endif
+_GL_INLINE_HEADER_BEGIN
+#ifndef _GL_STDLIB_INLINE
+# define _GL_STDLIB_INLINE _GL_INLINE
+#endif
+#ifndef _GL_REALLOC_INLINE
+# define _GL_REALLOC_INLINE _GL_INLINE
+#endif
+
/* _GL_ATTRIBUTE_DEALLOC (F, I) declares that the function returns pointers
that can be freed by passing them as the Ith argument to the
function F. */
@@ -159,6 +160,18 @@ struct random_data
# endif
#endif
+/* _GL_ATTRIBUTE_NONNULL_IF_NONZERO (NP, NI) declares that the argument NP
+ (a pointer) must not be NULL if the argument NI (an integer) is != 0. */
+/* Applies to: functions. */
+#ifndef _GL_ATTRIBUTE_NONNULL_IF_NONZERO
+# if __GNUC__ >= 15 && !defined __clang__
+# define _GL_ATTRIBUTE_NONNULL_IF_NONZERO(np, ni) \
+ __attribute__ ((__nonnull_if_nonzero__ (np, ni)))
+# else
+# define _GL_ATTRIBUTE_NONNULL_IF_NONZERO(np, ni)
+# endif
+#endif
+
/* _GL_ATTRIBUTE_NOTHROW declares that the function does not throw exceptions.
*/
#ifndef _GL_ATTRIBUTE_NOTHROW
@@ -214,6 +227,18 @@ struct random_data
#endif
+/* Declarations for ISO C N3322. */
+#if defined __GNUC__ && __GNUC__ >= 15 && !defined __clang__
+_GL_EXTERN_C void *_GL_FUNCDECL_SYS_NAME (bsearch)
+ (const void *__key, const void *__base, size_t __nmemb, size_t __size,
+ int (*__compare) (const void *, const void *))
+ _GL_ATTRIBUTE_NONNULL_IF_NONZERO (2, 3) _GL_ARG_NONNULL ((5));
+_GL_EXTERN_C void qsort (void *__base, size_t __nmemb, size_t __size,
+ int (*__compare) (const void *, const void *))
+ _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 2) _GL_ARG_NONNULL ((4));
+#endif
+
+
#if @GNULIB__EXIT@
/* Terminate the current process with the given return code, without running
the 'atexit' handlers. */
@@ -234,7 +259,6 @@ _GL_CXXALIAS_SYS (_Exit, void, (int status));
_GL_CXXALIASWARN (_Exit);
# endif
#elif defined GNULIB_POSIXCHECK
-# undef _Exit
# if HAVE_RAW_DECL__EXIT
_GL_WARN_ON_USE (_Exit, "_Exit is unportable - "
"use gnulib module _Exit for portability");
@@ -281,10 +305,9 @@ _GL_CXXALIAS_SYS (free, void, (void *ptr));
_GL_CXXALIASWARN (free);
# endif
#elif defined GNULIB_POSIXCHECK
-# undef free
/* Assume free is always declared. */
-_GL_WARN_ON_USE (free, "free is not future POSIX compliant everywhere - "
- "use gnulib module free for portability");
+_GL_WARN_ON_USE (free, "free is not POSIX:2024 compliant everywhere - "
+ "use gnulib module free-posix for portability");
#endif
@@ -339,7 +362,6 @@ _GL_FUNCDECL_SYS (aligned_alloc, void *,
# endif
# endif
# if defined GNULIB_POSIXCHECK
-# undef aligned_alloc
# if HAVE_RAW_DECL_ALIGNED_ALLOC
_GL_WARN_ON_USE (aligned_alloc, "aligned_alloc is not portable - "
"use gnulib module aligned_alloc for portability");
@@ -359,7 +381,6 @@ _GL_FUNCDECL_SYS (atoll, long long,
_GL_CXXALIAS_SYS (atoll, long long, (const char *string));
_GL_CXXALIASWARN (atoll);
#elif defined GNULIB_POSIXCHECK
-# undef atoll
# if HAVE_RAW_DECL_ATOLL
_GL_WARN_ON_USE (atoll, "atoll is unportable - "
"use gnulib module atoll for portability");
@@ -367,9 +388,10 @@ _GL_WARN_ON_USE (atoll, "atoll is unportable - "
#endif
#if @GNULIB_CALLOC_POSIX@
-# if (@GNULIB_CALLOC_POSIX@ && @REPLACE_CALLOC_FOR_CALLOC_POSIX@) \
+# if @REPLACE_CALLOC_FOR_CALLOC_POSIX@ \
|| (@GNULIB_CALLOC_GNU@ && @REPLACE_CALLOC_FOR_CALLOC_GNU@)
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# if !((defined __cplusplus && defined GNULIB_NAMESPACE) \
+ || _GL_USE_STDLIB_ALLOC)
# undef calloc
# define calloc rpl_calloc
# endif
@@ -415,7 +437,6 @@ _GL_FUNCDECL_SYS (calloc, void *,
# endif
# endif
# if defined GNULIB_POSIXCHECK
-# undef calloc
/* Assume calloc is always declared. */
_GL_WARN_ON_USE (calloc, "calloc is not POSIX compliant everywhere - "
"use gnulib module calloc-posix for portability");
@@ -476,7 +497,6 @@ _GL_FUNCDECL_SYS (canonicalize_file_name, char *,
# endif
# endif
# if defined GNULIB_POSIXCHECK
-# undef canonicalize_file_name
# if HAVE_RAW_DECL_CANONICALIZE_FILE_NAME
_GL_WARN_ON_USE (canonicalize_file_name,
"canonicalize_file_name is unportable - "
@@ -576,7 +596,6 @@ _GL_CXXALIAS_SYS (getloadavg, int, (double loadavg[], int nelem));
_GL_CXXALIASWARN (getloadavg);
# endif
#elif defined GNULIB_POSIXCHECK
-# undef getloadavg
# if HAVE_RAW_DECL_GETLOADAVG
_GL_WARN_ON_USE (getloadavg, "getloadavg is not portable - "
"use gnulib module getloadavg for portability");
@@ -611,7 +630,6 @@ _GL_CXXALIAS_SYS (getprogname, const char *, (void));
_GL_CXXALIASWARN (getprogname);
# endif
#elif defined GNULIB_POSIXCHECK
-# undef getprogname
# if HAVE_RAW_DECL_GETPROGNAME
_GL_WARN_ON_USE (getprogname, "getprogname is unportable - "
"use gnulib module getprogname for portability");
@@ -653,7 +671,6 @@ _GL_CXXALIAS_SYS (getsubopt, int,
_GL_CXXALIASWARN (getsubopt);
# endif
#elif defined GNULIB_POSIXCHECK
-# undef getsubopt
# if HAVE_RAW_DECL_GETSUBOPT
_GL_WARN_ON_USE (getsubopt, "getsubopt is unportable - "
"use gnulib module getsubopt for portability");
@@ -669,7 +686,6 @@ _GL_FUNCDECL_SYS (grantpt, int, (int fd), );
_GL_CXXALIAS_SYS (grantpt, int, (int fd));
_GL_CXXALIASWARN (grantpt);
#elif defined GNULIB_POSIXCHECK
-# undef grantpt
# if HAVE_RAW_DECL_GRANTPT
_GL_WARN_ON_USE (grantpt, "grantpt is not portable - "
"use gnulib module grantpt for portability");
@@ -681,7 +697,7 @@ _GL_WARN_ON_USE (grantpt, "grantpt is not portable - "
by never specifying a zero size), so it does not need malloc or
realloc to be redefined. */
#if @GNULIB_MALLOC_POSIX@
-# if (@GNULIB_MALLOC_POSIX@ && @REPLACE_MALLOC_FOR_MALLOC_POSIX@) \
+# if @REPLACE_MALLOC_FOR_MALLOC_POSIX@ \
|| (@GNULIB_MALLOC_GNU@ && @REPLACE_MALLOC_FOR_MALLOC_GNU@)
# if !((defined __cplusplus && defined GNULIB_NAMESPACE) \
|| _GL_USE_STDLIB_ALLOC)
@@ -730,21 +746,26 @@ _GL_FUNCDECL_SYS (malloc, void *,
# endif
# endif
# if defined GNULIB_POSIXCHECK && !_GL_USE_STDLIB_ALLOC
-# undef malloc
/* Assume malloc is always declared. */
_GL_WARN_ON_USE (malloc, "malloc is not POSIX compliant everywhere - "
"use gnulib module malloc-posix for portability");
# endif
#endif
-/* Return maximum number of bytes of a multibyte character. */
+/* Return maximum number of bytes in a multibyte character in the
+ current locale. */
#if @REPLACE_MB_CUR_MAX@
# if !GNULIB_defined_MB_CUR_MAX
-static inline
-int gl_MB_CUR_MAX (void)
+_GL_STDLIB_INLINE size_t
+gl_MB_CUR_MAX (void)
{
+# if 0 < @REPLACE_MB_CUR_MAX@
+ return @REPLACE_MB_CUR_MAX@;
+# else
/* Turn the value 3 to the value 4, as needed for the UTF-8 encoding. */
- return MB_CUR_MAX + (MB_CUR_MAX == 3);
+ int gl_mb_cur_max = MB_CUR_MAX;
+ return gl_mb_cur_max == 3 ? 4 : gl_mb_cur_max;
+# endif
}
# undef MB_CUR_MAX
# define MB_CUR_MAX gl_MB_CUR_MAX ()
@@ -775,7 +796,6 @@ _GL_CXXALIAS_SYS (mbstowcs, size_t,
_GL_CXXALIASWARN (mbstowcs);
# endif
#elif defined GNULIB_POSIXCHECK
-# undef mbstowcs
# if HAVE_RAW_DECL_MBSTOWCS
_GL_WARN_ON_USE (mbstowcs, "mbstowcs is unportable - "
"use gnulib module mbstowcs for portability");
@@ -805,7 +825,6 @@ _GL_CXXALIAS_SYS (mbtowc, int,
_GL_CXXALIASWARN (mbtowc);
# endif
#elif defined GNULIB_POSIXCHECK
-# undef mbtowc
# if HAVE_RAW_DECL_MBTOWC
_GL_WARN_ON_USE (mbtowc, "mbtowc is not portable - "
"use gnulib module mbtowc for portability");
@@ -826,7 +845,6 @@ _GL_FUNCDECL_SYS (mkdtemp, char *,
_GL_CXXALIAS_SYS (mkdtemp, char *, (char * /*template*/));
_GL_CXXALIASWARN (mkdtemp);
#elif defined GNULIB_POSIXCHECK
-# undef mkdtemp
# if HAVE_RAW_DECL_MKDTEMP
_GL_WARN_ON_USE (mkdtemp, "mkdtemp is unportable - "
"use gnulib module mkdtemp for portability");
@@ -865,7 +883,6 @@ _GL_CXXALIAS_SYS (mkostemp, int, (char * /*template*/, int /*flags*/));
_GL_CXXALIASWARN (mkostemp);
# endif
#elif defined GNULIB_POSIXCHECK
-# undef mkostemp
# if HAVE_RAW_DECL_MKOSTEMP
_GL_WARN_ON_USE (mkostemp, "mkostemp is unportable - "
"use gnulib module mkostemp for portability");
@@ -909,7 +926,6 @@ _GL_CXXALIAS_SYS (mkostemps, int,
_GL_CXXALIASWARN (mkostemps);
# endif
#elif defined GNULIB_POSIXCHECK
-# undef mkostemps
# if HAVE_RAW_DECL_MKOSTEMPS
_GL_WARN_ON_USE (mkostemps, "mkostemps is unportable - "
"use gnulib module mkostemps for portability");
@@ -942,7 +958,6 @@ _GL_CXXALIAS_SYS (mkstemp, int, (char * /*template*/));
# endif
_GL_CXXALIASWARN (mkstemp);
#elif defined GNULIB_POSIXCHECK
-# undef mkstemp
# if HAVE_RAW_DECL_MKSTEMP
_GL_WARN_ON_USE (mkstemp, "mkstemp is unportable - "
"use gnulib module mkstemp for portability");
@@ -967,7 +982,6 @@ _GL_FUNCDECL_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/),
_GL_CXXALIAS_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/));
_GL_CXXALIASWARN (mkstemps);
#elif defined GNULIB_POSIXCHECK
-# undef mkstemps
# if HAVE_RAW_DECL_MKSTEMPS
_GL_WARN_ON_USE (mkstemps, "mkstemps is unportable - "
"use gnulib module mkstemps for portability");
@@ -1012,7 +1026,6 @@ _GL_CXXALIAS_SYS (posix_memalign, int,
_GL_CXXALIASWARN (posix_memalign);
# endif
#elif defined GNULIB_POSIXCHECK
-# undef posix_memalign
# if HAVE_RAW_DECL_POSIX_MEMALIGN
_GL_WARN_ON_USE (posix_memalign, "posix_memalign is not portable - "
"use gnulib module posix_memalign for portability");
@@ -1039,7 +1052,6 @@ _GL_CXXALIAS_SYS (posix_openpt, int, (int flags));
_GL_CXXALIASWARN (posix_openpt);
# endif
#elif defined GNULIB_POSIXCHECK
-# undef posix_openpt
# if HAVE_RAW_DECL_POSIX_OPENPT
_GL_WARN_ON_USE (posix_openpt, "posix_openpt is not portable - "
"use gnulib module posix_openpt for portability");
@@ -1064,7 +1076,6 @@ _GL_CXXALIAS_SYS (ptsname, char *, (int fd));
# endif
_GL_CXXALIASWARN (ptsname);
#elif defined GNULIB_POSIXCHECK
-# undef ptsname
# if HAVE_RAW_DECL_PTSNAME
_GL_WARN_ON_USE (ptsname, "ptsname is not portable - "
"use gnulib module ptsname for portability");
@@ -1093,7 +1104,6 @@ _GL_CXXALIAS_SYS (ptsname_r, int, (int fd, char *buf, size_t len));
# endif
_GL_CXXALIASWARN (ptsname_r);
#elif defined GNULIB_POSIXCHECK
-# undef ptsname_r
# if HAVE_RAW_DECL_PTSNAME_R
_GL_WARN_ON_USE (ptsname_r, "ptsname_r is not portable - "
"use gnulib module ptsname_r for portability");
@@ -1166,7 +1176,8 @@ typedef int (*_gl_qsort_r_compar_fn) (void const *, void const *, void *);
_GL_FUNCDECL_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size,
_gl_qsort_r_compar_fn compare,
void *arg),
- _GL_ARG_NONNULL ((1, 4)));
+ _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 2)
+ _GL_ARG_NONNULL ((4)));
_GL_CXXALIAS_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size,
_gl_qsort_r_compar_fn compare,
void *arg));
@@ -1175,7 +1186,8 @@ _GL_CXXALIAS_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size,
_GL_FUNCDECL_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size,
_gl_qsort_r_compar_fn compare,
void *arg),
- _GL_ARG_NONNULL ((1, 4)));
+ _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 2)
+ _GL_ARG_NONNULL ((4)));
# endif
_GL_CXXALIAS_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size,
_gl_qsort_r_compar_fn compare,
@@ -1185,7 +1197,6 @@ _GL_CXXALIAS_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size,
_GL_CXXALIASWARN (qsort_r);
# endif
#elif defined GNULIB_POSIXCHECK
-# undef qsort_r
# if HAVE_RAW_DECL_QSORT_R
_GL_WARN_ON_USE (qsort_r, "qsort_r is not portable - "
"use gnulib module qsort_r for portability");
@@ -1237,7 +1248,6 @@ _GL_CXXALIAS_SYS_CAST (random, long, (void));
_GL_CXXALIASWARN (random);
# endif
#elif defined GNULIB_POSIXCHECK
-# undef random
# if HAVE_RAW_DECL_RANDOM
_GL_WARN_ON_USE (random, "random is unportable - "
"use gnulib module random for portability");
@@ -1264,7 +1274,6 @@ _GL_CXXALIAS_SYS_CAST (srandom, void, (unsigned int seed));
_GL_CXXALIASWARN (srandom);
# endif
#elif defined GNULIB_POSIXCHECK
-# undef srandom
# if HAVE_RAW_DECL_SRANDOM
_GL_WARN_ON_USE (srandom, "srandom is unportable - "
"use gnulib module random for portability");
@@ -1297,7 +1306,6 @@ _GL_CXXALIAS_SYS_CAST (initstate, char *,
_GL_CXXALIASWARN (initstate);
# endif
#elif defined GNULIB_POSIXCHECK
-# undef initstate
# if HAVE_RAW_DECL_INITSTATE
_GL_WARN_ON_USE (initstate, "initstate is unportable - "
"use gnulib module random for portability");
@@ -1324,7 +1332,6 @@ _GL_CXXALIAS_SYS_CAST (setstate, char *, (char *arg_state));
_GL_CXXALIASWARN (setstate);
# endif
#elif defined GNULIB_POSIXCHECK
-# undef setstate
# if HAVE_RAW_DECL_SETSTATE
_GL_WARN_ON_USE (setstate, "setstate is unportable - "
"use gnulib module random for portability");
@@ -1350,7 +1357,6 @@ _GL_CXXALIAS_SYS (random_r, int, (struct random_data *buf, int32_t *result));
# endif
_GL_CXXALIASWARN (random_r);
#elif defined GNULIB_POSIXCHECK
-# undef random_r
# if HAVE_RAW_DECL_RANDOM_R
_GL_WARN_ON_USE (random_r, "random_r is unportable - "
"use gnulib module random_r for portability");
@@ -1379,7 +1385,6 @@ _GL_CXXALIAS_SYS (srandom_r, int,
# endif
_GL_CXXALIASWARN (srandom_r);
#elif defined GNULIB_POSIXCHECK
-# undef srandom_r
# if HAVE_RAW_DECL_SRANDOM_R
_GL_WARN_ON_USE (srandom_r, "srandom_r is unportable - "
"use gnulib module random_r for portability");
@@ -1414,7 +1419,6 @@ _GL_CXXALIAS_SYS_CAST (initstate_r, int,
# endif
_GL_CXXALIASWARN (initstate_r);
#elif defined GNULIB_POSIXCHECK
-# undef initstate_r
# if HAVE_RAW_DECL_INITSTATE_R
_GL_WARN_ON_USE (initstate_r, "initstate_r is unportable - "
"use gnulib module random_r for portability");
@@ -1445,7 +1449,6 @@ _GL_CXXALIAS_SYS_CAST (setstate_r, int,
# endif
_GL_CXXALIASWARN (setstate_r);
#elif defined GNULIB_POSIXCHECK
-# undef setstate_r
# if HAVE_RAW_DECL_SETSTATE_R
_GL_WARN_ON_USE (setstate_r, "setstate_r is unportable - "
"use gnulib module random_r for portability");
@@ -1454,16 +1457,31 @@ _GL_WARN_ON_USE (setstate_r, "setstate_r is unportable - "
#if @GNULIB_REALLOC_POSIX@
-# if (@GNULIB_REALLOC_POSIX@ && @REPLACE_REALLOC_FOR_REALLOC_POSIX@) \
- || (@GNULIB_REALLOC_GNU@ && @REPLACE_REALLOC_FOR_REALLOC_GNU@)
+# if @REPLACE_REALLOC_FOR_REALLOC_POSIX@
+# if @REPLACE_REALLOC_FOR_REALLOC_POSIX@ == 2
+# define _GL_INLINE_RPL_REALLOC 1
+# ifdef __cplusplus
+extern "C" {
+# endif
+_GL_REALLOC_INLINE void *
+rpl_realloc (void *ptr, size_t size)
+{
+ return realloc (ptr, size ? size : 1);
+}
+# ifdef __cplusplus
+}
+# endif
+# endif
# if !((defined __cplusplus && defined GNULIB_NAMESPACE) \
|| _GL_USE_STDLIB_ALLOC)
# undef realloc
# define realloc rpl_realloc
# endif
+# if !defined _GL_INLINE_RPL_REALLOC
_GL_FUNCDECL_RPL (realloc, void *,
(void *ptr, size_t size),
_GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_NODISCARD);
+# endif
_GL_CXXALIAS_RPL (realloc, void *, (void *ptr, size_t size));
# else
# if __GNUC__ >= 11 && !defined __clang__
@@ -1500,7 +1518,6 @@ _GL_FUNCDECL_SYS (realloc, void *,
# endif
# endif
# if defined GNULIB_POSIXCHECK && !_GL_USE_STDLIB_ALLOC
-# undef realloc
/* Assume realloc is always declared. */
_GL_WARN_ON_USE (realloc, "realloc is not POSIX compliant everywhere - "
"use gnulib module realloc-posix for portability");
@@ -1532,7 +1549,6 @@ _GL_CXXALIAS_SYS (reallocarray, void *,
_GL_CXXALIASWARN (reallocarray);
# endif
#elif defined GNULIB_POSIXCHECK
-# undef reallocarray
# if HAVE_RAW_DECL_REALLOCARRAY
_GL_WARN_ON_USE (reallocarray, "reallocarray is not portable - "
"use gnulib module reallocarray for portability");
@@ -1560,7 +1576,6 @@ _GL_CXXALIAS_SYS (realpath, char *,
# endif
_GL_CXXALIASWARN (realpath);
#elif defined GNULIB_POSIXCHECK
-# undef realpath
# if HAVE_RAW_DECL_REALPATH
_GL_WARN_ON_USE (realpath, "realpath is unportable - use gnulib module "
"canonicalize or canonicalize-lgpl for portability");
@@ -1577,7 +1592,6 @@ _GL_FUNCDECL_SYS (rpmatch, int, (const char *response),
_GL_CXXALIAS_SYS (rpmatch, int, (const char *response));
_GL_CXXALIASWARN (rpmatch);
#elif defined GNULIB_POSIXCHECK
-# undef rpmatch
# if HAVE_RAW_DECL_RPMATCH
_GL_WARN_ON_USE (rpmatch, "rpmatch is unportable - "
"use gnulib module rpmatch for portability");
@@ -1594,7 +1608,6 @@ _GL_FUNCDECL_SYS (secure_getenv, char *,
_GL_CXXALIAS_SYS (secure_getenv, char *, (char const *name));
_GL_CXXALIASWARN (secure_getenv);
#elif defined GNULIB_POSIXCHECK
-# undef secure_getenv
# if HAVE_RAW_DECL_SECURE_GETENV
_GL_WARN_ON_USE (secure_getenv, "secure_getenv is unportable - "
"use gnulib module secure_getenv for portability");
@@ -1627,7 +1640,6 @@ _GL_CXXALIAS_SYS (setenv, int,
_GL_CXXALIASWARN (setenv);
# endif
#elif defined GNULIB_POSIXCHECK
-# undef setenv
# if HAVE_RAW_DECL_SETENV
_GL_WARN_ON_USE (setenv, "setenv is unportable - "
"use gnulib module setenv for portability");
@@ -1672,7 +1684,6 @@ _GL_CXXALIAS_SYS (strtod, double,
_GL_CXXALIASWARN (strtod);
# endif
#elif defined GNULIB_POSIXCHECK
-# undef strtod
# if HAVE_RAW_DECL_STRTOD
_GL_WARN_ON_USE (strtod, "strtod is unportable - "
"use gnulib module strtod for portability");
@@ -1704,7 +1715,6 @@ _GL_CXXALIAS_SYS (strtof, float,
_GL_CXXALIASWARN (strtof);
# endif
#elif defined GNULIB_POSIXCHECK
-# undef strtof
# if HAVE_RAW_DECL_STRTOF
_GL_WARN_ON_USE (strtof, "strtof is unportable - "
"use gnulib module strtof for portability");
@@ -1734,7 +1744,6 @@ _GL_CXXALIAS_SYS (strtold, long double,
# endif
_GL_CXXALIASWARN (strtold);
#elif defined GNULIB_POSIXCHECK
-# undef strtold
# if HAVE_RAW_DECL_STRTOLD
_GL_WARN_ON_USE (strtold, "strtold is unportable - "
"use gnulib module strtold for portability");
@@ -1777,7 +1786,6 @@ _GL_CXXALIAS_SYS (strtol, long,
_GL_CXXALIASWARN (strtol);
# endif
#elif defined GNULIB_POSIXCHECK
-# undef strtol
# if HAVE_RAW_DECL_STRTOL
_GL_WARN_ON_USE (strtol, "strtol is unportable - "
"use gnulib module strtol for portability");
@@ -1818,7 +1826,6 @@ _GL_CXXALIAS_SYS (strtoll, long long,
# endif
_GL_CXXALIASWARN (strtoll);
#elif defined GNULIB_POSIXCHECK
-# undef strtoll
# if HAVE_RAW_DECL_STRTOLL
_GL_WARN_ON_USE (strtoll, "strtoll is unportable - "
"use gnulib module strtoll for portability");
@@ -1860,7 +1867,6 @@ _GL_CXXALIAS_SYS (strtoul, unsigned long,
_GL_CXXALIASWARN (strtoul);
# endif
#elif defined GNULIB_POSIXCHECK
-# undef strtoul
# if HAVE_RAW_DECL_STRTOUL
_GL_WARN_ON_USE (strtoul, "strtoul is unportable - "
"use gnulib module strtoul for portability");
@@ -1901,7 +1907,6 @@ _GL_CXXALIAS_SYS (strtoull, unsigned long long,
# endif
_GL_CXXALIASWARN (strtoull);
#elif defined GNULIB_POSIXCHECK
-# undef strtoull
# if HAVE_RAW_DECL_STRTOULL
_GL_WARN_ON_USE (strtoull, "strtoull is unportable - "
"use gnulib module strtoull for portability");
@@ -1917,7 +1922,6 @@ _GL_FUNCDECL_SYS (unlockpt, int, (int fd), );
_GL_CXXALIAS_SYS (unlockpt, int, (int fd));
_GL_CXXALIASWARN (unlockpt);
#elif defined GNULIB_POSIXCHECK
-# undef unlockpt
# if HAVE_RAW_DECL_UNLOCKPT
_GL_WARN_ON_USE (unlockpt, "unlockpt is not portable - "
"use gnulib module unlockpt for portability");
@@ -1943,7 +1947,6 @@ _GL_CXXALIAS_SYS (unsetenv, int, (const char *name));
_GL_CXXALIASWARN (unsetenv);
# endif
#elif defined GNULIB_POSIXCHECK
-# undef unsetenv
# if HAVE_RAW_DECL_UNSETENV
_GL_WARN_ON_USE (unsetenv, "unsetenv is unportable - "
"use gnulib module unsetenv for portability");
@@ -1968,6 +1971,20 @@ _GL_CXXALIASWARN (wctomb);
#endif
+_GL_INLINE_HEADER_END
+
+
+/* Includes that provide only macros that don't need to be overridden.
+ (Includes that are needed for type definitions and function declarations
+ have their place above, before the function overrides.) */
+
+/* MirBSD 10 defines WEXITSTATUS in <sys/wait.h>, not in <stdlib.h>.
+ glibc 2.41 defines WCOREDUMP in <sys/wait.h>, not in <stdlib.h>. */
+#if @GNULIB_SYSTEM_POSIX@ && !(defined WEXITSTATUS && defined WCOREDUMP)
+# include <sys/wait.h>
+#endif
+
+
#endif /* _@GUARD_PREFIX@_STDLIB_H */
#endif /* _@GUARD_PREFIX@_STDLIB_H */
#endif