Blame lib/stdlib.in.h

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