Blame gl/stdlib.in.h

Packit a4aae4
/* A GNU-like <stdlib.h>.
Packit a4aae4
Packit a4aae4
   Copyright (C) 1995, 2001-2004, 2006-2017 Free Software Foundation, Inc.
Packit a4aae4
Packit a4aae4
   This program is free software: you can redistribute it and/or modify
Packit a4aae4
   it under the terms of the GNU Lesser General Public License as published by
Packit a4aae4
   the Free Software Foundation; either version 3 of the License, or
Packit a4aae4
   (at your option) any later version.
Packit a4aae4
Packit a4aae4
   This program is distributed in the hope that it will be useful,
Packit a4aae4
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit a4aae4
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit a4aae4
   GNU Lesser General Public License for more details.
Packit a4aae4
Packit a4aae4
   You should have received a copy of the GNU Lesser General Public License
Packit a4aae4
   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
Packit a4aae4
Packit a4aae4
#if __GNUC__ >= 3
Packit a4aae4
@PRAGMA_SYSTEM_HEADER@
Packit a4aae4
#endif
Packit a4aae4
@PRAGMA_COLUMNS@
Packit a4aae4
Packit a4aae4
#if defined __need_system_stdlib_h || defined __need_malloc_and_calloc
Packit a4aae4
/* Special invocation conventions inside some gnulib header files,
Packit a4aae4
   and inside some glibc header files, respectively.  */
Packit a4aae4
Packit a4aae4
#@INCLUDE_NEXT@ @NEXT_STDLIB_H@
Packit a4aae4
Packit a4aae4
#else
Packit a4aae4
/* Normal invocation convention.  */
Packit a4aae4
Packit a4aae4
#ifndef _@GUARD_PREFIX@_STDLIB_H
Packit a4aae4
Packit a4aae4
/* The include_next requires a split double-inclusion guard.  */
Packit a4aae4
#@INCLUDE_NEXT@ @NEXT_STDLIB_H@
Packit a4aae4
Packit a4aae4
#ifndef _@GUARD_PREFIX@_STDLIB_H
Packit a4aae4
#define _@GUARD_PREFIX@_STDLIB_H
Packit a4aae4
Packit a4aae4
/* NetBSD 5.0 mis-defines NULL.  */
Packit a4aae4
#include <stddef.h>
Packit a4aae4
Packit a4aae4
/* MirBSD 10 defines WEXITSTATUS in <sys/wait.h>, not in <stdlib.h>.  */
Packit a4aae4
#if @GNULIB_SYSTEM_POSIX@ && !defined WEXITSTATUS
Packit a4aae4
# include <sys/wait.h>
Packit a4aae4
#endif
Packit a4aae4
Packit a4aae4
/* Solaris declares getloadavg() in <sys/loadavg.h>.  */
Packit a4aae4
#if (@GNULIB_GETLOADAVG@ || defined GNULIB_POSIXCHECK) && @HAVE_SYS_LOADAVG_H@
Packit a4aae4
# include <sys/loadavg.h>
Packit a4aae4
#endif
Packit a4aae4
Packit a4aae4
/* Native Windows platforms declare mktemp() in <io.h>.  */
Packit a4aae4
#if 0 && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
Packit a4aae4
# include <io.h>
Packit a4aae4
#endif
Packit a4aae4
Packit a4aae4
#if @GNULIB_RANDOM_R@
Packit a4aae4
Packit a4aae4
/* OSF/1 5.1 declares 'struct random_data' in <random.h>, which is included
Packit a4aae4
   from <stdlib.h> if _REENTRANT is defined.  Include it whenever we need
Packit a4aae4
   'struct random_data'.  */
Packit a4aae4
# if @HAVE_RANDOM_H@
Packit a4aae4
#  include <random.h>
Packit a4aae4
# endif
Packit a4aae4
Packit a4aae4
# if !@HAVE_STRUCT_RANDOM_DATA@ || @REPLACE_RANDOM_R@ || !@HAVE_RANDOM_R@
Packit a4aae4
#  include <stdint.h>
Packit a4aae4
# endif
Packit a4aae4
Packit a4aae4
# if !@HAVE_STRUCT_RANDOM_DATA@
Packit a4aae4
/* Define 'struct random_data'.
Packit a4aae4
   But allow multiple gnulib generated <stdlib.h> replacements to coexist.  */
Packit a4aae4
#  if !GNULIB_defined_struct_random_data
Packit a4aae4
struct random_data
Packit a4aae4
{
Packit a4aae4
  int32_t *fptr;                /* Front pointer.  */
Packit a4aae4
  int32_t *rptr;                /* Rear pointer.  */
Packit a4aae4
  int32_t *state;               /* Array of state values.  */
Packit a4aae4
  int rand_type;                /* Type of random number generator.  */
Packit a4aae4
  int rand_deg;                 /* Degree of random number generator.  */
Packit a4aae4
  int rand_sep;                 /* Distance between front and rear.  */
Packit a4aae4
  int32_t *end_ptr;             /* Pointer behind state table.  */
Packit a4aae4
};
Packit a4aae4
#   define GNULIB_defined_struct_random_data 1
Packit a4aae4
#  endif
Packit a4aae4
# endif
Packit a4aae4
#endif
Packit a4aae4
Packit a4aae4
#if (@GNULIB_MKSTEMP@ || @GNULIB_MKSTEMPS@ || @GNULIB_GETSUBOPT@ || defined GNULIB_POSIXCHECK) && ! defined __GLIBC__ && !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
Packit a4aae4
/* On Mac OS X 10.3, only <unistd.h> declares mkstemp.  */
Packit a4aae4
/* On Mac OS X 10.5, only <unistd.h> declares mkstemps.  */
Packit a4aae4
/* On Cygwin 1.7.1, only <unistd.h> declares getsubopt.  */
Packit a4aae4
/* But avoid namespace pollution on glibc systems and native Windows.  */
Packit a4aae4
# include <unistd.h>
Packit a4aae4
#endif
Packit a4aae4
Packit a4aae4
/* The __attribute__ feature is available in gcc versions 2.5 and later.
Packit a4aae4
   The attribute __pure__ was added in gcc 2.96.  */
Packit a4aae4
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
Packit a4aae4
# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
Packit a4aae4
#else
Packit a4aae4
# define _GL_ATTRIBUTE_PURE /* empty */
Packit a4aae4
#endif
Packit a4aae4
Packit a4aae4
/* The definition of _Noreturn is copied here.  */
Packit a4aae4
Packit a4aae4
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
Packit a4aae4
Packit a4aae4
/* The definition of _GL_ARG_NONNULL is copied here.  */
Packit a4aae4
Packit a4aae4
/* The definition of _GL_WARN_ON_USE is copied here.  */
Packit a4aae4
Packit a4aae4
Packit a4aae4
/* Some systems do not define EXIT_*, despite otherwise supporting C89.  */
Packit a4aae4
#ifndef EXIT_SUCCESS
Packit a4aae4
# define EXIT_SUCCESS 0
Packit a4aae4
#endif
Packit a4aae4
/* Tandem/NSK and other platforms that define EXIT_FAILURE as -1 interfere
Packit a4aae4
   with proper operation of xargs.  */
Packit a4aae4
#ifndef EXIT_FAILURE
Packit a4aae4
# define EXIT_FAILURE 1
Packit a4aae4
#elif EXIT_FAILURE != 1
Packit a4aae4
# undef EXIT_FAILURE
Packit a4aae4
# define EXIT_FAILURE 1
Packit a4aae4
#endif
Packit a4aae4
Packit a4aae4
Packit a4aae4
#if @GNULIB__EXIT@
Packit a4aae4
/* Terminate the current process with the given return code, without running
Packit a4aae4
   the 'atexit' handlers.  */
