root/lib/stdlib.in.h

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

DEFINITIONS

This source file includes following definitions.
  1. gl_MB_CUR_MAX

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

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