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