Packit a4aae4
# if !@HAVE__EXIT@
Packit a4aae4
_GL_FUNCDECL_SYS (_Exit, _Noreturn void, (int status));
Packit a4aae4
# endif
Packit a4aae4
_GL_CXXALIAS_SYS (_Exit, void, (int status));
Packit a4aae4
_GL_CXXALIASWARN (_Exit);
Packit a4aae4
#elif defined GNULIB_POSIXCHECK
Packit a4aae4
# undef _Exit
Packit a4aae4
# if HAVE_RAW_DECL__EXIT
Packit a4aae4
_GL_WARN_ON_USE (_Exit, "_Exit is unportable - "
Packit a4aae4
                 "use gnulib module _Exit for portability");
Packit a4aae4
# endif
Packit a4aae4
#endif
Packit a4aae4
Packit a4aae4
Packit a4aae4
#if @GNULIB_ATOLL@
Packit a4aae4
/* Parse a signed decimal integer.
Packit a4aae4
   Returns the value of the integer.  Errors are not detected.  */
Packit a4aae4
# if !@HAVE_ATOLL@
Packit a4aae4
_GL_FUNCDECL_SYS (atoll, long long, (const char *string)
Packit a4aae4
                                    _GL_ATTRIBUTE_PURE
Packit a4aae4
                                    _GL_ARG_NONNULL ((1)));
Packit a4aae4
# endif
Packit a4aae4
_GL_CXXALIAS_SYS (atoll, long long, (const char *string));
Packit a4aae4
_GL_CXXALIASWARN (atoll);
Packit a4aae4
#elif defined GNULIB_POSIXCHECK
Packit a4aae4
# undef atoll
Packit a4aae4
# if HAVE_RAW_DECL_ATOLL
Packit a4aae4
_GL_WARN_ON_USE (atoll, "atoll is unportable - "
Packit a4aae4
                 "use gnulib module atoll for portability");
Packit a4aae4
# endif
Packit a4aae4
#endif
Packit a4aae4
Packit a4aae4
#if @GNULIB_CALLOC_POSIX@
Packit a4aae4
# if @REPLACE_CALLOC@
Packit a4aae4
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit a4aae4
#   undef calloc
Packit a4aae4
#   define calloc rpl_calloc
Packit a4aae4
#  endif
Packit a4aae4
_GL_FUNCDECL_RPL (calloc, void *, (size_t nmemb, size_t size));
Packit a4aae4
_GL_CXXALIAS_RPL (calloc, void *, (size_t nmemb, size_t size));
Packit a4aae4
# else
Packit a4aae4
_GL_CXXALIAS_SYS (calloc, void *, (size_t nmemb, size_t size));
Packit a4aae4
# endif
Packit a4aae4
_GL_CXXALIASWARN (calloc);
Packit a4aae4
#elif defined GNULIB_POSIXCHECK
Packit a4aae4
# undef calloc
Packit a4aae4
/* Assume calloc is always declared.  */
Packit a4aae4
_GL_WARN_ON_USE (calloc, "calloc is not POSIX compliant everywhere - "
Packit a4aae4
                 "use gnulib module calloc-posix for portability");
Packit a4aae4
#endif
Packit a4aae4
Packit a4aae4
#if @GNULIB_CANONICALIZE_FILE_NAME@
Packit a4aae4
# if @REPLACE_CANONICALIZE_FILE_NAME@
Packit a4aae4
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit a4aae4
#   define canonicalize_file_name rpl_canonicalize_file_name
Packit a4aae4
#  endif
Packit a4aae4
_GL_FUNCDECL_RPL (canonicalize_file_name, char *, (const char *name)
Packit a4aae4
                                                  _GL_ARG_NONNULL ((1)));
Packit a4aae4
_GL_CXXALIAS_RPL (canonicalize_file_name, char *, (const char *name));
Packit a4aae4
# else
Packit a4aae4
#  if !@HAVE_CANONICALIZE_FILE_NAME@
Packit a4aae4
_GL_FUNCDECL_SYS (canonicalize_file_name, char *, (const char *name)
Packit a4aae4
                                                  _GL_ARG_NONNULL ((1)));
Packit a4aae4
#  endif
Packit a4aae4
_GL_CXXALIAS_SYS (canonicalize_file_name, char *, (const char *name));
Packit a4aae4
# endif
Packit a4aae4
_GL_CXXALIASWARN (canonicalize_file_name);
Packit a4aae4
#elif defined GNULIB_POSIXCHECK
Packit a4aae4
# undef canonicalize_file_name
Packit a4aae4
# if HAVE_RAW_DECL_CANONICALIZE_FILE_NAME
Packit a4aae4
_GL_WARN_ON_USE (canonicalize_file_name,
Packit a4aae4
                 "canonicalize_file_name is unportable - "
Packit a4aae4
                 "use gnulib module canonicalize-lgpl for portability");
Packit a4aae4
# endif
Packit a4aae4
#endif
Packit a4aae4
Packit a4aae4
#if @GNULIB_GETLOADAVG@
Packit a4aae4
/* Store max(NELEM,3) load average numbers in LOADAVG[].
Packit a4aae4
   The three numbers are the load average of the last 1 minute, the last 5
Packit a4aae4
   minutes, and the last 15 minutes, respectively.
Packit a4aae4
   LOADAVG is an array of NELEM numbers.  */
Packit a4aae4
# if !@HAVE_DECL_GETLOADAVG@
Packit a4aae4
_GL_FUNCDECL_SYS (getloadavg, int, (double loadavg[], int nelem)
Packit a4aae4
                                   _GL_ARG_NONNULL ((1)));
Packit a4aae4
# endif
Packit a4aae4
_GL_CXXALIAS_SYS (getloadavg, int, (double loadavg[], int nelem));
Packit a4aae4
_GL_CXXALIASWARN (getloadavg);
Packit a4aae4
#elif defined GNULIB_POSIXCHECK
Packit a4aae4
# undef getloadavg
Packit a4aae4
# if HAVE_RAW_DECL_GETLOADAVG
Packit a4aae4
_GL_WARN_ON_USE (getloadavg, "getloadavg is not portable - "
Packit a4aae4
                 "use gnulib module getloadavg for portability");
Packit a4aae4
# endif
Packit a4aae4
#endif
Packit a4aae4
Packit a4aae4
#if @GNULIB_GETSUBOPT@
Packit a4aae4
/* Assuming *OPTIONP is a comma separated list of elements of the form
Packit a4aae4
   "token" or "token=value", getsubopt parses the first of these elements.
Packit a4aae4
   If the first element refers to a "token" that is member of the given
Packit a4aae4
   NULL-terminated array of tokens:
Packit a4aae4
     - It replaces the comma with a NUL byte, updates *OPTIONP to point past
Packit a4aae4
       the first option and the comma, sets *VALUEP to the value of the
Packit a4aae4
       element (or NULL if it doesn't contain an "=" sign),
Packit a4aae4
     - It returns the index of the "token" in the given array of tokens.
Packit a4aae4
   Otherwise it returns -1, and *OPTIONP and *VALUEP are undefined.
Packit a4aae4
   For more details see the POSIX:2001 specification.
Packit a4aae4
   http://www.opengroup.org/susv3xsh/getsubopt.html */
Packit a4aae4
# if !@HAVE_GETSUBOPT@
Packit a4aae4
_GL_FUNCDECL_SYS (getsubopt, int,
Packit a4aae4
                  (char **optionp, char *const *tokens, char **valuep)
Packit a4aae4
                  _GL_ARG_NONNULL ((1, 2, 3)));
Packit a4aae4
# endif
Packit a4aae4
_GL_CXXALIAS_SYS (getsubopt, int,
Packit a4aae4
                  (char **optionp, char *const *tokens, char **valuep));
Packit a4aae4
_GL_CXXALIASWARN (getsubopt);
Packit a4aae4
#elif defined GNULIB_POSIXCHECK
Packit a4aae4
# undef getsubopt
Packit a4aae4
# if HAVE_RAW_DECL_GETSUBOPT
Packit a4aae4
_GL_WARN_ON_USE (getsubopt, "getsubopt is unportable - "
Packit a4aae4
                 "use gnulib module getsubopt for portability");
