root/lib/stdlib.in.h

/* [<][>][^][v][top][bottom][index][help] */
     1 /* A GNU-like <stdlib.h>.
     2 
     3    Copyright (C) 1995, 2001-2004, 2006-2023 Free Software Foundation,
     4    Inc.
     5 
     6    This file is free software: you can redistribute it and/or modify
     7    it under the terms of the GNU Lesser General Public License as
     8    published by the Free Software Foundation; either version 2.1 of the
     9    License, or (at your option) any later version.
    10 
    11    This file is distributed in the hope that it will be useful,
    12    but WITHOUT ANY WARRANTY; without even the implied warranty of
    13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    14    GNU Lesser General Public License for more details.
    15 
    16    You should have received a copy of the GNU Lesser General Public License
    17    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
    18 
    19 #if __GNUC__ >= 3
    20 @PRAGMA_SYSTEM_HEADER@
    21 #endif
    22 @PRAGMA_COLUMNS@
    23 
    24 #if defined __need_system_stdlib_h || defined __need_malloc_and_calloc
    25 /* Special invocation conventions inside some gnulib header files,
    26    and inside some glibc header files, respectively.  */
    27 
    28 #@INCLUDE_NEXT@ @NEXT_STDLIB_H@
    29 
    30 #else
    31 /* Normal invocation convention.  */
    32 
    33 #ifndef _@GUARD_PREFIX@_STDLIB_H
    34 
    35 /* The include_next requires a split double-inclusion guard.  */
    36 #@INCLUDE_NEXT@ @NEXT_STDLIB_H@
    37 
    38 #ifndef _@GUARD_PREFIX@_STDLIB_H
    39 #define _@GUARD_PREFIX@_STDLIB_H
    40 
    41 /* NetBSD 5.0 mis-defines NULL.  */
    42 #include <stddef.h>
    43 
    44 /* MirBSD 10 defines WEXITSTATUS in <sys/wait.h>, not in <stdlib.h>.  */
    45 #if @GNULIB_SYSTEM_POSIX@ && !defined WEXITSTATUS
    46 # include <sys/wait.h>
    47 #endif
    48 
    49 /* Solaris declares getloadavg() in <sys/loadavg.h>.  */
    50 #if (@GNULIB_GETLOADAVG@ || defined GNULIB_POSIXCHECK) && @HAVE_SYS_LOADAVG_H@
    51 /* OpenIndiana has a bug: <sys/time.h> must be included before
    52    <sys/loadavg.h>.  */
    53 # include <sys/time.h>
    54 # include <sys/loadavg.h>
    55 #endif
    56 
    57 /* Native Windows platforms declare _mktemp() in <io.h>.  */
    58 #if defined _WIN32 && !defined __CYGWIN__
    59 # include <io.h>
    60 #endif
    61 
    62 #if @GNULIB_RANDOM_R@
    63 
    64 /* OSF/1 5.1 declares 'struct random_data' in <random.h>, which is included
    65    from <stdlib.h> if _REENTRANT is defined.  Include it whenever we need
    66    'struct random_data'.  */
    67 # if @HAVE_RANDOM_H@
    68 #  include <random.h>
    69 # endif
    70 
    71 # if !@HAVE_STRUCT_RANDOM_DATA@ || @REPLACE_RANDOM_R@ || !@HAVE_RANDOM_R@
    72 #  include <stdint.h>
    73 # endif
    74 
    75 # if !@HAVE_STRUCT_RANDOM_DATA@
    76 /* Define 'struct random_data'.
    77    But allow multiple gnulib generated <stdlib.h> replacements to coexist.  */
    78 #  if !GNULIB_defined_struct_random_data
    79 struct random_data
    80 {
    81   int32_t *fptr;                /* Front pointer.  */
    82   int32_t *rptr;                /* Rear pointer.  */
    83   int32_t *state;               /* Array of state values.  */
    84   int rand_type;                /* Type of random number generator.  */
    85   int rand_deg;                 /* Degree of random number generator.  */
    86   int rand_sep;                 /* Distance between front and rear.  */
    87   int32_t *end_ptr;             /* Pointer behind state table.  */
    88 };
    89 #   define GNULIB_defined_struct_random_data 1
    90 #  endif
    91 # endif
    92 #endif
    93 
    94 #if (@GNULIB_MKSTEMP@ || @GNULIB_MKSTEMPS@ || @GNULIB_MKOSTEMP@ || @GNULIB_MKOSTEMPS@ || @GNULIB_GETSUBOPT@ || defined GNULIB_POSIXCHECK) && ! defined __GLIBC__ && !(defined _WIN32 && ! defined __CYGWIN__)
    95 /* On Mac OS X 10.3, only <unistd.h> declares mkstemp.  */
    96 /* On Mac OS X 10.5, only <unistd.h> declares mkstemps.  */
    97 /* On Mac OS X 10.13, only <unistd.h> declares mkostemp and mkostemps.  */
    98 /* On Cygwin 1.7.1, only <unistd.h> declares getsubopt.  */
    99 /* But avoid namespace pollution on glibc systems and native Windows.  */
   100 # include <unistd.h>
   101 #endif
   102 
   103 /* _GL_ATTRIBUTE_DEALLOC (F, I) declares that the function returns pointers
   104    that can be freed by passing them as the Ith argument to the
   105    function F.  */
   106 #ifndef _GL_ATTRIBUTE_DEALLOC
   107 # if __GNUC__ >= 11
   108 #  define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
   109 # else
   110 #  define _GL_ATTRIBUTE_DEALLOC(f, i)
   111 # endif
   112 #endif
   113 
   114 /* _GL_ATTRIBUTE_DEALLOC_FREE declares that the function returns pointers that
   115    can be freed via 'free'; it can be used only after declaring 'free'.  */
   116 /* Applies to: functions.  Cannot be used on inline functions.  */
   117 #ifndef _GL_ATTRIBUTE_DEALLOC_FREE
   118 # define _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_DEALLOC (free, 1)
   119 #endif
   120 
   121 /* _GL_ATTRIBUTE_MALLOC declares that the function returns a pointer to freshly
   122    allocated memory.  */
   123 /* Applies to: functions.  */
   124 #ifndef _GL_ATTRIBUTE_MALLOC
   125 # if __GNUC__ >= 3 || defined __clang__
   126 #  define _GL_ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
   127 # else
   128 #  define _GL_ATTRIBUTE_MALLOC
   129 # endif
   130 #endif
   131 
   132 /* The __attribute__ feature is available in gcc versions 2.5 and later.
   133    The attribute __pure__ was added in gcc 2.96.  */
   134 #ifndef _GL_ATTRIBUTE_PURE
   135 # if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || defined __clang__
   136 #  define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
   137 # else
   138 #  define _GL_ATTRIBUTE_PURE /* empty */
   139 # endif
   140 #endif
   141 
   142 /* The definition of _Noreturn is copied here.  */
   143 
   144 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
   145 
   146 /* The definition of _GL_ARG_NONNULL is copied here.  */
   147 
   148 /* The definition of _GL_WARN_ON_USE is copied here.  */
   149 
   150 
   151 /* Some systems do not define EXIT_*, despite otherwise supporting C89.  */
   152 #ifndef EXIT_SUCCESS
   153 # define EXIT_SUCCESS 0
   154 #endif
   155 /* Tandem/NSK and other platforms that define EXIT_FAILURE as -1 interfere
   156    with proper operation of xargs.  */
   157 #ifndef EXIT_FAILURE
   158 # define EXIT_FAILURE 1
   159 #elif EXIT_FAILURE != 1
   160 # undef EXIT_FAILURE
   161 # define EXIT_FAILURE 1
   162 #endif
   163 
   164 
   165 #if @GNULIB__EXIT@
   166 /* Terminate the current process with the given return code, without running
   167    the 'atexit' handlers.  */
   168 # if !@HAVE__EXIT@
   169 _GL_FUNCDECL_SYS (_Exit, _Noreturn void, (int status));
   170 # endif
   171 _GL_CXXALIAS_SYS (_Exit, void, (int status));
   172 _GL_CXXALIASWARN (_Exit);
   173 #elif defined GNULIB_POSIXCHECK
   174 # undef _Exit
   175 # if HAVE_RAW_DECL__EXIT
   176 _GL_WARN_ON_USE (_Exit, "_Exit is unportable - "
   177                  "use gnulib module _Exit for portability");
   178 # endif
   179 #endif
   180 
   181 
   182 #if @GNULIB_FREE_POSIX@
   183 # if @REPLACE_FREE@
   184 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
   185 #   undef free
   186 #   define free rpl_free
   187 #  endif
   188 #  if defined __cplusplus && (__GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2)
   189 _GL_FUNCDECL_RPL (free, void, (void *ptr) throw ());
   190 #  else
   191 _GL_FUNCDECL_RPL (free, void, (void *ptr));
   192 #  endif
   193 _GL_CXXALIAS_RPL (free, void, (void *ptr));
   194 # else
   195 _GL_CXXALIAS_SYS (free, void, (void *ptr));
   196 # endif
   197 # if __GLIBC__ >= 2
   198 _GL_CXXALIASWARN (free);
   199 # endif
   200 #elif defined GNULIB_POSIXCHECK
   201 # undef free
   202 /* Assume free is always declared.  */
   203 _GL_WARN_ON_USE (free, "free is not future POSIX compliant everywhere - "
   204                  "use gnulib module free for portability");
   205 #endif
   206 
   207 
   208 /* Allocate memory with indefinite extent and specified alignment.  */
   209 #if @GNULIB_ALIGNED_ALLOC@
   210 # if @REPLACE_ALIGNED_ALLOC@
   211 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
   212 #   undef aligned_alloc
   213 #   define aligned_alloc rpl_aligned_alloc
   214 #  endif
   215 _GL_FUNCDECL_RPL (aligned_alloc, void *,
   216                   (size_t alignment, size_t size)
   217                   _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
   218 _GL_CXXALIAS_RPL (aligned_alloc, void *, (size_t alignment, size_t size));
   219 # else
   220 #  if @HAVE_ALIGNED_ALLOC@
   221 #   if __GNUC__ >= 11
   222 /* For -Wmismatched-dealloc: Associate aligned_alloc with free or rpl_free.  */
   223 _GL_FUNCDECL_SYS (aligned_alloc, void *,
   224                   (size_t alignment, size_t size)
   225                   _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
   226 #   endif
   227 _GL_CXXALIAS_SYS (aligned_alloc, void *, (size_t alignment, size_t size));
   228 #  endif
   229 # endif
   230 # if (__GLIBC__ >= 2) && @HAVE_ALIGNED_ALLOC@
   231 _GL_CXXALIASWARN (aligned_alloc);
   232 # endif
   233 #else
   234 # if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined aligned_alloc
   235 /* For -Wmismatched-dealloc: Associate aligned_alloc with free or rpl_free.  */
   236 _GL_FUNCDECL_SYS (aligned_alloc, void *,
   237                   (size_t alignment, size_t size)
   238                   _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
   239 # endif
   240 # if defined GNULIB_POSIXCHECK
   241 #  undef aligned_alloc
   242 #  if HAVE_RAW_DECL_ALIGNED_ALLOC
   243 _GL_WARN_ON_USE (aligned_alloc, "aligned_alloc is not portable - "
   244                  "use gnulib module aligned_alloc for portability");
   245 #  endif
   246 # endif
   247 #endif
   248 
   249 #if @GNULIB_ATOLL@
   250 /* Parse a signed decimal integer.
   251    Returns the value of the integer.  Errors are not detected.  */
   252 # if !@HAVE_ATOLL@
   253 _GL_FUNCDECL_SYS (atoll, long long, (const char *string)
   254                                     _GL_ATTRIBUTE_PURE
   255                                     _GL_ARG_NONNULL ((1)));
   256 # endif
   257 _GL_CXXALIAS_SYS (atoll, long long, (const char *string));
   258 _GL_CXXALIASWARN (atoll);
   259 #elif defined GNULIB_POSIXCHECK
   260 # undef atoll
   261 # if HAVE_RAW_DECL_ATOLL
   262 _GL_WARN_ON_USE (atoll, "atoll is unportable - "
   263                  "use gnulib module atoll for portability");
   264 # endif
   265 #endif
   266 
   267 #if @GNULIB_CALLOC_POSIX@
   268 # if (@GNULIB_CALLOC_POSIX@ && @REPLACE_CALLOC_FOR_CALLOC_POSIX@) \
   269      || (@GNULIB_CALLOC_GNU@ && @REPLACE_CALLOC_FOR_CALLOC_GNU@)
   270 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
   271 #   undef calloc
   272 #   define calloc rpl_calloc
   273 #  endif
   274 _GL_FUNCDECL_RPL (calloc, void *,
   275                   (size_t nmemb, size_t size)
   276                   _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
   277 _GL_CXXALIAS_RPL (calloc, void *, (size_t nmemb, size_t size));
   278 # else
   279 #  if __GNUC__ >= 11
   280 /* For -Wmismatched-dealloc: Associate calloc with free or rpl_free.  */
   281 _GL_FUNCDECL_SYS (calloc, void *,
   282                   (size_t nmemb, size_t size)
   283                   _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
   284 #  endif
   285 _GL_CXXALIAS_SYS (calloc, void *, (size_t nmemb, size_t size));
   286 # endif
   287 # if __GLIBC__ >= 2
   288 _GL_CXXALIASWARN (calloc);
   289 # endif
   290 #else
   291 # if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined calloc
   292 /* For -Wmismatched-dealloc: Associate calloc with free or rpl_free.  */
   293 _GL_FUNCDECL_SYS (calloc, void *,
   294                   (size_t nmemb, size_t size)
   295                   _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
   296 # endif
   297 # if defined GNULIB_POSIXCHECK
   298 #  undef calloc
   299 /* Assume calloc is always declared.  */
   300 _GL_WARN_ON_USE (calloc, "calloc is not POSIX compliant everywhere - "
   301                  "use gnulib module calloc-posix for portability");
   302 # endif
   303 #endif
   304 
   305 #if @GNULIB_CANONICALIZE_FILE_NAME@
   306 # if @REPLACE_CANONICALIZE_FILE_NAME@
   307 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
   308 #   define canonicalize_file_name rpl_canonicalize_file_name
   309 #  endif
   310 _GL_FUNCDECL_RPL (canonicalize_file_name, char *,
   311                   (const char *name)
   312                   _GL_ARG_NONNULL ((1))
   313                   _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
   314 _GL_CXXALIAS_RPL (canonicalize_file_name, char *, (const char *name));
   315 # else
   316 #  if !@HAVE_CANONICALIZE_FILE_NAME@ || __GNUC__ >= 11
   317 _GL_FUNCDECL_SYS (canonicalize_file_name, char *,
   318                   (const char *name)
   319                   _GL_ARG_NONNULL ((1))
   320                   _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
   321 #  endif
   322 _GL_CXXALIAS_SYS (canonicalize_file_name, char *, (const char *name));
   323 # endif
   324 # ifndef GNULIB_defined_canonicalize_file_name
   325 #  define GNULIB_defined_canonicalize_file_name \
   326      (!@HAVE_CANONICALIZE_FILE_NAME@ || @REPLACE_CANONICALIZE_FILE_NAME@)
   327 # endif
   328 _GL_CXXALIASWARN (canonicalize_file_name);
   329 #else
   330 # if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined canonicalize_file_name
   331 /* For -Wmismatched-dealloc: Associate canonicalize_file_name with free or
   332    rpl_free.  */
   333 _GL_FUNCDECL_SYS (canonicalize_file_name, char *,
   334                   (const char *name)
   335                   _GL_ARG_NONNULL ((1))
   336                   _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
   337 # endif
   338 # if defined GNULIB_POSIXCHECK
   339 #  undef canonicalize_file_name
   340 #  if HAVE_RAW_DECL_CANONICALIZE_FILE_NAME
   341 _GL_WARN_ON_USE (canonicalize_file_name,
   342                  "canonicalize_file_name is unportable - "
   343                  "use gnulib module canonicalize-lgpl for portability");
   344 #  endif
   345 # endif
   346 #endif
   347 
   348 #if @GNULIB_MDA_ECVT@
   349 /* On native Windows, map 'ecvt' to '_ecvt', so that -loldnames is not
   350    required.  In C++ with GNULIB_NAMESPACE, avoid differences between
   351    platforms by defining GNULIB_NAMESPACE::ecvt on all platforms that have
   352    it.  */
   353 # if defined _WIN32 && !defined __CYGWIN__
   354 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
   355 #   undef ecvt
   356 #   define ecvt _ecvt
   357 #  endif
   358 _GL_CXXALIAS_MDA (ecvt, char *,
   359                   (double number, int ndigits, int *decptp, int *signp));
   360 # else
   361 #  if @HAVE_DECL_ECVT@
   362 _GL_CXXALIAS_SYS (ecvt, char *,
   363                   (double number, int ndigits, int *decptp, int *signp));
   364 #  endif
   365 # endif
   366 # if (defined _WIN32 && !defined __CYGWIN__) || @HAVE_DECL_ECVT@
   367 _GL_CXXALIASWARN (ecvt);
   368 # endif
   369 #endif
   370 
   371 #if @GNULIB_MDA_FCVT@
   372 /* On native Windows, map 'fcvt' to '_fcvt', so that -loldnames is not
   373    required.  In C++ with GNULIB_NAMESPACE, avoid differences between
   374    platforms by defining GNULIB_NAMESPACE::fcvt on all platforms that have
   375    it.  */
   376 # if defined _WIN32 && !defined __CYGWIN__
   377 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
   378 #   undef fcvt
   379 #   define fcvt _fcvt
   380 #  endif
   381 _GL_CXXALIAS_MDA (fcvt, char *,
   382                   (double number, int ndigits, int *decptp, int *signp));
   383 # else
   384 #  if @HAVE_DECL_FCVT@
   385 _GL_CXXALIAS_SYS (fcvt, char *,
   386                   (double number, int ndigits, int *decptp, int *signp));
   387 #  endif
   388 # endif
   389 # if (defined _WIN32 && !defined __CYGWIN__) || @HAVE_DECL_FCVT@
   390 _GL_CXXALIASWARN (fcvt);
   391 # endif
   392 #endif
   393 
   394 #if @GNULIB_MDA_GCVT@
   395 /* On native Windows, map 'gcvt' to '_gcvt', so that -loldnames is not
   396    required.  In C++ with GNULIB_NAMESPACE, avoid differences between
   397    platforms by defining GNULIB_NAMESPACE::gcvt on all platforms that have
   398    it.  */
   399 # if defined _WIN32 && !defined __CYGWIN__
   400 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
   401 #   undef gcvt
   402 #   define gcvt _gcvt
   403 #  endif
   404 _GL_CXXALIAS_MDA (gcvt, char *, (double number, int ndigits, char *buf));
   405 # else
   406 #  if @HAVE_DECL_GCVT@
   407 _GL_CXXALIAS_SYS (gcvt, char *, (double number, int ndigits, char *buf));
   408 #  endif
   409 # endif
   410 # if (defined _WIN32 && !defined __CYGWIN__) || @HAVE_DECL_GCVT@
   411 _GL_CXXALIASWARN (gcvt);
   412 # endif
   413 #endif
   414 
   415 #if @GNULIB_GETLOADAVG@
   416 /* Store max(NELEM,3) load average numbers in LOADAVG[].
   417    The three numbers are the load average of the last 1 minute, the last 5
   418    minutes, and the last 15 minutes, respectively.
   419    LOADAVG is an array of NELEM numbers.  */
   420 # if !@HAVE_DECL_GETLOADAVG@
   421 _GL_FUNCDECL_SYS (getloadavg, int, (double loadavg[], int nelem)
   422                                    _GL_ARG_NONNULL ((1)));
   423 # endif
   424 _GL_CXXALIAS_SYS (getloadavg, int, (double loadavg[], int nelem));
   425 _GL_CXXALIASWARN (getloadavg);
   426 #elif defined GNULIB_POSIXCHECK
   427 # undef getloadavg
   428 # if HAVE_RAW_DECL_GETLOADAVG
   429 _GL_WARN_ON_USE (getloadavg, "getloadavg is not portable - "
   430                  "use gnulib module getloadavg for portability");
   431 # endif
   432 #endif
   433 
   434 #if @GNULIB_GETSUBOPT@
   435 /* Assuming *OPTIONP is a comma separated list of elements of the form
   436    "token" or "token=value", getsubopt parses the first of these elements.
   437    If the first element refers to a "token" that is member of the given
   438    NULL-terminated array of tokens:
   439      - It replaces the comma with a NUL byte, updates *OPTIONP to point past
   440        the first option and the comma, sets *VALUEP to the value of the
   441        element (or NULL if it doesn't contain an "=" sign),
   442      - It returns the index of the "token" in the given array of tokens.
   443    Otherwise it returns -1, and *OPTIONP and *VALUEP are undefined.
   444    For more details see the POSIX specification.
   445    https://pubs.opengroup.org/onlinepubs/9699919799/functions/getsubopt.html */
   446 # if !@HAVE_GETSUBOPT@
   447 _GL_FUNCDECL_SYS (getsubopt, int,
   448                   (char **optionp, char *const *tokens, char **valuep)
   449                   _GL_ARG_NONNULL ((1, 2, 3)));
   450 # endif
   451 _GL_CXXALIAS_SYS (getsubopt, int,
   452                   (char **optionp, char *const *tokens, char **valuep));
   453 _GL_CXXALIASWARN (getsubopt);
   454 #elif defined GNULIB_POSIXCHECK
   455 # undef getsubopt
   456 # if HAVE_RAW_DECL_GETSUBOPT
   457 _GL_WARN_ON_USE (getsubopt, "getsubopt is unportable - "
   458                  "use gnulib module getsubopt for portability");
   459 # endif
   460 #endif
   461 
   462 #if @GNULIB_GRANTPT@
   463 /* Change the ownership and access permission of the slave side of the
   464    pseudo-terminal whose master side is specified by FD.  */
   465 # if !@HAVE_GRANTPT@
   466 _GL_FUNCDECL_SYS (grantpt, int, (int fd));
   467 # endif
   468 _GL_CXXALIAS_SYS (grantpt, int, (int fd));
   469 _GL_CXXALIASWARN (grantpt);
   470 #elif defined GNULIB_POSIXCHECK
   471 # undef grantpt
   472 # if HAVE_RAW_DECL_GRANTPT
   473 _GL_WARN_ON_USE (grantpt, "grantpt is not portable - "
   474                  "use gnulib module grantpt for portability");
   475 # endif
   476 #endif
   477 
   478 /* If _GL_USE_STDLIB_ALLOC is nonzero, the including module does not
   479    rely on GNU or POSIX semantics for malloc and realloc (for example,
   480    by never specifying a zero size), so it does not need malloc or
   481    realloc to be redefined.  */
   482 #if @GNULIB_MALLOC_POSIX@
   483 # if (@GNULIB_MALLOC_POSIX@ && @REPLACE_MALLOC_FOR_MALLOC_POSIX@) \
   484      || (@GNULIB_MALLOC_GNU@ && @REPLACE_MALLOC_FOR_MALLOC_GNU@)
   485 #  if !((defined __cplusplus && defined GNULIB_NAMESPACE) \
   486         || _GL_USE_STDLIB_ALLOC)
   487 #   undef malloc
   488 #   define malloc rpl_malloc
   489 #  endif
   490 _GL_FUNCDECL_RPL (malloc, void *,
   491                   (size_t size)
   492                   _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
   493 _GL_CXXALIAS_RPL (malloc, void *, (size_t size));
   494 # else
   495 #  if __GNUC__ >= 11
   496 /* For -Wmismatched-dealloc: Associate malloc with free or rpl_free.  */
   497 _GL_FUNCDECL_SYS (malloc, void *,
   498                   (size_t size)
   499                   _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
   500 #  endif
   501 _GL_CXXALIAS_SYS (malloc, void *, (size_t size));
   502 # endif
   503 # if __GLIBC__ >= 2
   504 _GL_CXXALIASWARN (malloc);
   505 # endif
   506 #else
   507 # if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined malloc
   508 /* For -Wmismatched-dealloc: Associate malloc with free or rpl_free.  */
   509 _GL_FUNCDECL_SYS (malloc, void *,
   510                   (size_t size)
   511                   _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
   512 # endif
   513 # if defined GNULIB_POSIXCHECK && !_GL_USE_STDLIB_ALLOC
   514 #  undef malloc
   515 /* Assume malloc is always declared.  */
   516 _GL_WARN_ON_USE (malloc, "malloc is not POSIX compliant everywhere - "
   517                  "use gnulib module malloc-posix for portability");
   518 # endif
   519 #endif
   520 
   521 /* Convert a multibyte character to a wide character.  */
   522 #if @GNULIB_MBTOWC@
   523 # if @REPLACE_MBTOWC@
   524 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
   525 #   undef mbtowc
   526 #   define mbtowc rpl_mbtowc
   527 #  endif
   528 _GL_FUNCDECL_RPL (mbtowc, int,
   529                   (wchar_t *restrict pwc, const char *restrict s, size_t n));
   530 _GL_CXXALIAS_RPL (mbtowc, int,
   531                   (wchar_t *restrict pwc, const char *restrict s, size_t n));
   532 # else
   533 #  if !@HAVE_MBTOWC@
   534 _GL_FUNCDECL_SYS (mbtowc, int,
   535                   (wchar_t *restrict pwc, const char *restrict s, size_t n));
   536 #  endif
   537 _GL_CXXALIAS_SYS (mbtowc, int,
   538                   (wchar_t *restrict pwc, const char *restrict s, size_t n));
   539 # endif
   540 # if __GLIBC__ >= 2
   541 _GL_CXXALIASWARN (mbtowc);
   542 # endif
   543 #elif defined GNULIB_POSIXCHECK
   544 # undef mbtowc
   545 # if HAVE_RAW_DECL_MBTOWC
   546 _GL_WARN_ON_USE (mbtowc, "mbtowc is not portable - "
   547                  "use gnulib module mbtowc for portability");
   548 # endif
   549 #endif
   550 
   551 #if @GNULIB_MKDTEMP@
   552 /* Create a unique temporary directory from TEMPLATE.
   553    The last six characters of TEMPLATE must be "XXXXXX";
   554    they are replaced with a string that makes the directory name unique.
   555    Returns TEMPLATE, or a null pointer if it cannot get a unique name.
   556    The directory is created mode 700.  */
   557 # if !@HAVE_MKDTEMP@
   558 _GL_FUNCDECL_SYS (mkdtemp, char *, (char * /*template*/) _GL_ARG_NONNULL ((1)));
   559 # endif
   560 _GL_CXXALIAS_SYS (mkdtemp, char *, (char * /*template*/));
   561 _GL_CXXALIASWARN (mkdtemp);
   562 #elif defined GNULIB_POSIXCHECK
   563 # undef mkdtemp
   564 # if HAVE_RAW_DECL_MKDTEMP
   565 _GL_WARN_ON_USE (mkdtemp, "mkdtemp is unportable - "
   566                  "use gnulib module mkdtemp for portability");
   567 # endif
   568 #endif
   569 
   570 #if @GNULIB_MKOSTEMP@
   571 /* Create a unique temporary file from TEMPLATE.
   572    The last six characters of TEMPLATE must be "XXXXXX";
   573    they are replaced with a string that makes the file name unique.
   574    The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
   575    and O_TEXT, O_BINARY (defined in "binary-io.h").
   576    The file is then created, with the specified flags, ensuring it didn't exist
   577    before.
   578    The file is created read-write (mask at least 0600 & ~umask), but it may be
   579    world-readable and world-writable (mask 0666 & ~umask), depending on the
   580    implementation.
   581    Returns the open file descriptor if successful, otherwise -1 and errno
   582    set.  */
   583 # if !@HAVE_MKOSTEMP@
   584 _GL_FUNCDECL_SYS (mkostemp, int, (char * /*template*/, int /*flags*/)
   585                                  _GL_ARG_NONNULL ((1)));
   586 # endif
   587 _GL_CXXALIAS_SYS (mkostemp, int, (char * /*template*/, int /*flags*/));
   588 _GL_CXXALIASWARN (mkostemp);
   589 #elif defined GNULIB_POSIXCHECK
   590 # undef mkostemp
   591 # if HAVE_RAW_DECL_MKOSTEMP
   592 _GL_WARN_ON_USE (mkostemp, "mkostemp is unportable - "
   593                  "use gnulib module mkostemp for portability");
   594 # endif
   595 #endif
   596 
   597 #if @GNULIB_MKOSTEMPS@
   598 /* Create a unique temporary file from TEMPLATE.
   599    The last six characters of TEMPLATE before a suffix of length
   600    SUFFIXLEN must be "XXXXXX";
   601    they are replaced with a string that makes the file name unique.
   602    The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
   603    and O_TEXT, O_BINARY (defined in "binary-io.h").
   604    The file is then created, with the specified flags, ensuring it didn't exist
   605    before.
   606    The file is created read-write (mask at least 0600 & ~umask), but it may be
   607    world-readable and world-writable (mask 0666 & ~umask), depending on the
   608    implementation.
   609    Returns the open file descriptor if successful, otherwise -1 and errno
   610    set.  */
   611 # if !@HAVE_MKOSTEMPS@
   612 _GL_FUNCDECL_SYS (mkostemps, int,
   613                   (char * /*template*/, int /*suffixlen*/, int /*flags*/)
   614                   _GL_ARG_NONNULL ((1)));
   615 # endif
   616 _GL_CXXALIAS_SYS (mkostemps, int,
   617                   (char * /*template*/, int /*suffixlen*/, int /*flags*/));
   618 _GL_CXXALIASWARN (mkostemps);
   619 #elif defined GNULIB_POSIXCHECK
   620 # undef mkostemps
   621 # if HAVE_RAW_DECL_MKOSTEMPS
   622 _GL_WARN_ON_USE (mkostemps, "mkostemps is unportable - "
   623                  "use gnulib module mkostemps for portability");
   624 # endif
   625 #endif
   626 
   627 #if @GNULIB_MKSTEMP@
   628 /* Create a unique temporary file from TEMPLATE.
   629    The last six characters of TEMPLATE must be "XXXXXX";
   630    they are replaced with a string that makes the file name unique.
   631    The file is then created, ensuring it didn't exist before.
   632    The file is created read-write (mask at least 0600 & ~umask), but it may be
   633    world-readable and world-writable (mask 0666 & ~umask), depending on the
   634    implementation.
   635    Returns the open file descriptor if successful, otherwise -1 and errno
   636    set.  */
   637 # if @REPLACE_MKSTEMP@
   638 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
   639 #   define mkstemp rpl_mkstemp
   640 #  endif
   641 _GL_FUNCDECL_RPL (mkstemp, int, (char * /*template*/) _GL_ARG_NONNULL ((1)));
   642 _GL_CXXALIAS_RPL (mkstemp, int, (char * /*template*/));
   643 # else
   644 #  if ! @HAVE_MKSTEMP@
   645 _GL_FUNCDECL_SYS (mkstemp, int, (char * /*template*/) _GL_ARG_NONNULL ((1)));
   646 #  endif
   647 _GL_CXXALIAS_SYS (mkstemp, int, (char * /*template*/));
   648 # endif
   649 _GL_CXXALIASWARN (mkstemp);
   650 #elif defined GNULIB_POSIXCHECK
   651 # undef mkstemp
   652 # if HAVE_RAW_DECL_MKSTEMP
   653 _GL_WARN_ON_USE (mkstemp, "mkstemp is unportable - "
   654                  "use gnulib module mkstemp for portability");
   655 # endif
   656 #endif
   657 
   658 #if @GNULIB_MKSTEMPS@
   659 /* Create a unique temporary file from TEMPLATE.
   660    The last six characters of TEMPLATE prior to a suffix of length
   661    SUFFIXLEN must be "XXXXXX";
   662    they are replaced with a string that makes the file name unique.
   663    The file is then created, ensuring it didn't exist before.
   664    The file is created read-write (mask at least 0600 & ~umask), but it may be
   665    world-readable and world-writable (mask 0666 & ~umask), depending on the
   666    implementation.
   667    Returns the open file descriptor if successful, otherwise -1 and errno
   668    set.  */
   669 # if !@HAVE_MKSTEMPS@
   670 _GL_FUNCDECL_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/)
   671                                  _GL_ARG_NONNULL ((1)));
   672 # endif
   673 _GL_CXXALIAS_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/));
   674 _GL_CXXALIASWARN (mkstemps);
   675 #elif defined GNULIB_POSIXCHECK
   676 # undef mkstemps
   677 # if HAVE_RAW_DECL_MKSTEMPS
   678 _GL_WARN_ON_USE (mkstemps, "mkstemps is unportable - "
   679                  "use gnulib module mkstemps for portability");
   680 # endif
   681 #endif
   682 
   683 #if @GNULIB_MDA_MKTEMP@
   684 /* On native Windows, map 'mktemp' to '_mktemp', so that -loldnames is not
   685    required.  In C++ with GNULIB_NAMESPACE, avoid differences between
   686    platforms by defining GNULIB_NAMESPACE::mktemp always.  */
   687 # if defined _WIN32 && !defined __CYGWIN__
   688 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
   689 #   undef mktemp
   690 #   define mktemp _mktemp
   691 #  endif
   692 _GL_CXXALIAS_MDA (mktemp, char *, (char * /*template*/));
   693 # else
   694 _GL_CXXALIAS_SYS (mktemp, char *, (char * /*template*/));
   695 # endif
   696 _GL_CXXALIASWARN (mktemp);
   697 #endif
   698 
   699 /* Allocate memory with indefinite extent and specified alignment.  */
   700 #if @GNULIB_POSIX_MEMALIGN@
   701 # if @REPLACE_POSIX_MEMALIGN@
   702 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
   703 #   undef posix_memalign
   704 #   define posix_memalign rpl_posix_memalign
   705 #  endif
   706 _GL_FUNCDECL_RPL (posix_memalign, int,
   707                   (void **memptr, size_t alignment, size_t size)
   708                   _GL_ARG_NONNULL ((1)));
   709 _GL_CXXALIAS_RPL (posix_memalign, int,
   710                   (void **memptr, size_t alignment, size_t size));
   711 # else
   712 #  if @HAVE_POSIX_MEMALIGN@
   713 _GL_CXXALIAS_SYS (posix_memalign, int,
   714                   (void **memptr, size_t alignment, size_t size));
   715 #  endif
   716 # endif
   717 # if @HAVE_POSIX_MEMALIGN@
   718 _GL_CXXALIASWARN (posix_memalign);
   719 # endif
   720 #elif defined GNULIB_POSIXCHECK
   721 # undef posix_memalign
   722 # if HAVE_RAW_DECL_POSIX_MEMALIGN
   723 _GL_WARN_ON_USE (posix_memalign, "posix_memalign is not portable - "
   724                  "use gnulib module posix_memalign for portability");
   725 # endif
   726 #endif
   727 
   728 #if @GNULIB_POSIX_OPENPT@
   729 /* Return an FD open to the master side of a pseudo-terminal.  Flags should
   730    include O_RDWR, and may also include O_NOCTTY.  */
   731 # if !@HAVE_POSIX_OPENPT@
   732 _GL_FUNCDECL_SYS (posix_openpt, int, (int flags));
   733 # endif
   734 _GL_CXXALIAS_SYS (posix_openpt, int, (int flags));
   735 _GL_CXXALIASWARN (posix_openpt);
   736 #elif defined GNULIB_POSIXCHECK
   737 # undef posix_openpt
   738 # if HAVE_RAW_DECL_POSIX_OPENPT
   739 _GL_WARN_ON_USE (posix_openpt, "posix_openpt is not portable - "
   740                  "use gnulib module posix_openpt for portability");
   741 # endif
   742 #endif
   743 
   744 #if @GNULIB_PTSNAME@
   745 /* Return the pathname of the pseudo-terminal slave associated with
   746    the master FD is open on, or NULL on errors.  */
   747 # if @REPLACE_PTSNAME@
   748 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
   749 #   undef ptsname
   750 #   define ptsname rpl_ptsname
   751 #  endif
   752 _GL_FUNCDECL_RPL (ptsname, char *, (int fd));
   753 _GL_CXXALIAS_RPL (ptsname, char *, (int fd));
   754 # else
   755 #  if !@HAVE_PTSNAME@
   756 _GL_FUNCDECL_SYS (ptsname, char *, (int fd));
   757 #  endif
   758 _GL_CXXALIAS_SYS (ptsname, char *, (int fd));
   759 # endif
   760 _GL_CXXALIASWARN (ptsname);
   761 #elif defined GNULIB_POSIXCHECK
   762 # undef ptsname
   763 # if HAVE_RAW_DECL_PTSNAME
   764 _GL_WARN_ON_USE (ptsname, "ptsname is not portable - "
   765                  "use gnulib module ptsname for portability");
   766 # endif
   767 #endif
   768 
   769 #if @GNULIB_PTSNAME_R@
   770 /* Set the pathname of the pseudo-terminal slave associated with
   771    the master FD is open on and return 0, or set errno and return
   772    non-zero on errors.  */
   773 # if @REPLACE_PTSNAME_R@
   774 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
   775 #   undef ptsname_r
   776 #   define ptsname_r rpl_ptsname_r
   777 #  endif
   778 _GL_FUNCDECL_RPL (ptsname_r, int, (int fd, char *buf, size_t len));
   779 _GL_CXXALIAS_RPL (ptsname_r, int, (int fd, char *buf, size_t len));
   780 # else
   781 #  if !@HAVE_PTSNAME_R@
   782 _GL_FUNCDECL_SYS (ptsname_r, int, (int fd, char *buf, size_t len));
   783 #  endif
   784 _GL_CXXALIAS_SYS (ptsname_r, int, (int fd, char *buf, size_t len));
   785 # endif
   786 # ifndef GNULIB_defined_ptsname_r
   787 #  define GNULIB_defined_ptsname_r (!@HAVE_PTSNAME_R@ || @REPLACE_PTSNAME_R@)
   788 # endif
   789 _GL_CXXALIASWARN (ptsname_r);
   790 #elif defined GNULIB_POSIXCHECK
   791 # undef ptsname_r
   792 # if HAVE_RAW_DECL_PTSNAME_R
   793 _GL_WARN_ON_USE (ptsname_r, "ptsname_r is not portable - "
   794                  "use gnulib module ptsname_r for portability");
   795 # endif
   796 #endif
   797 
   798 #if @GNULIB_PUTENV@
   799 # if @REPLACE_PUTENV@
   800 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
   801 #   undef putenv
   802 #   define putenv rpl_putenv
   803 #  endif
   804 _GL_FUNCDECL_RPL (putenv, int, (char *string) _GL_ARG_NONNULL ((1)));
   805 _GL_CXXALIAS_RPL (putenv, int, (char *string));
   806 # elif defined _WIN32 && !defined __CYGWIN__
   807 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
   808 #   undef putenv
   809 #   define putenv _putenv
   810 #  endif
   811 _GL_CXXALIAS_MDA (putenv, int, (char *string));
   812 # else
   813 _GL_CXXALIAS_SYS (putenv, int, (char *string));
   814 # endif
   815 _GL_CXXALIASWARN (putenv);
   816 #elif @GNULIB_MDA_PUTENV@
   817 /* On native Windows, map 'putenv' to '_putenv', so that -loldnames is not
   818    required.  In C++ with GNULIB_NAMESPACE, avoid differences between
   819    platforms by defining GNULIB_NAMESPACE::putenv always.  */
   820 # if defined _WIN32 && !defined __CYGWIN__
   821 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
   822 #   undef putenv
   823 #   define putenv _putenv
   824 #  endif
   825 /* Need to cast, because on mingw, the parameter is either
   826    'const char *string' or 'char *string'.  */
   827 _GL_CXXALIAS_MDA_CAST (putenv, int, (char *string));
   828 # else
   829 _GL_CXXALIAS_SYS (putenv, int, (char *string));
   830 # endif
   831 _GL_CXXALIASWARN (putenv);
   832 #endif
   833 
   834 #if @GNULIB_QSORT_R@
   835 /* Sort an array of NMEMB elements, starting at address BASE, each element
   836    occupying SIZE bytes, in ascending order according to the comparison
   837    function COMPARE.  */
   838 # ifdef __cplusplus
   839 extern "C" {
   840 # endif
   841 # if !GNULIB_defined_qsort_r_fn_types
   842 typedef int (*_gl_qsort_r_compar_fn) (void const *, void const *, void *);
   843 #  define GNULIB_defined_qsort_r_fn_types 1
   844 # endif
   845 # ifdef __cplusplus
   846 }
   847 # endif
   848 # if @REPLACE_QSORT_R@
   849 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
   850 #   undef qsort_r
   851 #   define qsort_r rpl_qsort_r
   852 #  endif
   853 _GL_FUNCDECL_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size,
   854                                   _gl_qsort_r_compar_fn compare,
   855                                   void *arg) _GL_ARG_NONNULL ((1, 4)));
   856 _GL_CXXALIAS_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size,
   857                                   _gl_qsort_r_compar_fn compare,
   858                                   void *arg));
   859 # else
   860 #  if !@HAVE_QSORT_R@
   861 _GL_FUNCDECL_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size,
   862                                   _gl_qsort_r_compar_fn compare,
   863                                   void *arg) _GL_ARG_NONNULL ((1, 4)));
   864 #  endif
   865 _GL_CXXALIAS_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size,
   866                                   _gl_qsort_r_compar_fn compare,
   867                                   void *arg));
   868 # endif
   869 _GL_CXXALIASWARN (qsort_r);
   870 #elif defined GNULIB_POSIXCHECK
   871 # undef qsort_r
   872 # if HAVE_RAW_DECL_QSORT_R
   873 _GL_WARN_ON_USE (qsort_r, "qsort_r is not portable - "
   874                  "use gnulib module qsort_r for portability");
   875 # endif
   876 #endif
   877 
   878 
   879 #if @GNULIB_RANDOM_R@
   880 # if !@HAVE_RANDOM_R@
   881 #  ifndef RAND_MAX
   882 #   define RAND_MAX 2147483647
   883 #  endif
   884 # endif
   885 #endif
   886 
   887 
   888 #if @GNULIB_RANDOM@
   889 # if @REPLACE_RANDOM@
   890 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
   891 #   undef random
   892 #   define random rpl_random
   893 #  endif
   894 _GL_FUNCDECL_RPL (random, long, (void));
   895 _GL_CXXALIAS_RPL (random, long, (void));
   896 # else
   897 #  if !@HAVE_RANDOM@
   898 _GL_FUNCDECL_SYS (random, long, (void));
   899 #  endif
   900 /* Need to cast, because on Haiku, the return type is
   901                                int.  */
   902 _GL_CXXALIAS_SYS_CAST (random, long, (void));
   903 # endif
   904 _GL_CXXALIASWARN (random);
   905 #elif defined GNULIB_POSIXCHECK
   906 # undef random
   907 # if HAVE_RAW_DECL_RANDOM
   908 _GL_WARN_ON_USE (random, "random is unportable - "
   909                  "use gnulib module random for portability");
   910 # endif
   911 #endif
   912 
   913 #if @GNULIB_RANDOM@
   914 # if @REPLACE_RANDOM@
   915 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
   916 #   undef srandom
   917 #   define srandom rpl_srandom
   918 #  endif
   919 _GL_FUNCDECL_RPL (srandom, void, (unsigned int seed));
   920 _GL_CXXALIAS_RPL (srandom, void, (unsigned int seed));
   921 # else
   922 #  if !@HAVE_RANDOM@
   923 _GL_FUNCDECL_SYS (srandom, void, (unsigned int seed));
   924 #  endif
   925 /* Need to cast, because on FreeBSD, the first parameter is
   926                                        unsigned long seed.  */
   927 _GL_CXXALIAS_SYS_CAST (srandom, void, (unsigned int seed));
   928 # endif
   929 _GL_CXXALIASWARN (srandom);
   930 #elif defined GNULIB_POSIXCHECK
   931 # undef srandom
   932 # if HAVE_RAW_DECL_SRANDOM
   933 _GL_WARN_ON_USE (srandom, "srandom is unportable - "
   934                  "use gnulib module random for portability");
   935 # endif
   936 #endif
   937 
   938 #if @GNULIB_RANDOM@
   939 # if @REPLACE_INITSTATE@
   940 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
   941 #   undef initstate
   942 #   define initstate rpl_initstate
   943 #  endif
   944 _GL_FUNCDECL_RPL (initstate, char *,
   945                   (unsigned int seed, char *buf, size_t buf_size)
   946                   _GL_ARG_NONNULL ((2)));
   947 _GL_CXXALIAS_RPL (initstate, char *,
   948                   (unsigned int seed, char *buf, size_t buf_size));
   949 # else
   950 #  if !@HAVE_INITSTATE@ || !@HAVE_DECL_INITSTATE@
   951 _GL_FUNCDECL_SYS (initstate, char *,
   952                   (unsigned int seed, char *buf, size_t buf_size)
   953                   _GL_ARG_NONNULL ((2)));
   954 #  endif
   955 /* Need to cast, because on FreeBSD, the first parameter is
   956                         unsigned long seed.  */
   957 _GL_CXXALIAS_SYS_CAST (initstate, char *,
   958                        (unsigned int seed, char *buf, size_t buf_size));
   959 # endif
   960 _GL_CXXALIASWARN (initstate);
   961 #elif defined GNULIB_POSIXCHECK
   962 # undef initstate
   963 # if HAVE_RAW_DECL_INITSTATE
   964 _GL_WARN_ON_USE (initstate, "initstate is unportable - "
   965                  "use gnulib module random for portability");
   966 # endif
   967 #endif
   968 
   969 #if @GNULIB_RANDOM@
   970 # if @REPLACE_SETSTATE@
   971 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
   972 #   undef setstate
   973 #   define setstate rpl_setstate
   974 #  endif
   975 _GL_FUNCDECL_RPL (setstate, char *, (char *arg_state) _GL_ARG_NONNULL ((1)));
   976 _GL_CXXALIAS_RPL (setstate, char *, (char *arg_state));
   977 # else
   978 #  if !@HAVE_SETSTATE@ || !@HAVE_DECL_SETSTATE@
   979 _GL_FUNCDECL_SYS (setstate, char *, (char *arg_state) _GL_ARG_NONNULL ((1)));
   980 #  endif
   981 /* Need to cast, because on Mac OS X 10.13, HP-UX, Solaris the first parameter
   982    is                                     const char *arg_state.  */
   983 _GL_CXXALIAS_SYS_CAST (setstate, char *, (char *arg_state));
   984 # endif
   985 _GL_CXXALIASWARN (setstate);
   986 #elif defined GNULIB_POSIXCHECK
   987 # undef setstate
   988 # if HAVE_RAW_DECL_SETSTATE
   989 _GL_WARN_ON_USE (setstate, "setstate is unportable - "
   990                  "use gnulib module random for portability");
   991 # endif
   992 #endif
   993 
   994 
   995 #if @GNULIB_RANDOM_R@
   996 # if @REPLACE_RANDOM_R@
   997 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
   998 #   undef random_r
   999 #   define random_r rpl_random_r
  1000 #  endif
  1001 _GL_FUNCDECL_RPL (random_r, int, (struct random_data *buf, int32_t *result)
  1002                                  _GL_ARG_NONNULL ((1, 2)));
  1003 _GL_CXXALIAS_RPL (random_r, int, (struct random_data *buf, int32_t *result));
  1004 # else
  1005 #  if !@HAVE_RANDOM_R@
  1006 _GL_FUNCDECL_SYS (random_r, int, (struct random_data *buf, int32_t *result)
  1007                                  _GL_ARG_NONNULL ((1, 2)));
  1008 #  endif
  1009 _GL_CXXALIAS_SYS (random_r, int, (struct random_data *buf, int32_t *result));
  1010 # endif
  1011 _GL_CXXALIASWARN (random_r);
  1012 #elif defined GNULIB_POSIXCHECK
  1013 # undef random_r
  1014 # if HAVE_RAW_DECL_RANDOM_R
  1015 _GL_WARN_ON_USE (random_r, "random_r is unportable - "
  1016                  "use gnulib module random_r for portability");
  1017 # endif
  1018 #endif
  1019 
  1020 #if @GNULIB_RANDOM_R@
  1021 # if @REPLACE_RANDOM_R@
  1022 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  1023 #   undef srandom_r
  1024 #   define srandom_r rpl_srandom_r
  1025 #  endif
  1026 _GL_FUNCDECL_RPL (srandom_r, int,
  1027                   (unsigned int seed, struct random_data *rand_state)
  1028                   _GL_ARG_NONNULL ((2)));
  1029 _GL_CXXALIAS_RPL (srandom_r, int,
  1030                   (unsigned int seed, struct random_data *rand_state));
  1031 # else
  1032 #  if !@HAVE_RANDOM_R@
  1033 _GL_FUNCDECL_SYS (srandom_r, int,
  1034                   (unsigned int seed, struct random_data *rand_state)
  1035                   _GL_ARG_NONNULL ((2)));
  1036 #  endif
  1037 _GL_CXXALIAS_SYS (srandom_r, int,
  1038                   (unsigned int seed, struct random_data *rand_state));
  1039 # endif
  1040 _GL_CXXALIASWARN (srandom_r);
  1041 #elif defined GNULIB_POSIXCHECK
  1042 # undef srandom_r
  1043 # if HAVE_RAW_DECL_SRANDOM_R
  1044 _GL_WARN_ON_USE (srandom_r, "srandom_r is unportable - "
  1045                  "use gnulib module random_r for portability");
  1046 # endif
  1047 #endif
  1048 
  1049 #if @GNULIB_RANDOM_R@
  1050 # if @REPLACE_RANDOM_R@
  1051 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  1052 #   undef initstate_r
  1053 #   define initstate_r rpl_initstate_r
  1054 #  endif
  1055 _GL_FUNCDECL_RPL (initstate_r, int,
  1056                   (unsigned int seed, char *buf, size_t buf_size,
  1057                    struct random_data *rand_state)
  1058                   _GL_ARG_NONNULL ((2, 4)));
  1059 _GL_CXXALIAS_RPL (initstate_r, int,
  1060                   (unsigned int seed, char *buf, size_t buf_size,
  1061                    struct random_data *rand_state));
  1062 # else
  1063 #  if !@HAVE_RANDOM_R@
  1064 _GL_FUNCDECL_SYS (initstate_r, int,
  1065                   (unsigned int seed, char *buf, size_t buf_size,
  1066                    struct random_data *rand_state)
  1067                   _GL_ARG_NONNULL ((2, 4)));
  1068 #  endif
  1069 /* Need to cast, because on Haiku, the third parameter is
  1070                                                      unsigned long buf_size.  */
  1071 _GL_CXXALIAS_SYS_CAST (initstate_r, int,
  1072                        (unsigned int seed, char *buf, size_t buf_size,
  1073                         struct random_data *rand_state));
  1074 # endif
  1075 _GL_CXXALIASWARN (initstate_r);
  1076 #elif defined GNULIB_POSIXCHECK
  1077 # undef initstate_r
  1078 # if HAVE_RAW_DECL_INITSTATE_R
  1079 _GL_WARN_ON_USE (initstate_r, "initstate_r is unportable - "
  1080                  "use gnulib module random_r for portability");
  1081 # endif
  1082 #endif
  1083 
  1084 #if @GNULIB_RANDOM_R@
  1085 # if @REPLACE_RANDOM_R@
  1086 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  1087 #   undef setstate_r
  1088 #   define setstate_r rpl_setstate_r
  1089 #  endif
  1090 _GL_FUNCDECL_RPL (setstate_r, int,
  1091                   (char *arg_state, struct random_data *rand_state)
  1092                   _GL_ARG_NONNULL ((1, 2)));
  1093 _GL_CXXALIAS_RPL (setstate_r, int,
  1094                   (char *arg_state, struct random_data *rand_state));
  1095 # else
  1096 #  if !@HAVE_RANDOM_R@
  1097 _GL_FUNCDECL_SYS (setstate_r, int,
  1098                   (char *arg_state, struct random_data *rand_state)
  1099                   _GL_ARG_NONNULL ((1, 2)));
  1100 #  endif
  1101 /* Need to cast, because on Haiku, the first parameter is
  1102                         void *arg_state.  */
  1103 _GL_CXXALIAS_SYS_CAST (setstate_r, int,
  1104                        (char *arg_state, struct random_data *rand_state));
  1105 # endif
  1106 _GL_CXXALIASWARN (setstate_r);
  1107 #elif defined GNULIB_POSIXCHECK
  1108 # undef setstate_r
  1109 # if HAVE_RAW_DECL_SETSTATE_R
  1110 _GL_WARN_ON_USE (setstate_r, "setstate_r is unportable - "
  1111                  "use gnulib module random_r for portability");
  1112 # endif
  1113 #endif
  1114 
  1115 
  1116 #if @GNULIB_REALLOC_POSIX@
  1117 # if (@GNULIB_REALLOC_POSIX@ && @REPLACE_REALLOC_FOR_REALLOC_POSIX@) \
  1118      || (@GNULIB_REALLOC_GNU@ && @REPLACE_REALLOC_FOR_REALLOC_GNU@)
  1119 #  if !((defined __cplusplus && defined GNULIB_NAMESPACE) \
  1120         || _GL_USE_STDLIB_ALLOC)
  1121 #   undef realloc
  1122 #   define realloc rpl_realloc
  1123 #  endif
  1124 _GL_FUNCDECL_RPL (realloc, void *, (void *ptr, size_t size)
  1125                                    _GL_ATTRIBUTE_DEALLOC_FREE);
  1126 _GL_CXXALIAS_RPL (realloc, void *, (void *ptr, size_t size));
  1127 # else
  1128 #  if __GNUC__ >= 11
  1129 /* For -Wmismatched-dealloc: Associate realloc with free or rpl_free.  */
  1130 _GL_FUNCDECL_SYS (realloc, void *, (void *ptr, size_t size)
  1131                                    _GL_ATTRIBUTE_DEALLOC_FREE);
  1132 #  endif
  1133 _GL_CXXALIAS_SYS (realloc, void *, (void *ptr, size_t size));
  1134 # endif
  1135 # if __GLIBC__ >= 2
  1136 _GL_CXXALIASWARN (realloc);
  1137 # endif
  1138 #else
  1139 # if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined realloc
  1140 /* For -Wmismatched-dealloc: Associate realloc with free or rpl_free.  */
  1141 _GL_FUNCDECL_SYS (realloc, void *, (void *ptr, size_t size)
  1142                                    _GL_ATTRIBUTE_DEALLOC_FREE);
  1143 # endif
  1144 # if defined GNULIB_POSIXCHECK && !_GL_USE_STDLIB_ALLOC
  1145 #  undef realloc
  1146 /* Assume realloc is always declared.  */
  1147 _GL_WARN_ON_USE (realloc, "realloc is not POSIX compliant everywhere - "
  1148                  "use gnulib module realloc-posix for portability");
  1149 # endif
  1150 #endif
  1151 
  1152 
  1153 #if @GNULIB_REALLOCARRAY@
  1154 # if @REPLACE_REALLOCARRAY@
  1155 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  1156 #   undef reallocarray
  1157 #   define reallocarray rpl_reallocarray
  1158 #  endif
  1159 _GL_FUNCDECL_RPL (reallocarray, void *,
  1160                   (void *ptr, size_t nmemb, size_t size));
  1161 _GL_CXXALIAS_RPL (reallocarray, void *,
  1162                   (void *ptr, size_t nmemb, size_t size));
  1163 # else
  1164 #  if ! @HAVE_REALLOCARRAY@
  1165 _GL_FUNCDECL_SYS (reallocarray, void *,
  1166                   (void *ptr, size_t nmemb, size_t size));
  1167 #  endif
  1168 _GL_CXXALIAS_SYS (reallocarray, void *,
  1169                   (void *ptr, size_t nmemb, size_t size));
  1170 # endif
  1171 _GL_CXXALIASWARN (reallocarray);
  1172 #elif defined GNULIB_POSIXCHECK
  1173 # undef reallocarray
  1174 # if HAVE_RAW_DECL_REALLOCARRAY
  1175 _GL_WARN_ON_USE (reallocarray, "reallocarray is not portable - "
  1176                  "use gnulib module reallocarray for portability");
  1177 # endif
  1178 #endif
  1179 
  1180 #if @GNULIB_REALPATH@
  1181 # if @REPLACE_REALPATH@
  1182 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  1183 #   define realpath rpl_realpath
  1184 #  endif
  1185 _GL_FUNCDECL_RPL (realpath, char *,
  1186                   (const char *restrict name, char *restrict resolved)
  1187                   _GL_ARG_NONNULL ((1)));
  1188 _GL_CXXALIAS_RPL (realpath, char *,
  1189                   (const char *restrict name, char *restrict resolved));
  1190 # else
  1191 #  if !@HAVE_REALPATH@
  1192 _GL_FUNCDECL_SYS (realpath, char *,
  1193                   (const char *restrict name, char *restrict resolved)
  1194                   _GL_ARG_NONNULL ((1)));
  1195 #  endif
  1196 _GL_CXXALIAS_SYS (realpath, char *,
  1197                   (const char *restrict name, char *restrict resolved));
  1198 # endif
  1199 _GL_CXXALIASWARN (realpath);
  1200 #elif defined GNULIB_POSIXCHECK
  1201 # undef realpath
  1202 # if HAVE_RAW_DECL_REALPATH
  1203 _GL_WARN_ON_USE (realpath, "realpath is unportable - use gnulib module "
  1204                  "canonicalize or canonicalize-lgpl for portability");
  1205 # endif
  1206 #endif
  1207 
  1208 #if @GNULIB_RPMATCH@
  1209 /* Test a user response to a question.
  1210    Return 1 if it is affirmative, 0 if it is negative, or -1 if not clear.  */
  1211 # if !@HAVE_RPMATCH@
  1212 _GL_FUNCDECL_SYS (rpmatch, int, (const char *response) _GL_ARG_NONNULL ((1)));
  1213 # endif
  1214 _GL_CXXALIAS_SYS (rpmatch, int, (const char *response));
  1215 _GL_CXXALIASWARN (rpmatch);
  1216 #elif defined GNULIB_POSIXCHECK
  1217 # undef rpmatch
  1218 # if HAVE_RAW_DECL_RPMATCH
  1219 _GL_WARN_ON_USE (rpmatch, "rpmatch is unportable - "
  1220                  "use gnulib module rpmatch for portability");
  1221 # endif
  1222 #endif
  1223 
  1224 #if @GNULIB_SECURE_GETENV@
  1225 /* Look up NAME in the environment, returning 0 in insecure situations.  */
  1226 # if !@HAVE_SECURE_GETENV@
  1227 _GL_FUNCDECL_SYS (secure_getenv, char *,
  1228                   (char const *name) _GL_ARG_NONNULL ((1)));
  1229 # endif
  1230 _GL_CXXALIAS_SYS (secure_getenv, char *, (char const *name));
  1231 _GL_CXXALIASWARN (secure_getenv);
  1232 #elif defined GNULIB_POSIXCHECK
  1233 # undef secure_getenv
  1234 # if HAVE_RAW_DECL_SECURE_GETENV
  1235 _GL_WARN_ON_USE (secure_getenv, "secure_getenv is unportable - "
  1236                  "use gnulib module secure_getenv for portability");
  1237 # endif
  1238 #endif
  1239 
  1240 #if @GNULIB_SETENV@
  1241 /* Set NAME to VALUE in the environment.
  1242    If REPLACE is nonzero, overwrite an existing value.  */
  1243 # if @REPLACE_SETENV@
  1244 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  1245 #   undef setenv
  1246 #   define setenv rpl_setenv
  1247 #  endif
  1248 _GL_FUNCDECL_RPL (setenv, int,
  1249                   (const char *name, const char *value, int replace)
  1250                   _GL_ARG_NONNULL ((1)));
  1251 _GL_CXXALIAS_RPL (setenv, int,
  1252                   (const char *name, const char *value, int replace));
  1253 # else
  1254 #  if !@HAVE_DECL_SETENV@
  1255 _GL_FUNCDECL_SYS (setenv, int,
  1256                   (const char *name, const char *value, int replace)
  1257                   _GL_ARG_NONNULL ((1)));
  1258 #  endif
  1259 _GL_CXXALIAS_SYS (setenv, int,
  1260                   (const char *name, const char *value, int replace));
  1261 # endif
  1262 # if !(@REPLACE_SETENV@ && !@HAVE_DECL_SETENV@)
  1263 _GL_CXXALIASWARN (setenv);
  1264 # endif
  1265 #elif defined GNULIB_POSIXCHECK
  1266 # undef setenv
  1267 # if HAVE_RAW_DECL_SETENV
  1268 _GL_WARN_ON_USE (setenv, "setenv is unportable - "
  1269                  "use gnulib module setenv for portability");
  1270 # endif
  1271 #endif
  1272 
  1273 #if @GNULIB_STRTOD@
  1274  /* Parse a double from STRING, updating ENDP if appropriate.  */
  1275 # if @REPLACE_STRTOD@
  1276 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  1277 #   define strtod rpl_strtod
  1278 #  endif
  1279 #  define GNULIB_defined_strtod_function 1
  1280 _GL_FUNCDECL_RPL (strtod, double,
  1281                   (const char *restrict str, char **restrict endp)
  1282                   _GL_ARG_NONNULL ((1)));
  1283 _GL_CXXALIAS_RPL (strtod, double,
  1284                   (const char *restrict str, char **restrict endp));
  1285 # else
  1286 #  if !@HAVE_STRTOD@
  1287 _GL_FUNCDECL_SYS (strtod, double,
  1288                   (const char *restrict str, char **restrict endp)
  1289                   _GL_ARG_NONNULL ((1)));
  1290 #  endif
  1291 _GL_CXXALIAS_SYS (strtod, double,
  1292                   (const char *restrict str, char **restrict endp));
  1293 # endif
  1294 # if __GLIBC__ >= 2
  1295 _GL_CXXALIASWARN (strtod);
  1296 # endif
  1297 #elif defined GNULIB_POSIXCHECK
  1298 # undef strtod
  1299 # if HAVE_RAW_DECL_STRTOD
  1300 _GL_WARN_ON_USE (strtod, "strtod is unportable - "
  1301                  "use gnulib module strtod for portability");
  1302 # endif
  1303 #endif
  1304 
  1305 #if @GNULIB_STRTOLD@
  1306  /* Parse a 'long double' from STRING, updating ENDP if appropriate.  */
  1307 # if @REPLACE_STRTOLD@
  1308 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  1309 #   define strtold rpl_strtold
  1310 #  endif
  1311 #  define GNULIB_defined_strtold_function 1
  1312 _GL_FUNCDECL_RPL (strtold, long double,
  1313                   (const char *restrict str, char **restrict endp)
  1314                   _GL_ARG_NONNULL ((1)));
  1315 _GL_CXXALIAS_RPL (strtold, long double,
  1316                   (const char *restrict str, char **restrict endp));
  1317 # else
  1318 #  if !@HAVE_STRTOLD@
  1319 _GL_FUNCDECL_SYS (strtold, long double,
  1320                   (const char *restrict str, char **restrict endp)
  1321                   _GL_ARG_NONNULL ((1)));
  1322 #  endif
  1323 _GL_CXXALIAS_SYS (strtold, long double,
  1324                   (const char *restrict str, char **restrict endp));
  1325 # endif
  1326 _GL_CXXALIASWARN (strtold);
  1327 #elif defined GNULIB_POSIXCHECK
  1328 # undef strtold
  1329 # if HAVE_RAW_DECL_STRTOLD
  1330 _GL_WARN_ON_USE (strtold, "strtold is unportable - "
  1331                  "use gnulib module strtold for portability");
  1332 # endif
  1333 #endif
  1334 
  1335 #if @GNULIB_STRTOL@
  1336 /* Parse a signed integer whose textual representation starts at STRING.
  1337    The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0,
  1338    it may be decimal or octal (with prefix "0") or hexadecimal (with prefix
  1339    "0x").
  1340    If ENDPTR is not NULL, the address of the first byte after the integer is
  1341    stored in *ENDPTR.
  1342    Upon overflow, the return value is LONG_MAX or LONG_MIN, and errno is set
  1343    to ERANGE.  */
  1344 # if @REPLACE_STRTOL@
  1345 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  1346 #   define strtol rpl_strtol
  1347 #  endif
  1348 #  define GNULIB_defined_strtol_function 1
  1349 _GL_FUNCDECL_RPL (strtol, long,
  1350                   (const char *restrict string, char **restrict endptr,
  1351                    int base)
  1352                   _GL_ARG_NONNULL ((1)));
  1353 _GL_CXXALIAS_RPL (strtol, long,
  1354                   (const char *restrict string, char **restrict endptr,
  1355                    int base));
  1356 # else
  1357 #  if !@HAVE_STRTOL@
  1358 _GL_FUNCDECL_SYS (strtol, long,
  1359                   (const char *restrict string, char **restrict endptr,
  1360                    int base)
  1361                   _GL_ARG_NONNULL ((1)));
  1362 #  endif
  1363 _GL_CXXALIAS_SYS (strtol, long,
  1364                   (const char *restrict string, char **restrict endptr,
  1365                    int base));
  1366 # endif
  1367 # if __GLIBC__ >= 2
  1368 _GL_CXXALIASWARN (strtol);
  1369 # endif
  1370 #elif defined GNULIB_POSIXCHECK
  1371 # undef strtol
  1372 # if HAVE_RAW_DECL_STRTOL
  1373 _GL_WARN_ON_USE (strtol, "strtol is unportable - "
  1374                  "use gnulib module strtol for portability");
  1375 # endif
  1376 #endif
  1377 
  1378 #if @GNULIB_STRTOLL@
  1379 /* Parse a signed integer whose textual representation starts at STRING.
  1380    The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0,
  1381    it may be decimal or octal (with prefix "0") or hexadecimal (with prefix
  1382    "0x").
  1383    If ENDPTR is not NULL, the address of the first byte after the integer is
  1384    stored in *ENDPTR.
  1385    Upon overflow, the return value is LLONG_MAX or LLONG_MIN, and errno is set
  1386    to ERANGE.  */
  1387 # if @REPLACE_STRTOLL@
  1388 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  1389 #   define strtoll rpl_strtoll
  1390 #  endif
  1391 #  define GNULIB_defined_strtoll_function 1
  1392 _GL_FUNCDECL_RPL (strtoll, long long,
  1393                   (const char *restrict string, char **restrict endptr,
  1394                    int base)
  1395                   _GL_ARG_NONNULL ((1)));
  1396 _GL_CXXALIAS_RPL (strtoll, long long,
  1397                   (const char *restrict string, char **restrict endptr,
  1398                    int base));
  1399 # else
  1400 #  if !@HAVE_STRTOLL@
  1401 _GL_FUNCDECL_SYS (strtoll, long long,
  1402                   (const char *restrict string, char **restrict endptr,
  1403                    int base)
  1404                   _GL_ARG_NONNULL ((1)));
  1405 #  endif
  1406 _GL_CXXALIAS_SYS (strtoll, long long,
  1407                   (const char *restrict string, char **restrict endptr,
  1408                    int base));
  1409 # endif
  1410 _GL_CXXALIASWARN (strtoll);
  1411 #elif defined GNULIB_POSIXCHECK
  1412 # undef strtoll
  1413 # if HAVE_RAW_DECL_STRTOLL
  1414 _GL_WARN_ON_USE (strtoll, "strtoll is unportable - "
  1415                  "use gnulib module strtoll for portability");
  1416 # endif
  1417 #endif
  1418 
  1419 #if @GNULIB_STRTOUL@
  1420 /* Parse an unsigned integer whose textual representation starts at STRING.
  1421    The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0,
  1422    it may be decimal or octal (with prefix "0") or hexadecimal (with prefix
  1423    "0x").
  1424    If ENDPTR is not NULL, the address of the first byte after the integer is
  1425    stored in *ENDPTR.
  1426    Upon overflow, the return value is ULONG_MAX, and errno is set to ERANGE.  */
  1427 # if @REPLACE_STRTOUL@
  1428 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  1429 #   define strtoul rpl_strtoul
  1430 #  endif
  1431 #  define GNULIB_defined_strtoul_function 1
  1432 _GL_FUNCDECL_RPL (strtoul, unsigned long,
  1433                   (const char *restrict string, char **restrict endptr,
  1434                    int base)
  1435                   _GL_ARG_NONNULL ((1)));
  1436 _GL_CXXALIAS_RPL (strtoul, unsigned long,
  1437                   (const char *restrict string, char **restrict endptr,
  1438                    int base));
  1439 # else
  1440 #  if !@HAVE_STRTOUL@
  1441 _GL_FUNCDECL_SYS (strtoul, unsigned long,
  1442                   (const char *restrict string, char **restrict endptr,
  1443                    int base)
  1444                   _GL_ARG_NONNULL ((1)));
  1445 #  endif
  1446 _GL_CXXALIAS_SYS (strtoul, unsigned long,
  1447                   (const char *restrict string, char **restrict endptr,
  1448                    int base));
  1449 # endif
  1450 # if __GLIBC__ >= 2
  1451 _GL_CXXALIASWARN (strtoul);
  1452 # endif
  1453 #elif defined GNULIB_POSIXCHECK
  1454 # undef strtoul
  1455 # if HAVE_RAW_DECL_STRTOUL
  1456 _GL_WARN_ON_USE (strtoul, "strtoul is unportable - "
  1457                  "use gnulib module strtoul for portability");
  1458 # endif
  1459 #endif
  1460 
  1461 #if @GNULIB_STRTOULL@
  1462 /* Parse an unsigned integer whose textual representation starts at STRING.
  1463    The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0,
  1464    it may be decimal or octal (with prefix "0") or hexadecimal (with prefix
  1465    "0x").
  1466    If ENDPTR is not NULL, the address of the first byte after the integer is
  1467    stored in *ENDPTR.
  1468    Upon overflow, the return value is ULLONG_MAX, and errno is set to
  1469    ERANGE.  */
  1470 # if @REPLACE_STRTOULL@
  1471 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  1472 #   define strtoull rpl_strtoull
  1473 #  endif
  1474 #  define GNULIB_defined_strtoull_function 1
  1475 _GL_FUNCDECL_RPL (strtoull, unsigned long long,
  1476                   (const char *restrict string, char **restrict endptr,
  1477                    int base)
  1478                   _GL_ARG_NONNULL ((1)));
  1479 _GL_CXXALIAS_RPL (strtoull, unsigned long long,
  1480                   (const char *restrict string, char **restrict endptr,
  1481                    int base));
  1482 # else
  1483 #  if !@HAVE_STRTOULL@
  1484 _GL_FUNCDECL_SYS (strtoull, unsigned long long,
  1485                   (const char *restrict string, char **restrict endptr,
  1486                    int base)
  1487                   _GL_ARG_NONNULL ((1)));
  1488 #  endif
  1489 _GL_CXXALIAS_SYS (strtoull, unsigned long long,
  1490                   (const char *restrict string, char **restrict endptr,
  1491                    int base));
  1492 # endif
  1493 _GL_CXXALIASWARN (strtoull);
  1494 #elif defined GNULIB_POSIXCHECK
  1495 # undef strtoull
  1496 # if HAVE_RAW_DECL_STRTOULL
  1497 _GL_WARN_ON_USE (strtoull, "strtoull is unportable - "
  1498                  "use gnulib module strtoull for portability");
  1499 # endif
  1500 #endif
  1501 
  1502 #if @GNULIB_UNLOCKPT@
  1503 /* Unlock the slave side of the pseudo-terminal whose master side is specified
  1504    by FD, so that it can be opened.  */
  1505 # if !@HAVE_UNLOCKPT@
  1506 _GL_FUNCDECL_SYS (unlockpt, int, (int fd));
  1507 # endif
  1508 _GL_CXXALIAS_SYS (unlockpt, int, (int fd));
  1509 _GL_CXXALIASWARN (unlockpt);
  1510 #elif defined GNULIB_POSIXCHECK
  1511 # undef unlockpt
  1512 # if HAVE_RAW_DECL_UNLOCKPT
  1513 _GL_WARN_ON_USE (unlockpt, "unlockpt is not portable - "
  1514                  "use gnulib module unlockpt for portability");
  1515 # endif
  1516 #endif
  1517 
  1518 #if @GNULIB_UNSETENV@
  1519 /* Remove the variable NAME from the environment.  */
  1520 # if @REPLACE_UNSETENV@
  1521 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  1522 #   undef unsetenv
  1523 #   define unsetenv rpl_unsetenv
  1524 #  endif
  1525 _GL_FUNCDECL_RPL (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1)));
  1526 _GL_CXXALIAS_RPL (unsetenv, int, (const char *name));
  1527 # else
  1528 #  if !@HAVE_DECL_UNSETENV@
  1529 _GL_FUNCDECL_SYS (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1)));
  1530 #  endif
  1531 _GL_CXXALIAS_SYS (unsetenv, int, (const char *name));
  1532 # endif
  1533 # if !(@REPLACE_UNSETENV@ && !@HAVE_DECL_UNSETENV@)
  1534 _GL_CXXALIASWARN (unsetenv);
  1535 # endif
  1536 #elif defined GNULIB_POSIXCHECK
  1537 # undef unsetenv
  1538 # if HAVE_RAW_DECL_UNSETENV
  1539 _GL_WARN_ON_USE (unsetenv, "unsetenv is unportable - "
  1540                  "use gnulib module unsetenv for portability");
  1541 # endif
  1542 #endif
  1543 
  1544 /* Convert a wide character to a multibyte character.  */
  1545 #if @GNULIB_WCTOMB@
  1546 # if @REPLACE_WCTOMB@
  1547 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  1548 #   undef wctomb
  1549 #   define wctomb rpl_wctomb
  1550 #  endif
  1551 _GL_FUNCDECL_RPL (wctomb, int, (char *s, wchar_t wc));
  1552 _GL_CXXALIAS_RPL (wctomb, int, (char *s, wchar_t wc));
  1553 # else
  1554 _GL_CXXALIAS_SYS (wctomb, int, (char *s, wchar_t wc));
  1555 # endif
  1556 # if __GLIBC__ >= 2
  1557 _GL_CXXALIASWARN (wctomb);
  1558 # endif
  1559 #endif
  1560 
  1561 
  1562 #endif /* _@GUARD_PREFIX@_STDLIB_H */
  1563 #endif /* _@GUARD_PREFIX@_STDLIB_H */
  1564 #endif

/* [<][>][^][v][top][bottom][index][help] */