|
version 1.1.1.2, 2012/05/29 09:29:43
|
version 1.1.1.3, 2021/03/17 13:38:46
|
|
Line 1
|
Line 1
|
| /* A GNU-like <stdlib.h>. |
/* A GNU-like <stdlib.h>. |
| |
|
| Copyright (C) 1995, 2001-2004, 2006-2011 Free Software Foundation, Inc. | Copyright (C) 1995, 2001-2004, 2006-2019 Free Software Foundation, Inc. |
| |
|
| This program is free software: you can redistribute it and/or modify |
This program is free software: you can redistribute it and/or modify |
| it under the terms of the GNU General Public License as published by |
it under the terms of the GNU General Public License as published by |
|
Line 13
|
Line 13
|
| GNU General Public License for more details. |
GNU General Public License for more details. |
| |
|
| You should have received a copy of the GNU General Public License |
You should have received a copy of the GNU General Public License |
| along with this program. If not, see <http://www.gnu.org/licenses/>. */ | along with this program. If not, see <https://www.gnu.org/licenses/>. */ |
| |
|
| #if __GNUC__ >= 3 |
#if __GNUC__ >= 3 |
| @PRAGMA_SYSTEM_HEADER@ |
@PRAGMA_SYSTEM_HEADER@ |
| #endif |
#endif |
| @PRAGMA_COLUMNS@ |
@PRAGMA_COLUMNS@ |
| |
|
| #if defined __need_malloc_and_calloc | #if defined __need_system_stdlib_h || defined __need_malloc_and_calloc |
| /* Special invocation convention inside glibc header files. */ | /* Special invocation conventions inside some gnulib header files, |
| | and inside some glibc header files, respectively. */ |
| |
|
| #@INCLUDE_NEXT@ @NEXT_STDLIB_H@ |
#@INCLUDE_NEXT@ @NEXT_STDLIB_H@ |
| |
|
|
Line 46
|
Line 47
|
| |
|
| /* Solaris declares getloadavg() in <sys/loadavg.h>. */ |
/* Solaris declares getloadavg() in <sys/loadavg.h>. */ |
| #if (@GNULIB_GETLOADAVG@ || defined GNULIB_POSIXCHECK) && @HAVE_SYS_LOADAVG_H@ |
#if (@GNULIB_GETLOADAVG@ || defined GNULIB_POSIXCHECK) && @HAVE_SYS_LOADAVG_H@ |
| |
/* OpenIndiana has a bug: <sys/time.h> must be included before |
| |
<sys/loadavg.h>. */ |
| |
# include <sys/time.h> |
| # include <sys/loadavg.h> |
# include <sys/loadavg.h> |
| #endif |
#endif |
| |
|
| |
/* Native Windows platforms declare mktemp() in <io.h>. */ |
| |
#if 0 && (defined _WIN32 && ! defined __CYGWIN__) |
| |
# include <io.h> |
| |
#endif |
| |
|
| #if @GNULIB_RANDOM_R@ |
#if @GNULIB_RANDOM_R@ |
| |
|
| /* OSF/1 5.1 declares 'struct random_data' in <random.h>, which is included |
/* OSF/1 5.1 declares 'struct random_data' in <random.h>, which is included |
|
Line 58
|
Line 67
|
| # include <random.h> |
# include <random.h> |
| # endif |
# endif |
| |
|
| # if !@HAVE_STRUCT_RANDOM_DATA@ || !@HAVE_RANDOM_R@ | # if !@HAVE_STRUCT_RANDOM_DATA@ || @REPLACE_RANDOM_R@ || !@HAVE_RANDOM_R@ |
| # include <stdint.h> |
# include <stdint.h> |
| # endif |
# endif |
| |
|
|
Line 81 struct random_data
|
Line 90 struct random_data
|
| # endif |
# endif |
| #endif |
#endif |
| |
|
| #if (@GNULIB_MKSTEMP@ || @GNULIB_MKSTEMPS@ || @GNULIB_GETSUBOPT@ || defined GNULIB_POSIXCHECK) && ! defined __GLIBC__ && !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) | #if (@GNULIB_MKSTEMP@ || @GNULIB_MKSTEMPS@ || @GNULIB_MKOSTEMP@ || @GNULIB_MKOSTEMPS@ || @GNULIB_GETSUBOPT@ || defined GNULIB_POSIXCHECK) && ! defined __GLIBC__ && !(defined _WIN32 && ! defined __CYGWIN__) |
| /* On MacOS X 10.3, only <unistd.h> declares mkstemp. */ | /* On Mac OS X 10.3, only <unistd.h> declares mkstemp. */ |
| /* On MacOS X 10.5, only <unistd.h> declares mkstemps. */ | /* On Mac OS X 10.5, only <unistd.h> declares mkstemps. */ |
| | /* On Mac OS X 10.13, only <unistd.h> declares mkostemp and mkostemps. */ |
| /* On Cygwin 1.7.1, only <unistd.h> declares getsubopt. */ |
/* On Cygwin 1.7.1, only <unistd.h> declares getsubopt. */ |
| /* But avoid namespace pollution on glibc systems and native Windows. */ |
/* But avoid namespace pollution on glibc systems and native Windows. */ |
| # include <unistd.h> |
# include <unistd.h> |
| #endif |
#endif |
| |
|
| |
/* The __attribute__ feature is available in gcc versions 2.5 and later. |
| |
The attribute __pure__ was added in gcc 2.96. */ |
| |
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) |
| |
# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) |
| |
#else |
| |
# define _GL_ATTRIBUTE_PURE /* empty */ |
| |
#endif |
| |
|
| /* The definition of _Noreturn is copied here. */ |
/* The definition of _Noreturn is copied here. */ |
| |
|
| /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ |
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ |
|
Line 133 _GL_WARN_ON_USE (_Exit, "_Exit is unportable - "
|
Line 151 _GL_WARN_ON_USE (_Exit, "_Exit is unportable - "
|
| /* Parse a signed decimal integer. |
/* Parse a signed decimal integer. |
| Returns the value of the integer. Errors are not detected. */ |
Returns the value of the integer. Errors are not detected. */ |
| # if !@HAVE_ATOLL@ |
# if !@HAVE_ATOLL@ |
| _GL_FUNCDECL_SYS (atoll, long long, (const char *string) _GL_ARG_NONNULL ((1))); | _GL_FUNCDECL_SYS (atoll, long long, (const char *string) |
| | _GL_ATTRIBUTE_PURE |
| | _GL_ARG_NONNULL ((1))); |
| # endif |
# endif |
| _GL_CXXALIAS_SYS (atoll, long long, (const char *string)); |
_GL_CXXALIAS_SYS (atoll, long long, (const char *string)); |
| _GL_CXXALIASWARN (atoll); |
_GL_CXXALIASWARN (atoll); |
|
Line 247 _GL_CXXALIASWARN (grantpt);
|
Line 267 _GL_CXXALIASWARN (grantpt);
|
| #elif defined GNULIB_POSIXCHECK |
#elif defined GNULIB_POSIXCHECK |
| # undef grantpt |
# undef grantpt |
| # if HAVE_RAW_DECL_GRANTPT |
# if HAVE_RAW_DECL_GRANTPT |
| _GL_WARN_ON_USE (ptsname, "grantpt is not portable - " | _GL_WARN_ON_USE (grantpt, "grantpt is not portable - " |
| "use gnulib module grantpt for portability"); |
"use gnulib module grantpt for portability"); |
| # endif |
# endif |
| #endif |
#endif |
|
Line 286 _GL_WARN_ON_USE (malloc, "malloc is not POSIX complian
|
Line 306 _GL_WARN_ON_USE (malloc, "malloc is not POSIX complian
|
| _GL_FUNCDECL_RPL (mbtowc, int, (wchar_t *pwc, const char *s, size_t n)); |
_GL_FUNCDECL_RPL (mbtowc, int, (wchar_t *pwc, const char *s, size_t n)); |
| _GL_CXXALIAS_RPL (mbtowc, int, (wchar_t *pwc, const char *s, size_t n)); |
_GL_CXXALIAS_RPL (mbtowc, int, (wchar_t *pwc, const char *s, size_t n)); |
| # else |
# else |
| |
# if !@HAVE_MBTOWC@ |
| |
_GL_FUNCDECL_SYS (mbtowc, int, (wchar_t *pwc, const char *s, size_t n)); |
| |
# endif |
| _GL_CXXALIAS_SYS (mbtowc, int, (wchar_t *pwc, const char *s, size_t n)); |
_GL_CXXALIAS_SYS (mbtowc, int, (wchar_t *pwc, const char *s, size_t n)); |
| # endif |
# endif |
| _GL_CXXALIASWARN (mbtowc); |
_GL_CXXALIASWARN (mbtowc); |
| |
#elif defined GNULIB_POSIXCHECK |
| |
# undef mbtowc |
| |
# if HAVE_RAW_DECL_MBTOWC |
| |
_GL_WARN_ON_USE (mbtowc, "mbtowc is not portable - " |
| |
"use gnulib module mbtowc for portability"); |
| |
# endif |
| #endif |
#endif |
| |
|
| #if @GNULIB_MKDTEMP@ |
#if @GNULIB_MKDTEMP@ |
|
Line 423 _GL_WARN_ON_USE (mkstemps, "mkstemps is unportable - "
|
Line 452 _GL_WARN_ON_USE (mkstemps, "mkstemps is unportable - "
|
| # endif |
# endif |
| #endif |
#endif |
| |
|
| |
#if @GNULIB_POSIX_OPENPT@ |
| |
/* Return an FD open to the master side of a pseudo-terminal. Flags should |
| |
include O_RDWR, and may also include O_NOCTTY. */ |
| |
# if !@HAVE_POSIX_OPENPT@ |
| |
_GL_FUNCDECL_SYS (posix_openpt, int, (int flags)); |
| |
# endif |
| |
_GL_CXXALIAS_SYS (posix_openpt, int, (int flags)); |
| |
_GL_CXXALIASWARN (posix_openpt); |
| |
#elif defined GNULIB_POSIXCHECK |
| |
# undef posix_openpt |
| |
# if HAVE_RAW_DECL_POSIX_OPENPT |
| |
_GL_WARN_ON_USE (posix_openpt, "posix_openpt is not portable - " |
| |
"use gnulib module posix_openpt for portability"); |
| |
# endif |
| |
#endif |
| |
|
| #if @GNULIB_PTSNAME@ |
#if @GNULIB_PTSNAME@ |
| /* Return the pathname of the pseudo-terminal slave associated with |
/* Return the pathname of the pseudo-terminal slave associated with |
| the master FD is open on, or NULL on errors. */ |
the master FD is open on, or NULL on errors. */ |
| # if !@HAVE_PTSNAME@ | # if @REPLACE_PTSNAME@ |
| | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| | # undef ptsname |
| | # define ptsname rpl_ptsname |
| | # endif |
| | _GL_FUNCDECL_RPL (ptsname, char *, (int fd)); |
| | _GL_CXXALIAS_RPL (ptsname, char *, (int fd)); |
| | # else |
| | # if !@HAVE_PTSNAME@ |
| _GL_FUNCDECL_SYS (ptsname, char *, (int fd)); |
_GL_FUNCDECL_SYS (ptsname, char *, (int fd)); |
| # endif | # endif |
| _GL_CXXALIAS_SYS (ptsname, char *, (int fd)); |
_GL_CXXALIAS_SYS (ptsname, char *, (int fd)); |
| |
# endif |
| _GL_CXXALIASWARN (ptsname); |
_GL_CXXALIASWARN (ptsname); |
| #elif defined GNULIB_POSIXCHECK |
#elif defined GNULIB_POSIXCHECK |
| # undef ptsname |
# undef ptsname |
|
Line 439 _GL_WARN_ON_USE (ptsname, "ptsname is not portable - "
|
Line 493 _GL_WARN_ON_USE (ptsname, "ptsname is not portable - "
|
| # endif |
# endif |
| #endif |
#endif |
| |
|
| |
#if @GNULIB_PTSNAME_R@ |
| |
/* Set the pathname of the pseudo-terminal slave associated with |
| |
the master FD is open on and return 0, or set errno and return |
| |
non-zero on errors. */ |
| |
# if @REPLACE_PTSNAME_R@ |
| |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| |
# undef ptsname_r |
| |
# define ptsname_r rpl_ptsname_r |
| |
# endif |
| |
_GL_FUNCDECL_RPL (ptsname_r, int, (int fd, char *buf, size_t len)); |
| |
_GL_CXXALIAS_RPL (ptsname_r, int, (int fd, char *buf, size_t len)); |
| |
# else |
| |
# if !@HAVE_PTSNAME_R@ |
| |
_GL_FUNCDECL_SYS (ptsname_r, int, (int fd, char *buf, size_t len)); |
| |
# endif |
| |
_GL_CXXALIAS_SYS (ptsname_r, int, (int fd, char *buf, size_t len)); |
| |
# endif |
| |
_GL_CXXALIASWARN (ptsname_r); |
| |
#elif defined GNULIB_POSIXCHECK |
| |
# undef ptsname_r |
| |
# if HAVE_RAW_DECL_PTSNAME_R |
| |
_GL_WARN_ON_USE (ptsname_r, "ptsname_r is not portable - " |
| |
"use gnulib module ptsname_r for portability"); |
| |
# endif |
| |
#endif |
| |
|
| #if @GNULIB_PUTENV@ |
#if @GNULIB_PUTENV@ |
| # if @REPLACE_PUTENV@ |
# if @REPLACE_PUTENV@ |
| # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
|
Line 453 _GL_CXXALIAS_SYS (putenv, int, (char *string));
|
Line 533 _GL_CXXALIAS_SYS (putenv, int, (char *string));
|
| _GL_CXXALIASWARN (putenv); |
_GL_CXXALIASWARN (putenv); |
| #endif |
#endif |
| |
|
| |
#if @GNULIB_QSORT_R@ |
| |
/* Sort an array of NMEMB elements, starting at address BASE, each element |
| |
occupying SIZE bytes, in ascending order according to the comparison |
| |
function COMPARE. */ |
| |
# if @REPLACE_QSORT_R@ |
| |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| |
# undef qsort_r |
| |
# define qsort_r rpl_qsort_r |
| |
# endif |
| |
_GL_FUNCDECL_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size, |
| |
int (*compare) (void const *, void const *, |
| |
void *), |
| |
void *arg) _GL_ARG_NONNULL ((1, 4))); |
| |
_GL_CXXALIAS_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size, |
| |
int (*compare) (void const *, void const *, |
| |
void *), |
| |
void *arg)); |
| |
# else |
| |
# if !@HAVE_QSORT_R@ |
| |
_GL_FUNCDECL_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size, |
| |
int (*compare) (void const *, void const *, |
| |
void *), |
| |
void *arg) _GL_ARG_NONNULL ((1, 4))); |
| |
# endif |
| |
_GL_CXXALIAS_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size, |
| |
int (*compare) (void const *, void const *, |
| |
void *), |
| |
void *arg)); |
| |
# endif |
| |
_GL_CXXALIASWARN (qsort_r); |
| |
#elif defined GNULIB_POSIXCHECK |
| |
# undef qsort_r |
| |
# if HAVE_RAW_DECL_QSORT_R |
| |
_GL_WARN_ON_USE (qsort_r, "qsort_r is not portable - " |
| |
"use gnulib module qsort_r for portability"); |
| |
# endif |
| |
#endif |
| |
|
| |
|
| #if @GNULIB_RANDOM_R@ |
#if @GNULIB_RANDOM_R@ |
| # if !@HAVE_RANDOM_R@ |
# if !@HAVE_RANDOM_R@ |
| # ifndef RAND_MAX |
# ifndef RAND_MAX |
|
Line 462 _GL_CXXALIASWARN (putenv);
|
Line 580 _GL_CXXALIASWARN (putenv);
|
| # endif |
# endif |
| #endif |
#endif |
| |
|
| |
|
| |
#if @GNULIB_RANDOM@ |
| |
# if @REPLACE_RANDOM@ |
| |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| |
# undef random |
| |
# define random rpl_random |
| |
# endif |
| |
_GL_FUNCDECL_RPL (random, long, (void)); |
| |
_GL_CXXALIAS_RPL (random, long, (void)); |
| |
# else |
| |
# if !@HAVE_RANDOM@ |
| |
_GL_FUNCDECL_SYS (random, long, (void)); |
| |
# endif |
| |
_GL_CXXALIAS_SYS (random, long, (void)); |
| |
# endif |
| |
_GL_CXXALIASWARN (random); |
| |
#elif defined GNULIB_POSIXCHECK |
| |
# undef random |
| |
# if HAVE_RAW_DECL_RANDOM |
| |
_GL_WARN_ON_USE (random, "random is unportable - " |
| |
"use gnulib module random for portability"); |
| |
# endif |
| |
#endif |
| |
|
| |
#if @GNULIB_RANDOM@ |
| |
# if @REPLACE_RANDOM@ |
| |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| |
# undef srandom |
| |
# define srandom rpl_srandom |
| |
# endif |
| |
_GL_FUNCDECL_RPL (srandom, void, (unsigned int seed)); |
| |
_GL_CXXALIAS_RPL (srandom, void, (unsigned int seed)); |
| |
# else |
| |
# if !@HAVE_RANDOM@ |
| |
_GL_FUNCDECL_SYS (srandom, void, (unsigned int seed)); |
| |
# endif |
| |
_GL_CXXALIAS_SYS (srandom, void, (unsigned int seed)); |
| |
# endif |
| |
_GL_CXXALIASWARN (srandom); |
| |
#elif defined GNULIB_POSIXCHECK |
| |
# undef srandom |
| |
# if HAVE_RAW_DECL_SRANDOM |
| |
_GL_WARN_ON_USE (srandom, "srandom is unportable - " |
| |
"use gnulib module random for portability"); |
| |
# endif |
| |
#endif |
| |
|
| |
#if @GNULIB_RANDOM@ |
| |
# if @REPLACE_INITSTATE@ |
| |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| |
# undef initstate |
| |
# define initstate rpl_initstate |
| |
# endif |
| |
_GL_FUNCDECL_RPL (initstate, char *, |
| |
(unsigned int seed, char *buf, size_t buf_size) |
| |
_GL_ARG_NONNULL ((2))); |
| |
_GL_CXXALIAS_RPL (initstate, char *, |
| |
(unsigned int seed, char *buf, size_t buf_size)); |
| |
# else |
| |
# if !@HAVE_INITSTATE@ || !@HAVE_DECL_INITSTATE@ |
| |
_GL_FUNCDECL_SYS (initstate, char *, |
| |
(unsigned int seed, char *buf, size_t buf_size) |
| |
_GL_ARG_NONNULL ((2))); |
| |
# endif |
| |
_GL_CXXALIAS_SYS (initstate, char *, |
| |
(unsigned int seed, char *buf, size_t buf_size)); |
| |
# endif |
| |
_GL_CXXALIASWARN (initstate); |
| |
#elif defined GNULIB_POSIXCHECK |
| |
# undef initstate |
| |
# if HAVE_RAW_DECL_INITSTATE |
| |
_GL_WARN_ON_USE (initstate, "initstate is unportable - " |
| |
"use gnulib module random for portability"); |
| |
# endif |
| |
#endif |
| |
|
| |
#if @GNULIB_RANDOM@ |
| |
# if @REPLACE_SETSTATE@ |
| |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| |
# undef setstate |
| |
# define setstate rpl_setstate |
| |
# endif |
| |
_GL_FUNCDECL_RPL (setstate, char *, (char *arg_state) _GL_ARG_NONNULL ((1))); |
| |
_GL_CXXALIAS_RPL (setstate, char *, (char *arg_state)); |
| |
# else |
| |
# if !@HAVE_SETSTATE@ || !@HAVE_DECL_SETSTATE@ |
| |
_GL_FUNCDECL_SYS (setstate, char *, (char *arg_state) _GL_ARG_NONNULL ((1))); |
| |
# endif |
| |
_GL_CXXALIAS_SYS (setstate, char *, (char *arg_state)); |
| |
# endif |
| |
_GL_CXXALIASWARN (setstate); |
| |
#elif defined GNULIB_POSIXCHECK |
| |
# undef setstate |
| |
# if HAVE_RAW_DECL_SETSTATE |
| |
_GL_WARN_ON_USE (setstate, "setstate is unportable - " |
| |
"use gnulib module random for portability"); |
| |
# endif |
| |
#endif |
| |
|
| |
|
| #if @GNULIB_RANDOM_R@ |
#if @GNULIB_RANDOM_R@ |
| # if !@HAVE_RANDOM_R@ | # if @REPLACE_RANDOM_R@ |
| | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| | # undef random_r |
| | # define random_r rpl_random_r |
| | # endif |
| | _GL_FUNCDECL_RPL (random_r, int, (struct random_data *buf, int32_t *result) |
| | _GL_ARG_NONNULL ((1, 2))); |
| | _GL_CXXALIAS_RPL (random_r, int, (struct random_data *buf, int32_t *result)); |
| | # else |
| | # if !@HAVE_RANDOM_R@ |
| _GL_FUNCDECL_SYS (random_r, int, (struct random_data *buf, int32_t *result) |
_GL_FUNCDECL_SYS (random_r, int, (struct random_data *buf, int32_t *result) |
| _GL_ARG_NONNULL ((1, 2))); |
_GL_ARG_NONNULL ((1, 2))); |
| # endif | # endif |
| _GL_CXXALIAS_SYS (random_r, int, (struct random_data *buf, int32_t *result)); |
_GL_CXXALIAS_SYS (random_r, int, (struct random_data *buf, int32_t *result)); |
| |
# endif |
| _GL_CXXALIASWARN (random_r); |
_GL_CXXALIASWARN (random_r); |
| #elif defined GNULIB_POSIXCHECK |
#elif defined GNULIB_POSIXCHECK |
| # undef random_r |
# undef random_r |
|
Line 478 _GL_WARN_ON_USE (random_r, "random_r is unportable - "
|
Line 706 _GL_WARN_ON_USE (random_r, "random_r is unportable - "
|
| #endif |
#endif |
| |
|
| #if @GNULIB_RANDOM_R@ |
#if @GNULIB_RANDOM_R@ |
| # if !@HAVE_RANDOM_R@ | # if @REPLACE_RANDOM_R@ |
| | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| | # undef srandom_r |
| | # define srandom_r rpl_srandom_r |
| | # endif |
| | _GL_FUNCDECL_RPL (srandom_r, int, |
| | (unsigned int seed, struct random_data *rand_state) |
| | _GL_ARG_NONNULL ((2))); |
| | _GL_CXXALIAS_RPL (srandom_r, int, |
| | (unsigned int seed, struct random_data *rand_state)); |
| | # else |
| | # if !@HAVE_RANDOM_R@ |
| _GL_FUNCDECL_SYS (srandom_r, int, |
_GL_FUNCDECL_SYS (srandom_r, int, |
| (unsigned int seed, struct random_data *rand_state) |
(unsigned int seed, struct random_data *rand_state) |
| _GL_ARG_NONNULL ((2))); |
_GL_ARG_NONNULL ((2))); |
| # endif | # endif |
| _GL_CXXALIAS_SYS (srandom_r, int, |
_GL_CXXALIAS_SYS (srandom_r, int, |
| (unsigned int seed, struct random_data *rand_state)); |
(unsigned int seed, struct random_data *rand_state)); |
| |
# endif |
| _GL_CXXALIASWARN (srandom_r); |
_GL_CXXALIASWARN (srandom_r); |
| #elif defined GNULIB_POSIXCHECK |
#elif defined GNULIB_POSIXCHECK |
| # undef srandom_r |
# undef srandom_r |
|
Line 495 _GL_WARN_ON_USE (srandom_r, "srandom_r is unportable -
|
Line 735 _GL_WARN_ON_USE (srandom_r, "srandom_r is unportable -
|
| #endif |
#endif |
| |
|
| #if @GNULIB_RANDOM_R@ |
#if @GNULIB_RANDOM_R@ |
| # if !@HAVE_RANDOM_R@ | # if @REPLACE_RANDOM_R@ |
| | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| | # undef initstate_r |
| | # define initstate_r rpl_initstate_r |
| | # endif |
| | _GL_FUNCDECL_RPL (initstate_r, int, |
| | (unsigned int seed, char *buf, size_t buf_size, |
| | struct random_data *rand_state) |
| | _GL_ARG_NONNULL ((2, 4))); |
| | _GL_CXXALIAS_RPL (initstate_r, int, |
| | (unsigned int seed, char *buf, size_t buf_size, |
| | struct random_data *rand_state)); |
| | # else |
| | # if !@HAVE_RANDOM_R@ |
| _GL_FUNCDECL_SYS (initstate_r, int, |
_GL_FUNCDECL_SYS (initstate_r, int, |
| (unsigned int seed, char *buf, size_t buf_size, |
(unsigned int seed, char *buf, size_t buf_size, |
| struct random_data *rand_state) |
struct random_data *rand_state) |
| _GL_ARG_NONNULL ((2, 4))); |
_GL_ARG_NONNULL ((2, 4))); |
| # endif | # endif |
| _GL_CXXALIAS_SYS (initstate_r, int, |
_GL_CXXALIAS_SYS (initstate_r, int, |
| (unsigned int seed, char *buf, size_t buf_size, |
(unsigned int seed, char *buf, size_t buf_size, |
| struct random_data *rand_state)); |
struct random_data *rand_state)); |
| |
# endif |
| _GL_CXXALIASWARN (initstate_r); |
_GL_CXXALIASWARN (initstate_r); |
| #elif defined GNULIB_POSIXCHECK |
#elif defined GNULIB_POSIXCHECK |
| # undef initstate_r |
# undef initstate_r |
|
Line 514 _GL_WARN_ON_USE (initstate_r, "initstate_r is unportab
|
Line 768 _GL_WARN_ON_USE (initstate_r, "initstate_r is unportab
|
| #endif |
#endif |
| |
|
| #if @GNULIB_RANDOM_R@ |
#if @GNULIB_RANDOM_R@ |
| # if !@HAVE_RANDOM_R@ | # if @REPLACE_RANDOM_R@ |
| | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| | # undef setstate_r |
| | # define setstate_r rpl_setstate_r |
| | # endif |
| | _GL_FUNCDECL_RPL (setstate_r, int, |
| | (char *arg_state, struct random_data *rand_state) |
| | _GL_ARG_NONNULL ((1, 2))); |
| | _GL_CXXALIAS_RPL (setstate_r, int, |
| | (char *arg_state, struct random_data *rand_state)); |
| | # else |
| | # if !@HAVE_RANDOM_R@ |
| _GL_FUNCDECL_SYS (setstate_r, int, |
_GL_FUNCDECL_SYS (setstate_r, int, |
| (char *arg_state, struct random_data *rand_state) |
(char *arg_state, struct random_data *rand_state) |
| _GL_ARG_NONNULL ((1, 2))); |
_GL_ARG_NONNULL ((1, 2))); |
| # endif | # endif |
| _GL_CXXALIAS_SYS (setstate_r, int, |
_GL_CXXALIAS_SYS (setstate_r, int, |
| (char *arg_state, struct random_data *rand_state)); |
(char *arg_state, struct random_data *rand_state)); |
| |
# endif |
| _GL_CXXALIASWARN (setstate_r); |
_GL_CXXALIASWARN (setstate_r); |
| #elif defined GNULIB_POSIXCHECK |
#elif defined GNULIB_POSIXCHECK |
| # undef setstate_r |
# undef setstate_r |
|
Line 551 _GL_WARN_ON_USE (realloc, "realloc is not POSIX compli
|
Line 817 _GL_WARN_ON_USE (realloc, "realloc is not POSIX compli
|
| "use gnulib module realloc-posix for portability"); |
"use gnulib module realloc-posix for portability"); |
| #endif |
#endif |
| |
|
| |
|
| |
#if @GNULIB_REALLOCARRAY@ |
| |
# if ! @HAVE_REALLOCARRAY@ |
| |
_GL_FUNCDECL_SYS (reallocarray, void *, |
| |
(void *ptr, size_t nmemb, size_t size)); |
| |
# endif |
| |
_GL_CXXALIAS_SYS (reallocarray, void *, |
| |
(void *ptr, size_t nmemb, size_t size)); |
| |
_GL_CXXALIASWARN (reallocarray); |
| |
#elif defined GNULIB_POSIXCHECK |
| |
# undef reallocarray |
| |
# if HAVE_RAW_DECL_REALLOCARRAY |
| |
_GL_WARN_ON_USE (reallocarray, "reallocarray is not portable - " |
| |
"use gnulib module reallocarray for portability"); |
| |
# endif |
| |
#endif |
| |
|
| #if @GNULIB_REALPATH@ |
#if @GNULIB_REALPATH@ |
| # if @REPLACE_REALPATH@ |
# if @REPLACE_REALPATH@ |
| # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
|
Line 591 _GL_WARN_ON_USE (rpmatch, "rpmatch is unportable - "
|
Line 874 _GL_WARN_ON_USE (rpmatch, "rpmatch is unportable - "
|
| # endif |
# endif |
| #endif |
#endif |
| |
|
| |
#if @GNULIB_SECURE_GETENV@ |
| |
/* Look up NAME in the environment, returning 0 in insecure situations. */ |
| |
# if !@HAVE_SECURE_GETENV@ |
| |
_GL_FUNCDECL_SYS (secure_getenv, char *, |
| |
(char const *name) _GL_ARG_NONNULL ((1))); |
| |
# endif |
| |
_GL_CXXALIAS_SYS (secure_getenv, char *, (char const *name)); |
| |
_GL_CXXALIASWARN (secure_getenv); |
| |
#elif defined GNULIB_POSIXCHECK |
| |
# undef secure_getenv |
| |
# if HAVE_RAW_DECL_SECURE_GETENV |
| |
_GL_WARN_ON_USE (secure_getenv, "secure_getenv is unportable - " |
| |
"use gnulib module secure_getenv for portability"); |
| |
# endif |
| |
#endif |
| |
|
| #if @GNULIB_SETENV@ |
#if @GNULIB_SETENV@ |
| /* Set NAME to VALUE in the environment. |
/* Set NAME to VALUE in the environment. |
| If REPLACE is nonzero, overwrite an existing value. */ |
If REPLACE is nonzero, overwrite an existing value. */ |
|
Line 630 _GL_WARN_ON_USE (setenv, "setenv is unportable - "
|
Line 929 _GL_WARN_ON_USE (setenv, "setenv is unportable - "
|
| # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| # define strtod rpl_strtod |
# define strtod rpl_strtod |
| # endif |
# endif |
| |
# define GNULIB_defined_strtod_function 1 |
| _GL_FUNCDECL_RPL (strtod, double, (const char *str, char **endp) |
_GL_FUNCDECL_RPL (strtod, double, (const char *str, char **endp) |
| _GL_ARG_NONNULL ((1))); |
_GL_ARG_NONNULL ((1))); |
| _GL_CXXALIAS_RPL (strtod, double, (const char *str, char **endp)); |
_GL_CXXALIAS_RPL (strtod, double, (const char *str, char **endp)); |
|
Line 646 _GL_CXXALIASWARN (strtod);
|
Line 946 _GL_CXXALIASWARN (strtod);
|
| # if HAVE_RAW_DECL_STRTOD |
# if HAVE_RAW_DECL_STRTOD |
| _GL_WARN_ON_USE (strtod, "strtod is unportable - " |
_GL_WARN_ON_USE (strtod, "strtod is unportable - " |
| "use gnulib module strtod for portability"); |
"use gnulib module strtod for portability"); |
| |
# endif |
| |
#endif |
| |
|
| |
#if @GNULIB_STRTOLD@ |
| |
/* Parse a 'long double' from STRING, updating ENDP if appropriate. */ |
| |
# if @REPLACE_STRTOLD@ |
| |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| |
# define strtold rpl_strtold |
| |
# endif |
| |
# define GNULIB_defined_strtold_function 1 |
| |
_GL_FUNCDECL_RPL (strtold, long double, (const char *str, char **endp) |
| |
_GL_ARG_NONNULL ((1))); |
| |
_GL_CXXALIAS_RPL (strtold, long double, (const char *str, char **endp)); |
| |
# else |
| |
# if !@HAVE_STRTOLD@ |
| |
_GL_FUNCDECL_SYS (strtold, long double, (const char *str, char **endp) |
| |
_GL_ARG_NONNULL ((1))); |
| |
# endif |
| |
_GL_CXXALIAS_SYS (strtold, long double, (const char *str, char **endp)); |
| |
# endif |
| |
_GL_CXXALIASWARN (strtold); |
| |
#elif defined GNULIB_POSIXCHECK |
| |
# undef strtold |
| |
# if HAVE_RAW_DECL_STRTOLD |
| |
_GL_WARN_ON_USE (strtold, "strtold is unportable - " |
| |
"use gnulib module strtold for portability"); |
| # endif |
# endif |
| #endif |
#endif |
| |
|