Packit a4aae4
# endif
Packit a4aae4
#endif
Packit a4aae4
Packit a4aae4
#if @GNULIB_GRANTPT@
Packit a4aae4
/* Change the ownership and access permission of the slave side of the
Packit a4aae4
   pseudo-terminal whose master side is specified by FD.  */
Packit a4aae4
# if !@HAVE_GRANTPT@
Packit a4aae4
_GL_FUNCDECL_SYS (grantpt, int, (int fd));
Packit a4aae4
# endif
Packit a4aae4
_GL_CXXALIAS_SYS (grantpt, int, (int fd));
Packit a4aae4
_GL_CXXALIASWARN (grantpt);
Packit a4aae4
#elif defined GNULIB_POSIXCHECK
Packit a4aae4
# undef grantpt
Packit a4aae4
# if HAVE_RAW_DECL_GRANTPT
Packit a4aae4
_GL_WARN_ON_USE (grantpt, "grantpt is not portable - "
Packit a4aae4
                 "use gnulib module grantpt for portability");
Packit a4aae4
# endif
Packit a4aae4
#endif
Packit a4aae4
Packit a4aae4
/* If _GL_USE_STDLIB_ALLOC is nonzero, the including module does not
Packit a4aae4
   rely on GNU or POSIX semantics for malloc and realloc (for example,
Packit a4aae4
   by never specifying a zero size), so it does not need malloc or
Packit a4aae4
   realloc to be redefined.  */
Packit a4aae4
#if @GNULIB_MALLOC_POSIX@
Packit a4aae4
# if @REPLACE_MALLOC@
Packit a4aae4
#  if !((defined __cplusplus && defined GNULIB_NAMESPACE) \
Packit a4aae4
        || _GL_USE_STDLIB_ALLOC)
Packit a4aae4
#   undef malloc
Packit a4aae4
#   define malloc rpl_malloc
Packit a4aae4
#  endif
Packit a4aae4
_GL_FUNCDECL_RPL (malloc, void *, (size_t size));
Packit a4aae4
_GL_CXXALIAS_RPL (malloc, void *, (size_t size));
Packit a4aae4
# else
Packit a4aae4
_GL_CXXALIAS_SYS (malloc, void *, (size_t size));
Packit a4aae4
# endif
Packit a4aae4
_GL_CXXALIASWARN (malloc);
Packit a4aae4
#elif defined GNULIB_POSIXCHECK && !_GL_USE_STDLIB_ALLOC
Packit a4aae4
# undef malloc
Packit a4aae4
/* Assume malloc is always declared.  */
Packit a4aae4
_GL_WARN_ON_USE (malloc, "malloc is not POSIX compliant everywhere - "
Packit a4aae4
                 "use gnulib module malloc-posix for portability");
Packit a4aae4
#endif
Packit a4aae4
Packit a4aae4
/* Convert a multibyte character to a wide character.  */
Packit a4aae4
#if @GNULIB_MBTOWC@
Packit a4aae4
# if @REPLACE_MBTOWC@
Packit a4aae4
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit a4aae4
#   undef mbtowc
Packit a4aae4
#   define mbtowc rpl_mbtowc
Packit a4aae4
#  endif
Packit a4aae4
_GL_FUNCDECL_RPL (mbtowc, int, (wchar_t *pwc, const char *s, size_t n));
Packit a4aae4
_GL_CXXALIAS_RPL (mbtowc, int, (wchar_t *pwc, const char *s, size_t n));
Packit a4aae4
# else
Packit a4aae4
_GL_CXXALIAS_SYS (mbtowc, int, (wchar_t *pwc, const char *s, size_t n));
Packit a4aae4
# endif
Packit a4aae4
_GL_CXXALIASWARN (mbtowc);
Packit a4aae4
#endif
Packit a4aae4
Packit a4aae4
#if @GNULIB_MKDTEMP@
Packit a4aae4
/* Create a unique temporary directory from TEMPLATE.
Packit a4aae4
   The last six characters of TEMPLATE must be "XXXXXX";
Packit a4aae4
   they are replaced with a string that makes the directory name unique.
Packit a4aae4
   Returns TEMPLATE, or a null pointer if it cannot get a unique name.
Packit a4aae4
   The directory is created mode 700.  */
Packit a4aae4
# if !@HAVE_MKDTEMP@
Packit a4aae4
_GL_FUNCDECL_SYS (mkdtemp, char *, (char * /*template*/) _GL_ARG_NONNULL ((1)));
Packit a4aae4
# endif
Packit a4aae4
_GL_CXXALIAS_SYS (mkdtemp, char *, (char * /*template*/));
Packit a4aae4
_GL_CXXALIASWARN (mkdtemp);
Packit a4aae4
#elif defined GNULIB_POSIXCHECK
Packit a4aae4
# undef mkdtemp
Packit a4aae4
# if HAVE_RAW_DECL_MKDTEMP
Packit a4aae4
_GL_WARN_ON_USE (mkdtemp, "mkdtemp is unportable - "
Packit a4aae4
                 "use gnulib module mkdtemp for portability");
Packit a4aae4
# endif
Packit a4aae4
#endif
Packit a4aae4
Packit a4aae4
#if @GNULIB_MKOSTEMP@
Packit a4aae4
/* Create a unique temporary file from TEMPLATE.
Packit a4aae4
   The last six characters of TEMPLATE must be "XXXXXX";
Packit a4aae4
   they are replaced with a string that makes the file name unique.
Packit a4aae4
   The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
Packit a4aae4
   and O_TEXT, O_BINARY (defined in "binary-io.h").
Packit a4aae4
   The file is then created, with the specified flags, ensuring it didn't exist
Packit a4aae4
   before.
Packit a4aae4
   The file is created read-write (mask at least 0600 & ~umask), but it may be
Packit a4aae4
   world-readable and world-writable (mask 0666 & ~umask), depending on the
Packit a4aae4
   implementation.
Packit a4aae4
   Returns the open file descriptor if successful, otherwise -1 and errno
Packit a4aae4
   set.  */
Packit a4aae4
# if !@HAVE_MKOSTEMP@
Packit a4aae4
_GL_FUNCDECL_SYS (mkostemp, int, (char * /*template*/, int /*flags*/)
Packit a4aae4
                                 _GL_ARG_NONNULL ((1)));
Packit a4aae4
# endif
Packit a4aae4
_GL_CXXALIAS_SYS (mkostemp, int, (char * /*template*/, int /*flags*/));
Packit a4aae4
_GL_CXXALIASWARN (mkostemp);
Packit a4aae4
#elif defined GNULIB_POSIXCHECK
Packit a4aae4
# undef mkostemp
Packit a4aae4
# if HAVE_RAW_DECL_MKOSTEMP
Packit a4aae4
_GL_WARN_ON_USE (mkostemp, "mkostemp is unportable - "
Packit a4aae4
                 "use gnulib module mkostemp for portability");
Packit a4aae4
# endif
Packit a4aae4
#endif
Packit a4aae4
Packit a4aae4
#if @GNULIB_MKOSTEMPS@
Packit a4aae4
/* Create a unique temporary file from TEMPLATE.
Packit a4aae4
   The last six characters of TEMPLATE before a suffix of length
Packit a4aae4
   SUFFIXLEN must be "XXXXXX";
Packit a4aae4
   they are replaced with a string that makes the file name unique.
Packit a4aae4
   The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
Packit a4aae4
   and O_TEXT, O_BINARY (defined in "binary-io.h").
Packit a4aae4
   The file is then created, with the specified flags, ensuring it didn't exist
Packit a4aae4
   before.
Packit a4aae4
   The file is created read-write (mask at least 0600 & ~umask), but it may be
Packit a4aae4
   world-readable and world-writable (mask 0666 & ~umask), depending on the
Packit a4aae4
   implementation.
Packit a4aae4
   Returns the open file descriptor if successful, otherwise -1 and errno
Packit a4aae4
   set.  */
Packit a4aae4
# if !@HAVE_MKOSTEMPS@
Packit a4aae4
_GL_FUNCDECL_SYS (mkostemps, int,
Packit a4aae4
                  (char * /*template*/, int /*suffixlen*/, int /*flags*/)
Packit a4aae4
                  _GL_ARG_NONNULL ((1)));
