Blame lib/stdlib.in.h

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