Packit a4aae4
# endif
Packit a4aae4
_GL_CXXALIAS_SYS (mkostemps, int,
Packit a4aae4
                  (char * /*template*/, int /*suffixlen*/, int /*flags*/));
Packit a4aae4
_GL_CXXALIASWARN (mkostemps);
Packit a4aae4
#elif defined GNULIB_POSIXCHECK
Packit a4aae4
# undef mkostemps
Packit a4aae4
# if HAVE_RAW_DECL_MKOSTEMPS
Packit a4aae4
_GL_WARN_ON_USE (mkostemps, "mkostemps is unportable - "
Packit a4aae4
                 "use gnulib module mkostemps for portability");
Packit a4aae4
# endif
Packit a4aae4
#endif
Packit a4aae4
Packit a4aae4
#if @GNULIB_MKSTEMP@
Packit a4aae4
/* Create a unique temporary file from TEMPLATE.
Packit a4aae4
   The last six characters of TEMPLATE must be "XXXXXX";
Packit a4aae4
   they are replaced with a string that makes the file name unique.
Packit a4aae4
   The file is then created, ensuring it didn't exist before.
Packit a4aae4
   The file is created read-write (mask at least 0600 & ~umask), but it may be
Packit a4aae4
   world-readable and world-writable (mask 0666 & ~umask), depending on the
Packit a4aae4
   implementation.
Packit a4aae4
   Returns the open file descriptor if successful, otherwise -1 and errno
Packit a4aae4
   set.  */
Packit a4aae4
# if @REPLACE_MKSTEMP@
Packit a4aae4
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit a4aae4
#   define mkstemp rpl_mkstemp
Packit a4aae4
#  endif
Packit a4aae4
_GL_FUNCDECL_RPL (mkstemp, int, (char * /*template*/) _GL_ARG_NONNULL ((1)));
Packit a4aae4
_GL_CXXALIAS_RPL (mkstemp, int, (char * /*template*/));
Packit a4aae4
# else
Packit a4aae4
#  if ! @HAVE_MKSTEMP@
Packit a4aae4
_GL_FUNCDECL_SYS (mkstemp, int, (char * /*template*/) _GL_ARG_NONNULL ((1)));
Packit a4aae4
#  endif
Packit a4aae4
_GL_CXXALIAS_SYS (mkstemp, int, (char * /*template*/));
Packit a4aae4
# endif
Packit a4aae4
_GL_CXXALIASWARN (mkstemp);
Packit a4aae4
#elif defined GNULIB_POSIXCHECK
Packit a4aae4
# undef mkstemp
Packit a4aae4
# if HAVE_RAW_DECL_MKSTEMP
Packit a4aae4
_GL_WARN_ON_USE (mkstemp, "mkstemp is unportable - "
Packit a4aae4
                 "use gnulib module mkstemp for portability");
Packit a4aae4
# endif
Packit a4aae4
#endif
Packit a4aae4
Packit a4aae4
#if @GNULIB_MKSTEMPS@
Packit a4aae4
/* Create a unique temporary file from TEMPLATE.
Packit a4aae4
   The last six characters of TEMPLATE prior to a suffix of length
Packit a4aae4
   SUFFIXLEN must be "XXXXXX";
Packit a4aae4
   they are replaced with a string that makes the file name unique.
Packit a4aae4
   The file is then created, ensuring it didn't exist before.
Packit a4aae4
   The file is created read-write (mask at least 0600 & ~umask), but it may be
Packit a4aae4
   world-readable and world-writable (mask 0666 & ~umask), depending on the
Packit a4aae4
   implementation.
Packit a4aae4
   Returns the open file descriptor if successful, otherwise -1 and errno
Packit a4aae4
   set.  */
Packit a4aae4
# if !@HAVE_MKSTEMPS@
Packit a4aae4
_GL_FUNCDECL_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/)
Packit a4aae4
                                 _GL_ARG_NONNULL ((1)));
Packit a4aae4
# endif
Packit a4aae4
_GL_CXXALIAS_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/));
Packit a4aae4
_GL_CXXALIASWARN (mkstemps);
Packit a4aae4
#elif defined GNULIB_POSIXCHECK
Packit a4aae4
# undef mkstemps
Packit a4aae4
# if HAVE_RAW_DECL_MKSTEMPS
Packit a4aae4
_GL_WARN_ON_USE (mkstemps, "mkstemps is unportable - "
Packit a4aae4
                 "use gnulib module mkstemps for portability");
Packit a4aae4
# endif
Packit a4aae4
#endif
Packit a4aae4
Packit a4aae4
#if @GNULIB_POSIX_OPENPT@
Packit a4aae4
/* Return an FD open to the master side of a pseudo-terminal.  Flags should
Packit a4aae4
   include O_RDWR, and may also include O_NOCTTY.  */
Packit a4aae4
# if !@HAVE_POSIX_OPENPT@
Packit a4aae4
_GL_FUNCDECL_SYS (posix_openpt, int, (int flags));
Packit a4aae4
# endif
Packit a4aae4
_GL_CXXALIAS_SYS (posix_openpt, int, (int flags));
Packit a4aae4
_GL_CXXALIASWARN (posix_openpt);
Packit a4aae4
#elif defined GNULIB_POSIXCHECK
Packit a4aae4
# undef posix_openpt
Packit a4aae4
# if HAVE_RAW_DECL_POSIX_OPENPT
Packit a4aae4
_GL_WARN_ON_USE (posix_openpt, "posix_openpt is not portable - "
Packit a4aae4
                 "use gnulib module posix_openpt for portability");
Packit a4aae4
# endif
Packit a4aae4
#endif
Packit a4aae4
Packit a4aae4
#if @GNULIB_PTSNAME@
Packit a4aae4
/* Return the pathname of the pseudo-terminal slave associated with
Packit a4aae4
   the master FD is open on, or NULL on errors.  */
Packit a4aae4
# if @REPLACE_PTSNAME@
Packit a4aae4
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit a4aae4
#   undef ptsname
Packit a4aae4
#   define ptsname rpl_ptsname
Packit a4aae4
#  endif
Packit a4aae4
_GL_FUNCDECL_RPL (ptsname, char *, (int fd));
Packit a4aae4
_GL_CXXALIAS_RPL (ptsname, char *, (int fd));
Packit a4aae4
# else
Packit a4aae4
#  if !@HAVE_PTSNAME@
Packit a4aae4
_GL_FUNCDECL_SYS (ptsname, char *, (int fd));
Packit a4aae4
#  endif
Packit a4aae4
_GL_CXXALIAS_SYS (ptsname, char *, (int fd));
Packit a4aae4
# endif
Packit a4aae4
_GL_CXXALIASWARN (ptsname);
Packit a4aae4
#elif defined GNULIB_POSIXCHECK
Packit a4aae4
# undef ptsname
Packit a4aae4
# if HAVE_RAW_DECL_PTSNAME
Packit a4aae4
_GL_WARN_ON_USE (ptsname, "ptsname is not portable - "
Packit a4aae4
                 "use gnulib module ptsname for portability");
Packit a4aae4
# endif
Packit a4aae4
#endif
Packit a4aae4
Packit a4aae4
#if @GNULIB_PTSNAME_R@
Packit a4aae4
/* Set the pathname of the pseudo-terminal slave associated with
Packit a4aae4
   the master FD is open on and return 0, or set errno and return
Packit a4aae4
   non-zero on errors.  */
Packit a4aae4
# if @REPLACE_PTSNAME_R@
Packit a4aae4
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit a4aae4
#   undef ptsname_r
Packit a4aae4
#   define ptsname_r rpl_ptsname_r
Packit a4aae4
#  endif
Packit a4aae4
_GL_FUNCDECL_RPL (ptsname_r, int, (int fd, char *buf, size_t len));
Packit a4aae4
_GL_CXXALIAS_RPL (ptsname_r, int, (int fd, char *buf, size_t len));
Packit a4aae4
# else
Packit a4aae4
#  if !@HAVE_PTSNAME_R@
Packit a4aae4
_GL_FUNCDECL_SYS (ptsname_r, int, (int fd, char *buf, size_t len));
Packit a4aae4
#  endif
Packit a4aae4
_GL_CXXALIAS_SYS (ptsname_r, int, (int fd, char *buf, size_t len));
Packit a4aae4
# endif
Packit a4aae4
_GL_CXXALIASWARN (ptsname_r);
Packit a4aae4
#elif defined GNULIB_POSIXCHECK
Packit a4aae4
# undef ptsname_r
Packit a4aae4
# if HAVE_RAW_DECL_PTSNAME_R
Packit a4aae4
_GL_WARN_ON_USE (ptsname_r, "ptsname_r is not portable - "
Packit a4aae4
                 "use gnulib module ptsname_r for portability");
Packit a4aae4
# endif
Packit a4aae4
#endif
Packit a4aae4
Packit a4aae4
#if @GNULIB_PUTENV@
Packit a4aae4
# if @REPLACE_PUTENV@
Packit a4aae4
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit a4aae4
#   undef putenv
Packit a4aae4
#   define putenv rpl_putenv
Packit a4aae4
#  endif
Packit a4aae4
_GL_FUNCDECL_RPL (putenv, int, (char *string) _GL_ARG_NONNULL ((1)));
Packit a4aae4
_GL_CXXALIAS_RPL (putenv, int, (char *string));
Packit a4aae4
# else
Packit a4aae4
_GL_CXXALIAS_SYS (putenv, int, (char *string));
Packit a4aae4
# endif
Packit a4aae4
_GL_CXXALIASWARN (putenv);
Packit a4aae4
#endif
Packit a4aae4
Packit a4aae4
#if @GNULIB_QSORT_R@
Packit a4aae4
/* Sort an array of NMEMB elements, starting at address BASE, each element
Packit a4aae4
   occupying SIZE bytes, in ascending order according to the comparison
Packit a4aae4
   function COMPARE.  */
Packit a4aae4
# if @REPLACE_QSORT_R@
Packit a4aae4
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit a4aae4
#   undef qsort_r
Packit a4aae4
#   define qsort_r rpl_qsort_r
Packit a4aae4
#  endif
Packit a4aae4
_GL_FUNCDECL_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size,
Packit a4aae4
                                  int (*compare) (void const *, void const *,
Packit a4aae4
                                                  void *),
Packit a4aae4
                                  void *arg) _GL_ARG_NONNULL ((1, 4)));
Packit a4aae4
_GL_CXXALIAS_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size,
Packit a4aae4
                                  int (*compare) (void const *, void const *,
Packit a4aae4
                                                  void *),
Packit a4aae4
                                  void *arg));
Packit a4aae4
# else
Packit a4aae4
#  if !@HAVE_QSORT_R@
Packit a4aae4
_GL_FUNCDECL_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size,
Packit a4aae4
                                  int (*compare) (void const *, void const *,
Packit a4aae4
                                                  void *),
Packit a4aae4
                                  void *arg) _GL_ARG_NONNULL ((1, 4)));
Packit a4aae4
#  endif
Packit a4aae4
_GL_CXXALIAS_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size,
Packit a4aae4
                                  int (*compare) (void const *, void const *,
Packit a4aae4
                                                  void *),
Packit a4aae4
                                  void *arg));
Packit a4aae4
# endif
Packit a4aae4
_GL_CXXALIASWARN (qsort_r);
Packit a4aae4
#elif defined GNULIB_POSIXCHECK
Packit a4aae4
# undef qsort_r
Packit a4aae4
# if HAVE_RAW_DECL_QSORT_R
Packit a4aae4
_GL_WARN_ON_USE (qsort_r, "qsort_r is not portable - "
Packit a4aae4
                 "use gnulib module qsort_r for portability");
Packit a4aae4
# endif
Packit a4aae4
#endif
Packit a4aae4
Packit a4aae4
Packit a4aae4
#if @GNULIB_RANDOM_R@
Packit a4aae4
# if !@HAVE_RANDOM_R@
Packit a4aae4
#  ifndef RAND_MAX
Packit a4aae4
#   define RAND_MAX 2147483647
Packit a4aae4
#  endif
Packit a4aae4
# endif
Packit a4aae4
#endif
Packit a4aae4
Packit a4aae4
Packit a4aae4
#if @GNULIB_RANDOM@
Packit a4aae4
# if !@HAVE_RANDOM@
Packit a4aae4
_GL_FUNCDECL_SYS (random, long, (void));
Packit a4aae4
# endif
Packit a4aae4
_GL_CXXALIAS_SYS (random, long, (void));
Packit a4aae4
_GL_CXXALIASWARN (random);
Packit a4aae4
#elif defined GNULIB_POSIXCHECK
Packit a4aae4
# undef random
Packit a4aae4
# if HAVE_RAW_DECL_RANDOM
Packit a4aae4
_GL_WARN_ON_USE (random, "random is unportable - "
Packit a4aae4
                 "use gnulib module random for portability");
Packit a4aae4
# endif
Packit a4aae4
#endif
Packit a4aae4
Packit a4aae4
#if @GNULIB_RANDOM@
Packit a4aae4
# if !@HAVE_RANDOM@
Packit a4aae4
_GL_FUNCDECL_SYS (srandom, void, (unsigned int seed));
Packit a4aae4
# endif
Packit a4aae4
_GL_CXXALIAS_SYS (srandom, void, (unsigned int seed));
Packit a4aae4
_GL_CXXALIASWARN (srandom);
Packit a4aae4
#elif defined GNULIB_POSIXCHECK
Packit a4aae4
# undef srandom
Packit a4aae4
# if HAVE_RAW_DECL_SRANDOM
Packit a4aae4
_GL_WARN_ON_USE (srandom, "srandom is unportable - "
Packit a4aae4
                 "use gnulib module random for portability");
Packit a4aae4
# endif
Packit a4aae4
#endif
Packit a4aae4
Packit a4aae4
#if @GNULIB_RANDOM@
Packit a4aae4
# if !@HAVE_RANDOM@ || !@HAVE_DECL_INITSTATE@
Packit a4aae4
_GL_FUNCDECL_SYS (initstate, char *,
Packit a4aae4
                  (unsigned int seed, char *buf, size_t buf_size)
Packit a4aae4
                  _GL_ARG_NONNULL ((2)));
Packit a4aae4
# endif
Packit a4aae4
_GL_CXXALIAS_SYS (initstate, char *,
Packit a4aae4
                  (unsigned int seed, char *buf, size_t buf_size));
Packit a4aae4
_GL_CXXALIASWARN (initstate);
Packit a4aae4
#elif defined GNULIB_POSIXCHECK
Packit a4aae4
# undef initstate
Packit a4aae4
# if HAVE_RAW_DECL_INITSTATE_R
Packit a4aae4
_GL_WARN_ON_USE (initstate, "initstate is unportable - "
Packit a4aae4
                 "use gnulib module random for portability");
Packit a4aae4
# endif
Packit a4aae4
#endif
Packit a4aae4
Packit a4aae4
#if @GNULIB_RANDOM@
Packit a4aae4
# if !@HAVE_RANDOM@ || !@HAVE_DECL_SETSTATE@
Packit a4aae4
_GL_FUNCDECL_SYS (setstate, char *, (char *arg_state) _GL_ARG_NONNULL ((1)));
Packit a4aae4
# endif
Packit a4aae4
_GL_CXXALIAS_SYS (setstate, char *, (char *arg_state));
Packit a4aae4
_GL_CXXALIASWARN (setstate);
Packit a4aae4
#elif defined GNULIB_POSIXCHECK
Packit a4aae4
# undef setstate
Packit a4aae4
# if HAVE_RAW_DECL_SETSTATE_R
Packit a4aae4
_GL_WARN_ON_USE (setstate, "setstate is unportable - "
Packit a4aae4
                 "use gnulib module random for portability");
Packit a4aae4
# endif
Packit a4aae4
#endif
Packit a4aae4
Packit a4aae4
Packit a4aae4
#if @GNULIB_RANDOM_R@
Packit a4aae4
# if @REPLACE_RANDOM_R@
Packit a4aae4
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit a4aae4
#   undef random_r
Packit a4aae4
#   define random_r rpl_random_r
Packit a4aae4
#  endif
Packit a4aae4
_GL_FUNCDECL_RPL (random_r, int, (struct random_data *buf, int32_t *result)
Packit a4aae4
                                 _GL_ARG_NONNULL ((1, 2)));
Packit a4aae4
_GL_CXXALIAS_RPL (random_r, int, (struct random_data *buf, int32_t *result));
Packit a4aae4
# else
Packit a4aae4
#  if !@HAVE_RANDOM_R@
Packit a4aae4
_GL_FUNCDECL_SYS (random_r, int, (struct random_data *buf, int32_t *result)
Packit a4aae4
                                 _GL_ARG_NONNULL ((1, 2)));
Packit a4aae4
#  endif
Packit a4aae4
_GL_CXXALIAS_SYS (random_r, int, (struct random_data *buf, int32_t *result));
Packit a4aae4
# endif
Packit a4aae4
_GL_CXXALIASWARN (random_r);
Packit a4aae4
#elif defined GNULIB_POSIXCHECK
Packit a4aae4
# undef random_r
Packit a4aae4
# if HAVE_RAW_DECL_RANDOM_R
Packit a4aae4
_GL_WARN_ON_USE (random_r, "random_r is unportable - "
Packit a4aae4
                 "use gnulib module random_r for portability");
Packit a4aae4
# endif
Packit a4aae4
#endif
Packit a4aae4
Packit a4aae4
#if @GNULIB_RANDOM_R@
Packit a4aae4
# if @REPLACE_RANDOM_R@
Packit a4aae4
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit a4aae4
#   undef srandom_r
Packit a4aae4
#   define srandom_r rpl_srandom_r
Packit a4aae4
#  endif
Packit a4aae4
_GL_FUNCDECL_RPL (srandom_r, int,
Packit a4aae4
                  (unsigned int seed, struct random_data *rand_state)
Packit a4aae4
                  _GL_ARG_NONNULL ((2)));
Packit a4aae4
_GL_CXXALIAS_RPL (srandom_r, int,
Packit a4aae4
                  (unsigned int seed, struct random_data *rand_state));
Packit a4aae4
# else
Packit a4aae4
#  if !@HAVE_RANDOM_R@
Packit a4aae4
_GL_FUNCDECL_SYS (srandom_r, int,
Packit a4aae4
                  (unsigned int seed, struct random_data *rand_state)
Packit a4aae4
                  _GL_ARG_NONNULL ((2)));
Packit a4aae4
#  endif
Packit a4aae4
_GL_CXXALIAS_SYS (srandom_r, int,
Packit a4aae4
                  (unsigned int seed, struct random_data *rand_state));
Packit a4aae4
# endif
Packit a4aae4
_GL_CXXALIASWARN (srandom_r);
Packit a4aae4
#elif defined GNULIB_POSIXCHECK
Packit a4aae4
# undef srandom_r
Packit a4aae4
# if HAVE_RAW_DECL_SRANDOM_R
Packit a4aae4
_GL_WARN_ON_USE (srandom_r, "srandom_r is unportable - "
Packit a4aae4
                 "use gnulib module random_r for portability");
Packit a4aae4
# endif
Packit a4aae4
#endif
Packit a4aae4
Packit a4aae4
#if @GNULIB_RANDOM_R@
Packit a4aae4
# if @REPLACE_RANDOM_R@
Packit a4aae4
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit a4aae4
#   undef initstate_r
Packit a4aae4
#   define initstate_r rpl_initstate_r
Packit a4aae4
#  endif
Packit a4aae4
_GL_FUNCDECL_RPL (initstate_r, int,
Packit a4aae4
                  (unsigned int seed, char *buf, size_t buf_size,
Packit a4aae4
                   struct random_data *rand_state)
Packit a4aae4
                  _GL_ARG_NONNULL ((2, 4)));
Packit a4aae4
_GL_CXXALIAS_RPL (initstate_r, int,
Packit a4aae4
                  (unsigned int seed, char *buf, size_t buf_size,
Packit a4aae4
                   struct random_data *rand_state));
Packit a4aae4
# else
Packit a4aae4
#  if !@HAVE_RANDOM_R@
Packit a4aae4
_GL_FUNCDECL_SYS (initstate_r, int,
Packit a4aae4
                  (unsigned int seed, char *buf, size_t buf_size,
Packit a4aae4
                   struct random_data *rand_state)
Packit a4aae4
                  _GL_ARG_NONNULL ((2, 4)));
Packit a4aae4
#  endif
Packit a4aae4
_GL_CXXALIAS_SYS (initstate_r, int,
Packit a4aae4
                  (unsigned int seed, char *buf, size_t buf_size,
Packit a4aae4
                   struct random_data *rand_state));
Packit a4aae4
# endif
Packit a4aae4
_GL_CXXALIASWARN (initstate_r);
Packit a4aae4
#elif defined GNULIB_POSIXCHECK
Packit a4aae4
# undef initstate_r
Packit a4aae4
# if HAVE_RAW_DECL_INITSTATE_R
Packit a4aae4
_GL_WARN_ON_USE (initstate_r, "initstate_r is unportable - "
Packit a4aae4
                 "use gnulib module random_r for portability");
Packit a4aae4
# endif
Packit a4aae4
#endif
Packit a4aae4
Packit a4aae4
#if @GNULIB_RANDOM_R@
Packit a4aae4
# if @REPLACE_RANDOM_R@
Packit a4aae4
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit a4aae4
#   undef setstate_r
Packit a4aae4
#   define setstate_r rpl_setstate_r
Packit a4aae4
#  endif
Packit a4aae4
_GL_FUNCDECL_RPL (setstate_r, int,
Packit a4aae4
                  (char *arg_state, struct random_data *rand_state)
Packit a4aae4
                  _GL_ARG_NONNULL ((1, 2)));
Packit a4aae4
_GL_CXXALIAS_RPL (setstate_r, int,
Packit a4aae4
                  (char *arg_state, struct random_data *rand_state));
Packit a4aae4
# else
Packit a4aae4
#  if !@HAVE_RANDOM_R@
Packit a4aae4
_GL_FUNCDECL_SYS (setstate_r, int,
Packit a4aae4
                  (char *arg_state, struct random_data *rand_state)
Packit a4aae4
                  _GL_ARG_NONNULL ((1, 2)));
Packit a4aae4
#  endif
Packit a4aae4
_GL_CXXALIAS_SYS (setstate_r, int,
Packit a4aae4
                  (char *arg_state, struct random_data *rand_state));
Packit a4aae4
# endif
Packit a4aae4
_GL_CXXALIASWARN (setstate_r);
Packit a4aae4
#elif defined GNULIB_POSIXCHECK
Packit a4aae4
# undef setstate_r
Packit a4aae4
# if HAVE_RAW_DECL_SETSTATE_R
Packit a4aae4
_GL_WARN_ON_USE (setstate_r, "setstate_r is unportable - "
Packit a4aae4
                 "use gnulib module random_r for portability");
Packit a4aae4
# endif
Packit a4aae4
#endif
Packit a4aae4
Packit a4aae4
Packit a4aae4
#if @GNULIB_REALLOC_POSIX@
Packit a4aae4
# if @REPLACE_REALLOC@
Packit a4aae4
#  if !((defined __cplusplus && defined GNULIB_NAMESPACE) \
Packit a4aae4
        || _GL_USE_STDLIB_ALLOC)
Packit a4aae4
#   undef realloc
Packit a4aae4
#   define realloc rpl_realloc
Packit a4aae4
#  endif
Packit a4aae4
_GL_FUNCDECL_RPL (realloc, void *, (void *ptr, size_t size));
Packit a4aae4
_GL_CXXALIAS_RPL (realloc, void *, (void *ptr, size_t size));
Packit a4aae4
# else
Packit a4aae4
_GL_CXXALIAS_SYS (realloc, void *, (void *ptr, size_t size));
Packit a4aae4
# endif
Packit a4aae4
_GL_CXXALIASWARN (realloc);
Packit a4aae4
#elif defined GNULIB_POSIXCHECK && !_GL_USE_STDLIB_ALLOC
Packit a4aae4
# undef realloc
Packit a4aae4
/* Assume realloc is always declared.  */
Packit a4aae4
_GL_WARN_ON_USE (realloc, "realloc is not POSIX compliant everywhere - "
Packit a4aae4
                 "use gnulib module realloc-posix for portability");
Packit a4aae4
#endif
Packit a4aae4
Packit a4aae4
Packit a4aae4
#if @GNULIB_REALLOCARRAY@
Packit a4aae4
# if ! @HAVE_REALLOCARRAY@
Packit a4aae4
_GL_FUNCDECL_SYS (reallocarray, void *,
Packit a4aae4
                  (void *ptr, size_t nmemb, size_t size));
Packit a4aae4
# endif
Packit a4aae4
_GL_CXXALIAS_SYS (reallocarray, void *,
Packit a4aae4
                  (void *ptr, size_t nmemb, size_t size));
Packit a4aae4
_GL_CXXALIASWARN (reallocarray);
Packit a4aae4
#elif defined GNULIB_POSIXCHECK
Packit a4aae4
# undef reallocarray
Packit a4aae4
# if HAVE_RAW_DECL_REALLOCARRAY
Packit a4aae4
_GL_WARN_ON_USE (reallocarray, "reallocarray is not portable - "
Packit a4aae4
                 "use gnulib module reallocarray for portability");
Packit a4aae4
# endif
Packit a4aae4
#endif
Packit a4aae4
Packit a4aae4
#if @GNULIB_REALPATH@
Packit a4aae4
# if @REPLACE_REALPATH@
Packit a4aae4
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit a4aae4
#   define realpath rpl_realpath
Packit a4aae4
#  endif
Packit a4aae4
_GL_FUNCDECL_RPL (realpath, char *, (const char *name, char *resolved)
Packit a4aae4
                                    _GL_ARG_NONNULL ((1)));
Packit a4aae4
_GL_CXXALIAS_RPL (realpath, char *, (const char *name, char *resolved));
Packit a4aae4
# else
Packit a4aae4
#  if !@HAVE_REALPATH@
Packit a4aae4
_GL_FUNCDECL_SYS (realpath, char *, (const char *name, char *resolved)
Packit a4aae4
                                    _GL_ARG_NONNULL ((1)));
Packit a4aae4
#  endif
Packit a4aae4
_GL_CXXALIAS_SYS (realpath, char *, (const char *name, char *resolved));
Packit a4aae4
# endif
Packit a4aae4
_GL_CXXALIASWARN (realpath);
Packit a4aae4
#elif defined GNULIB_POSIXCHECK
Packit a4aae4
# undef realpath
Packit a4aae4
# if HAVE_RAW_DECL_REALPATH
Packit a4aae4
_GL_WARN_ON_USE (realpath, "realpath is unportable - use gnulib module "
Packit a4aae4
                 "canonicalize or canonicalize-lgpl for portability");
Packit a4aae4
# endif
Packit a4aae4
#endif
Packit a4aae4
Packit a4aae4
#if @GNULIB_RPMATCH@
Packit a4aae4
/* Test a user response to a question.
Packit a4aae4
   Return 1 if it is affirmative, 0 if it is negative, or -1 if not clear.  */
Packit a4aae4
# if !@HAVE_RPMATCH@
Packit a4aae4
_GL_FUNCDECL_SYS (rpmatch, int, (const char *response) _GL_ARG_NONNULL ((1)));
Packit a4aae4
# endif
Packit a4aae4
_GL_CXXALIAS_SYS (rpmatch, int, (const char *response));
Packit a4aae4
_GL_CXXALIASWARN (rpmatch);
Packit a4aae4
#elif defined GNULIB_POSIXCHECK
Packit a4aae4
# undef rpmatch
Packit a4aae4
# if HAVE_RAW_DECL_RPMATCH
Packit a4aae4
_GL_WARN_ON_USE (rpmatch, "rpmatch is unportable - "
Packit a4aae4
                 "use gnulib module rpmatch for portability");
Packit a4aae4
# endif
Packit a4aae4
#endif
Packit a4aae4
Packit a4aae4
#if @GNULIB_SECURE_GETENV@
Packit a4aae4
/* Look up NAME in the environment, returning 0 in insecure situations.  */
Packit a4aae4
# if !@HAVE_SECURE_GETENV@
Packit a4aae4
_GL_FUNCDECL_SYS (secure_getenv, char *,
Packit a4aae4
                  (char const *name) _GL_ARG_NONNULL ((1)));
Packit a4aae4
# endif
Packit a4aae4
_GL_CXXALIAS_SYS (secure_getenv, char *, (char const *name));
Packit a4aae4
_GL_CXXALIASWARN (secure_getenv);
Packit a4aae4
#elif defined GNULIB_POSIXCHECK
Packit a4aae4
# undef secure_getenv
Packit a4aae4
# if HAVE_RAW_DECL_SECURE_GETENV
Packit a4aae4
_GL_WARN_ON_USE (secure_getenv, "secure_getenv is unportable - "
Packit a4aae4
                 "use gnulib module secure_getenv for portability");
Packit a4aae4
# endif
Packit a4aae4
#endif
Packit a4aae4
Packit a4aae4
#if @GNULIB_SETENV@
Packit a4aae4
/* Set NAME to VALUE in the environment.
Packit a4aae4
   If REPLACE is nonzero, overwrite an existing value.  */
Packit a4aae4
# if @REPLACE_SETENV@
Packit a4aae4
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit a4aae4
#   undef setenv
Packit a4aae4
#   define setenv rpl_setenv
Packit a4aae4
#  endif
Packit a4aae4
_GL_FUNCDECL_RPL (setenv, int,
Packit a4aae4
                  (const char *name, const char *value, int replace)
Packit a4aae4
                  _GL_ARG_NONNULL ((1)));
Packit a4aae4
_GL_CXXALIAS_RPL (setenv, int,
Packit a4aae4
                  (const char *name, const char *value, int replace));
Packit a4aae4
# else
Packit a4aae4
#  if !@HAVE_DECL_SETENV@
Packit a4aae4
_GL_FUNCDECL_SYS (setenv, int,
Packit a4aae4
                  (const char *name, const char *value, int replace)
Packit a4aae4
                  _GL_ARG_NONNULL ((1)));
Packit a4aae4
#  endif
Packit a4aae4
_GL_CXXALIAS_SYS (setenv, int,
Packit a4aae4
                  (const char *name, const char *value, int replace));
Packit a4aae4
# endif
Packit a4aae4
# if !(@REPLACE_SETENV@ && !@HAVE_DECL_SETENV@)
Packit a4aae4
_GL_CXXALIASWARN (setenv);
Packit a4aae4
# endif
Packit a4aae4
#elif defined GNULIB_POSIXCHECK
Packit a4aae4
# undef setenv
Packit a4aae4
# if HAVE_RAW_DECL_SETENV
Packit a4aae4
_GL_WARN_ON_USE (setenv, "setenv is unportable - "
Packit a4aae4
                 "use gnulib module setenv for portability");
Packit a4aae4
# endif
Packit a4aae4
#endif
Packit a4aae4
Packit a4aae4
#if @GNULIB_STRTOD@
Packit a4aae4
 /* Parse a double from STRING, updating ENDP if appropriate.  */
Packit a4aae4
# if @REPLACE_STRTOD@
Packit a4aae4
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit a4aae4
#   define strtod rpl_strtod
Packit a4aae4
#  endif
Packit a4aae4
_GL_FUNCDECL_RPL (strtod, double, (const char *str, char **endp)
Packit a4aae4
                                  _GL_ARG_NONNULL ((1)));
Packit a4aae4
_GL_CXXALIAS_RPL (strtod, double, (const char *str, char **endp));
Packit a4aae4
# else
Packit a4aae4
#  if !@HAVE_STRTOD@
Packit a4aae4
_GL_FUNCDECL_SYS (strtod, double, (const char *str, char **endp)
Packit a4aae4
                                  _GL_ARG_NONNULL ((1)));
Packit a4aae4
#  endif
Packit a4aae4
_GL_CXXALIAS_SYS (strtod, double, (const char *str, char **endp));
Packit a4aae4
# endif
Packit a4aae4
_GL_CXXALIASWARN (strtod);
Packit a4aae4
#elif defined GNULIB_POSIXCHECK
Packit a4aae4
# undef strtod
Packit a4aae4
# if HAVE_RAW_DECL_STRTOD
Packit a4aae4
_GL_WARN_ON_USE (strtod, "strtod is unportable - "
Packit a4aae4
                 "use gnulib module strtod for portability");
Packit a4aae4
# endif
Packit a4aae4
#endif
Packit a4aae4
Packit a4aae4
#if @GNULIB_STRTOLL@
Packit a4aae4
/* Parse a signed integer whose textual representation starts at STRING.
Packit a4aae4
   The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0,
Packit a4aae4
   it may be decimal or octal (with prefix "0") or hexadecimal (with prefix
Packit a4aae4
   "0x").
Packit a4aae4
   If ENDPTR is not NULL, the address of the first byte after the integer is
Packit a4aae4
   stored in *ENDPTR.
Packit a4aae4
   Upon overflow, the return value is LLONG_MAX or LLONG_MIN, and errno is set
Packit a4aae4
   to ERANGE.  */
Packit a4aae4
# if !@HAVE_STRTOLL@
Packit a4aae4
_GL_FUNCDECL_SYS (strtoll, long long,
Packit a4aae4
                  (const char *string, char **endptr, int base)
Packit a4aae4
                  _GL_ARG_NONNULL ((1)));
Packit a4aae4
# endif
Packit a4aae4
_GL_CXXALIAS_SYS (strtoll, long long,
Packit a4aae4
                  (const char *string, char **endptr, int base));
Packit a4aae4
_GL_CXXALIASWARN (strtoll);
Packit a4aae4
#elif defined GNULIB_POSIXCHECK
Packit a4aae4
# undef strtoll
Packit a4aae4
# if HAVE_RAW_DECL_STRTOLL
Packit a4aae4
_GL_WARN_ON_USE (strtoll, "strtoll is unportable - "
Packit a4aae4
                 "use gnulib module strtoll for portability");
Packit a4aae4
# endif
Packit a4aae4
#endif
Packit a4aae4
Packit a4aae4
#if @GNULIB_STRTOULL@
Packit a4aae4
/* Parse an unsigned integer whose textual representation starts at STRING.
Packit a4aae4
   The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0,
Packit a4aae4
   it may be decimal or octal (with prefix "0") or hexadecimal (with prefix
Packit a4aae4
   "0x").
Packit a4aae4
   If ENDPTR is not NULL, the address of the first byte after the integer is
Packit a4aae4
   stored in *ENDPTR.
Packit a4aae4
   Upon overflow, the return value is ULLONG_MAX, and errno is set to
Packit a4aae4
   ERANGE.  */
Packit a4aae4
# if !@HAVE_STRTOULL@
Packit a4aae4
_GL_FUNCDECL_SYS (strtoull, unsigned long long,
Packit a4aae4
                  (const char *string, char **endptr, int base)
Packit a4aae4
                  _GL_ARG_NONNULL ((1)));
Packit a4aae4
# endif
Packit a4aae4
_GL_CXXALIAS_SYS (strtoull, unsigned long long,
Packit a4aae4
                  (const char *string, char **endptr, int base));
Packit a4aae4
_GL_CXXALIASWARN (strtoull);
Packit a4aae4
#elif defined GNULIB_POSIXCHECK
Packit a4aae4
# undef strtoull
Packit a4aae4
# if HAVE_RAW_DECL_STRTOULL
Packit a4aae4
_GL_WARN_ON_USE (strtoull, "strtoull is unportable - "
Packit a4aae4
                 "use gnulib module strtoull for portability");
Packit a4aae4
# endif
Packit a4aae4
#endif
Packit a4aae4
Packit a4aae4
#if @GNULIB_UNLOCKPT@
Packit a4aae4
/* Unlock the slave side of the pseudo-terminal whose master side is specified
Packit a4aae4
   by FD, so that it can be opened.  */
Packit a4aae4
# if !@HAVE_UNLOCKPT@
Packit a4aae4
_GL_FUNCDECL_SYS (unlockpt, int, (int fd));
Packit a4aae4
# endif
Packit a4aae4
_GL_CXXALIAS_SYS (unlockpt, int, (int fd));
Packit a4aae4
_GL_CXXALIASWARN (unlockpt);
Packit a4aae4
#elif defined GNULIB_POSIXCHECK
Packit a4aae4
# undef unlockpt
Packit a4aae4
# if HAVE_RAW_DECL_UNLOCKPT
Packit a4aae4
_GL_WARN_ON_USE (unlockpt, "unlockpt is not portable - "
Packit a4aae4
                 "use gnulib module unlockpt for portability");
Packit a4aae4
# endif
Packit a4aae4
#endif
Packit a4aae4
Packit a4aae4
#if @GNULIB_UNSETENV@
Packit a4aae4
/* Remove the variable NAME from the environment.  */
Packit a4aae4
# if @REPLACE_UNSETENV@
Packit a4aae4
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit a4aae4
#   undef unsetenv
Packit a4aae4
#   define unsetenv rpl_unsetenv
Packit a4aae4
#  endif
Packit a4aae4
_GL_FUNCDECL_RPL (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1)));
Packit a4aae4
_GL_CXXALIAS_RPL (unsetenv, int, (const char *name));
Packit a4aae4
# else
Packit a4aae4
#  if !@HAVE_DECL_UNSETENV@
Packit a4aae4
_GL_FUNCDECL_SYS (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1)));
Packit a4aae4
#  endif
Packit a4aae4
_GL_CXXALIAS_SYS (unsetenv, int, (const char *name));
Packit a4aae4
# endif
Packit a4aae4
# if !(@REPLACE_UNSETENV@ && !@HAVE_DECL_UNSETENV@)
Packit a4aae4
_GL_CXXALIASWARN (unsetenv);
Packit a4aae4
# endif
Packit a4aae4
#elif defined GNULIB_POSIXCHECK
Packit a4aae4
# undef unsetenv
Packit a4aae4
# if HAVE_RAW_DECL_UNSETENV
Packit a4aae4
_GL_WARN_ON_USE (unsetenv, "unsetenv is unportable - "
Packit a4aae4
                 "use gnulib module unsetenv for portability");
Packit a4aae4
# endif
Packit a4aae4
#endif
Packit a4aae4
Packit a4aae4
/* Convert a wide character to a multibyte character.  */
Packit a4aae4
#if @GNULIB_WCTOMB@
Packit a4aae4
# if @REPLACE_WCTOMB@
Packit a4aae4
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit a4aae4
#   undef wctomb
Packit a4aae4
#   define wctomb rpl_wctomb
Packit a4aae4
#  endif
Packit a4aae4
_GL_FUNCDECL_RPL (wctomb, int, (char *s, wchar_t wc));
Packit a4aae4
_GL_CXXALIAS_RPL (wctomb, int, (char *s, wchar_t wc));
Packit a4aae4
# else
Packit a4aae4
_GL_CXXALIAS_SYS (wctomb, int, (char *s, wchar_t wc));
Packit a4aae4
# endif
Packit a4aae4
_GL_CXXALIASWARN (wctomb);
Packit a4aae4
#endif
Packit a4aae4
Packit a4aae4
Packit a4aae4
#endif /* _@GUARD_PREFIX@_STDLIB_H */
Packit a4aae4
#endif /* _@GUARD_PREFIX@_STDLIB_H */
Packit a4aae4
#endif