1 /* A GNU-like <stdlib.h>.
3 Copyright (C) 1995, 2001-2004, 2006-2024 Free Software Foundation, Inc.
5 This file is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as
7 published by the Free Software Foundation; either version 2.1 of the
8 License, or (at your option) any later version.
10 This file is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public License
16 along with this program. If not, see <https://www.gnu.org/licenses/>. */
19 @PRAGMA_SYSTEM_HEADER@
23 #if defined __need_system_stdlib_h || defined __need_malloc_and_calloc
24 /* Special invocation conventions inside some gnulib header files,
25 and inside some glibc header files, respectively. */
27 #@INCLUDE_NEXT@ @NEXT_STDLIB_H@
30 /* Normal invocation convention. */
32 #ifndef _@GUARD_PREFIX@_STDLIB_H
34 /* The include_next requires a split double-inclusion guard. */
35 #@INCLUDE_NEXT@ @NEXT_STDLIB_H@
37 #ifndef _@GUARD_PREFIX@_STDLIB_H
38 #define _@GUARD_PREFIX@_STDLIB_H
40 /* This file uses _Noreturn, _GL_ATTRIBUTE_DEALLOC, _GL_ATTRIBUTE_MALLOC,
41 _GL_ATTRIBUTE_NOTHROW, _GL_ATTRIBUTE_PURE, GNULIB_POSIXCHECK,
43 #if !_GL_CONFIG_H_INCLUDED
44 #error "Please include config.h first."
47 /* NetBSD 5.0 mis-defines NULL. */
50 /* MirBSD 10 defines WEXITSTATUS in <sys/wait.h>, not in <stdlib.h>. */
51 #if @GNULIB_SYSTEM_POSIX@ && !defined WEXITSTATUS
52 # include <sys/wait.h>
55 /* Solaris declares getloadavg() in <sys/loadavg.h>. */
56 #if (@GNULIB_GETLOADAVG@ || defined GNULIB_POSIXCHECK) && @HAVE_SYS_LOADAVG_H@
57 /* OpenIndiana has a bug: <sys/time.h> must be included before
59 # include <sys/time.h>
60 # include <sys/loadavg.h>
63 /* Native Windows platforms declare _mktemp() in <io.h>. */
64 #if defined _WIN32 && !defined __CYGWIN__
70 /* OSF/1 5.1 declares 'struct random_data' in <random.h>, which is included
71 from <stdlib.h> if _REENTRANT is defined. Include it whenever we need
72 'struct random_data'. */
79 # if !@HAVE_STRUCT_RANDOM_DATA@
80 /* Define 'struct random_data'.
81 But allow multiple gnulib generated <stdlib.h> replacements to coexist. */
82 # if !GNULIB_defined_struct_random_data
85 int32_t *fptr
; /* Front pointer. */
86 int32_t *rptr
; /* Rear pointer. */
87 int32_t *state
; /* Array of state values. */
88 int rand_type
; /* Type of random number generator. */
89 int rand_deg
; /* Degree of random number generator. */
90 int rand_sep
; /* Distance between front and rear. */
91 int32_t *end_ptr
; /* Pointer behind state table. */
93 # define GNULIB_defined_struct_random_data 1
98 #if (@GNULIB_MKSTEMP@ || @GNULIB_MKSTEMPS@ || @GNULIB_MKOSTEMP@ || @GNULIB_MKOSTEMPS@ || @GNULIB_GETSUBOPT@ || defined GNULIB_POSIXCHECK) && ! defined __GLIBC__ && !(defined _WIN32 && ! defined __CYGWIN__)
99 /* On Mac OS X 10.3, only <unistd.h> declares mkstemp. */
100 /* On Mac OS X 10.5, only <unistd.h> declares mkstemps. */
101 /* On Mac OS X 10.13, only <unistd.h> declares mkostemp and mkostemps. */
102 /* On Cygwin 1.7.1, only <unistd.h> declares getsubopt. */
103 /* But avoid namespace pollution on glibc systems and native Windows. */
107 /* _GL_ATTRIBUTE_DEALLOC (F, I) declares that the function returns pointers
108 that can be freed by passing them as the Ith argument to the
110 #ifndef _GL_ATTRIBUTE_DEALLOC
112 # define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
114 # define _GL_ATTRIBUTE_DEALLOC(f, i)
118 /* _GL_ATTRIBUTE_DEALLOC_FREE declares that the function returns pointers that
119 can be freed via 'free'; it can be used only after declaring 'free'. */
120 /* Applies to: functions. Cannot be used on inline functions. */
121 #ifndef _GL_ATTRIBUTE_DEALLOC_FREE
122 # define _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_DEALLOC (free, 1)
125 /* _GL_ATTRIBUTE_MALLOC declares that the function returns a pointer to freshly
127 /* Applies to: functions. */
128 #ifndef _GL_ATTRIBUTE_MALLOC
129 # if __GNUC__ >= 3 || defined __clang__
130 # define _GL_ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
132 # define _GL_ATTRIBUTE_MALLOC
136 /* _GL_ATTRIBUTE_NOTHROW declares that the function does not throw exceptions.
138 #ifndef _GL_ATTRIBUTE_NOTHROW
139 # if defined __cplusplus
140 # if (__GNUC__ + (__GNUC_MINOR__ >= 8) > 2) || __clang_major >= 4
141 # if __cplusplus >= 201103L
142 # define _GL_ATTRIBUTE_NOTHROW noexcept (true)
144 # define _GL_ATTRIBUTE_NOTHROW throw ()
147 # define _GL_ATTRIBUTE_NOTHROW
150 # if (__GNUC__ + (__GNUC_MINOR__ >= 3) > 3) || defined __clang__
151 # define _GL_ATTRIBUTE_NOTHROW __attribute__ ((__nothrow__))
153 # define _GL_ATTRIBUTE_NOTHROW
158 /* The __attribute__ feature is available in gcc versions 2.5 and later.
159 The attribute __pure__ was added in gcc 2.96. */
160 #ifndef _GL_ATTRIBUTE_PURE
161 # if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || defined __clang__
162 # define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
164 # define _GL_ATTRIBUTE_PURE /* empty */
168 /* The definition of _Noreturn is copied here. */
170 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
172 /* The definition of _GL_ARG_NONNULL is copied here. */
174 /* The definition of _GL_WARN_ON_USE is copied here. */
177 /* Some systems do not define EXIT_*, despite otherwise supporting C89. */
179 # define EXIT_SUCCESS 0
181 /* Tandem/NSK and other platforms that define EXIT_FAILURE as -1 interfere
182 with proper operation of xargs. */
184 # define EXIT_FAILURE 1
185 #elif EXIT_FAILURE != 1
187 # define EXIT_FAILURE 1
192 /* Terminate the current process with the given return code, without running
193 the 'atexit' handlers. */
195 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
197 # define _Exit rpl__Exit
199 _GL_FUNCDECL_RPL (_Exit
, _Noreturn
void, (int status
));
200 _GL_CXXALIAS_RPL (_Exit
, void, (int status
));
203 _GL_FUNCDECL_SYS (_Exit
, _Noreturn
void, (int status
));
205 _GL_CXXALIAS_SYS (_Exit
, void, (int status
));
208 _GL_CXXALIASWARN (_Exit
);
210 #elif defined GNULIB_POSIXCHECK
212 # if HAVE_RAW_DECL__EXIT
213 _GL_WARN_ON_USE (_Exit
, "_Exit is unportable - "
214 "use gnulib module _Exit for portability");
219 #if @GNULIB_FREE_POSIX@
221 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
223 # define free rpl_free
225 # if defined __cplusplus && (__GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2)
226 _GL_FUNCDECL_RPL (free
, void, (void *ptr
) _GL_ATTRIBUTE_NOTHROW
);
228 _GL_FUNCDECL_RPL (free
, void, (void *ptr
));
230 _GL_CXXALIAS_RPL (free
, void, (void *ptr
));
232 _GL_CXXALIAS_SYS (free
, void, (void *ptr
));
235 _GL_CXXALIASWARN (free
);
237 #elif defined GNULIB_POSIXCHECK
239 /* Assume free is always declared. */
240 _GL_WARN_ON_USE (free
, "free is not future POSIX compliant everywhere - "
241 "use gnulib module free for portability");
245 /* Allocate memory with indefinite extent and specified alignment. */
246 #if @GNULIB_ALIGNED_ALLOC@
247 # if @REPLACE_ALIGNED_ALLOC@
248 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
249 # undef aligned_alloc
250 # define aligned_alloc rpl_aligned_alloc
252 _GL_FUNCDECL_RPL (aligned_alloc
, void *,
253 (size_t alignment
, size_t size
)
254 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
);
255 _GL_CXXALIAS_RPL (aligned_alloc
, void *, (size_t alignment
, size_t size
));
257 # if @HAVE_ALIGNED_ALLOC@
259 /* For -Wmismatched-dealloc: Associate aligned_alloc with free or rpl_free. */
260 # if __GLIBC__ + (__GLIBC_MINOR__ >= 16) > 2
261 _GL_FUNCDECL_SYS (aligned_alloc
, void *,
262 (size_t alignment
, size_t size
)
263 _GL_ATTRIBUTE_NOTHROW
264 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
);
266 _GL_FUNCDECL_SYS (aligned_alloc
, void *,
267 (size_t alignment
, size_t size
)
268 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
);
271 _GL_CXXALIAS_SYS (aligned_alloc
, void *, (size_t alignment
, size_t size
));
274 # if (__GLIBC__ >= 2) && @HAVE_ALIGNED_ALLOC@
275 _GL_CXXALIASWARN (aligned_alloc
);
278 # if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined aligned_alloc
279 /* For -Wmismatched-dealloc: Associate aligned_alloc with free or rpl_free. */
280 # if __GLIBC__ + (__GLIBC_MINOR__ >= 16) > 2
281 _GL_FUNCDECL_SYS (aligned_alloc
, void *,
282 (size_t alignment
, size_t size
)
283 _GL_ATTRIBUTE_NOTHROW
284 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
);
286 _GL_FUNCDECL_SYS (aligned_alloc
, void *,
287 (size_t alignment
, size_t size
)
288 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
);
291 # if defined GNULIB_POSIXCHECK
292 # undef aligned_alloc
293 # if HAVE_RAW_DECL_ALIGNED_ALLOC
294 _GL_WARN_ON_USE (aligned_alloc
, "aligned_alloc is not portable - "
295 "use gnulib module aligned_alloc for portability");
301 /* Parse a signed decimal integer.
302 Returns the value of the integer. Errors are not detected. */
304 _GL_FUNCDECL_SYS (atoll
, long long, (const char *string
)
306 _GL_ARG_NONNULL ((1)));
308 _GL_CXXALIAS_SYS (atoll
, long long, (const char *string
));
309 _GL_CXXALIASWARN (atoll
);
310 #elif defined GNULIB_POSIXCHECK
312 # if HAVE_RAW_DECL_ATOLL
313 _GL_WARN_ON_USE (atoll
, "atoll is unportable - "
314 "use gnulib module atoll for portability");
318 #if @GNULIB_CALLOC_POSIX@
319 # if (@GNULIB_CALLOC_POSIX@ && @REPLACE_CALLOC_FOR_CALLOC_POSIX@) \
320 || (@GNULIB_CALLOC_GNU@ && @REPLACE_CALLOC_FOR_CALLOC_GNU@)
321 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
323 # define calloc rpl_calloc
325 _GL_FUNCDECL_RPL (calloc
, void *,
326 (size_t nmemb
, size_t size
)
327 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
);
328 _GL_CXXALIAS_RPL (calloc
, void *, (size_t nmemb
, size_t size
));
331 /* For -Wmismatched-dealloc: Associate calloc with free or rpl_free. */
332 # if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2
333 _GL_FUNCDECL_SYS (calloc
, void *,
334 (size_t nmemb
, size_t size
)
335 _GL_ATTRIBUTE_NOTHROW
336 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
);
338 _GL_FUNCDECL_SYS (calloc
, void *,
339 (size_t nmemb
, size_t size
)
340 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
);
343 _GL_CXXALIAS_SYS (calloc
, void *, (size_t nmemb
, size_t size
));
346 _GL_CXXALIASWARN (calloc
);
349 # if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined calloc
350 /* For -Wmismatched-dealloc: Associate calloc with free or rpl_free. */
351 # if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2
352 _GL_FUNCDECL_SYS (calloc
, void *,
353 (size_t nmemb
, size_t size
)
354 _GL_ATTRIBUTE_NOTHROW
355 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
);
357 _GL_FUNCDECL_SYS (calloc
, void *,
358 (size_t nmemb
, size_t size
)
359 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
);
362 # if defined GNULIB_POSIXCHECK
364 /* Assume calloc is always declared. */
365 _GL_WARN_ON_USE (calloc
, "calloc is not POSIX compliant everywhere - "
366 "use gnulib module calloc-posix for portability");
370 #if @GNULIB_CANONICALIZE_FILE_NAME@
371 # if @REPLACE_CANONICALIZE_FILE_NAME@
372 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
373 # define canonicalize_file_name rpl_canonicalize_file_name
375 _GL_FUNCDECL_RPL (canonicalize_file_name
, char *,
377 _GL_ARG_NONNULL ((1))
378 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
);
379 _GL_CXXALIAS_RPL (canonicalize_file_name
, char *, (const char *name
));
381 # if !@HAVE_CANONICALIZE_FILE_NAME@ || __GNUC__ >= 11
382 # if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
383 _GL_FUNCDECL_SYS (canonicalize_file_name
, char *,
385 _GL_ATTRIBUTE_NOTHROW
386 _GL_ARG_NONNULL ((1))
387 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
);
389 _GL_FUNCDECL_SYS (canonicalize_file_name
, char *,
391 _GL_ARG_NONNULL ((1))
392 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
);
395 _GL_CXXALIAS_SYS (canonicalize_file_name
, char *, (const char *name
));
397 # ifndef GNULIB_defined_canonicalize_file_name
398 # define GNULIB_defined_canonicalize_file_name \
399 (!@HAVE_CANONICALIZE_FILE_NAME@ || @REPLACE_CANONICALIZE_FILE_NAME@)
401 _GL_CXXALIASWARN (canonicalize_file_name
);
403 # if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined canonicalize_file_name
404 /* For -Wmismatched-dealloc: Associate canonicalize_file_name with free or
406 # if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
407 _GL_FUNCDECL_SYS (canonicalize_file_name
, char *,
409 _GL_ATTRIBUTE_NOTHROW
410 _GL_ARG_NONNULL ((1))
411 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
);
413 _GL_FUNCDECL_SYS (canonicalize_file_name
, char *,
415 _GL_ARG_NONNULL ((1))
416 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
);
419 # if defined GNULIB_POSIXCHECK
420 # undef canonicalize_file_name
421 # if HAVE_RAW_DECL_CANONICALIZE_FILE_NAME
422 _GL_WARN_ON_USE (canonicalize_file_name
,
423 "canonicalize_file_name is unportable - "
424 "use gnulib module canonicalize-lgpl for portability");
429 #if @GNULIB_MDA_ECVT@
430 /* On native Windows, map 'ecvt' to '_ecvt', so that -loldnames is not
431 required. In C++ with GNULIB_NAMESPACE, avoid differences between
432 platforms by defining GNULIB_NAMESPACE::ecvt on all platforms that have
434 # if defined _WIN32 && !defined __CYGWIN__
435 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
439 _GL_CXXALIAS_MDA (ecvt
, char *,
440 (double number
, int ndigits
, int *decptp
, int *signp
));
442 # if @HAVE_DECL_ECVT@
443 _GL_CXXALIAS_SYS (ecvt
, char *,
444 (double number
, int ndigits
, int *decptp
, int *signp
));
447 # if (defined _WIN32 && !defined __CYGWIN__) || @HAVE_DECL_ECVT@
448 _GL_CXXALIASWARN (ecvt
);
452 #if @GNULIB_MDA_FCVT@
453 /* On native Windows, map 'fcvt' to '_fcvt', so that -loldnames is not
454 required. In C++ with GNULIB_NAMESPACE, avoid differences between
455 platforms by defining GNULIB_NAMESPACE::fcvt on all platforms that have
457 # if defined _WIN32 && !defined __CYGWIN__
458 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
462 _GL_CXXALIAS_MDA (fcvt
, char *,
463 (double number
, int ndigits
, int *decptp
, int *signp
));
465 # if @HAVE_DECL_FCVT@
466 _GL_CXXALIAS_SYS (fcvt
, char *,
467 (double number
, int ndigits
, int *decptp
, int *signp
));
470 # if (defined _WIN32 && !defined __CYGWIN__) || @HAVE_DECL_FCVT@
471 _GL_CXXALIASWARN (fcvt
);
475 #if @GNULIB_MDA_GCVT@
476 /* On native Windows, map 'gcvt' to '_gcvt', so that -loldnames is not
477 required. In C++ with GNULIB_NAMESPACE, avoid differences between
478 platforms by defining GNULIB_NAMESPACE::gcvt on all platforms that have
480 # if defined _WIN32 && !defined __CYGWIN__
481 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
485 _GL_CXXALIAS_MDA (gcvt
, char *, (double number
, int ndigits
, char *buf
));
487 # if @HAVE_DECL_GCVT@
488 _GL_CXXALIAS_SYS (gcvt
, char *, (double number
, int ndigits
, char *buf
));
491 # if (defined _WIN32 && !defined __CYGWIN__) || @HAVE_DECL_GCVT@
492 _GL_CXXALIASWARN (gcvt
);
496 #if @GNULIB_GETLOADAVG@
497 /* Store max(NELEM,3) load average numbers in LOADAVG[].
498 The three numbers are the load average of the last 1 minute, the last 5
499 minutes, and the last 15 minutes, respectively.
500 LOADAVG is an array of NELEM numbers. */
501 # if @REPLACE_GETLOADAVG@
502 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
504 # define getloadavg rpl_getloadavg
506 _GL_FUNCDECL_RPL (getloadavg
, int, (double loadavg
[], int nelem
)
507 _GL_ARG_NONNULL ((1)));
508 _GL_CXXALIAS_RPL (getloadavg
, int, (double loadavg
[], int nelem
));
510 # if !@HAVE_DECL_GETLOADAVG@
511 _GL_FUNCDECL_SYS (getloadavg
, int, (double loadavg
[], int nelem
)
512 _GL_ARG_NONNULL ((1)));
514 _GL_CXXALIAS_SYS (getloadavg
, int, (double loadavg
[], int nelem
));
517 _GL_CXXALIASWARN (getloadavg
);
519 #elif defined GNULIB_POSIXCHECK
521 # if HAVE_RAW_DECL_GETLOADAVG
522 _GL_WARN_ON_USE (getloadavg
, "getloadavg is not portable - "
523 "use gnulib module getloadavg for portability");
527 #if @GNULIB_GETPROGNAME@
528 /* Return the base name of the executing program.
529 On native Windows this will usually end in ".exe" or ".EXE". */
530 # if @REPLACE_GETPROGNAME@
531 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
533 # define getprogname rpl_getprogname
535 # if @HAVE_DECL_PROGRAM_INVOCATION_NAME@
536 _GL_FUNCDECL_RPL (getprogname
, const char *, (void) _GL_ATTRIBUTE_PURE
);
538 _GL_FUNCDECL_RPL (getprogname
, const char *, (void));
540 _GL_CXXALIAS_RPL (getprogname
, const char *, (void));
542 # if !@HAVE_GETPROGNAME@
543 # if @HAVE_DECL_PROGRAM_INVOCATION_NAME@
544 _GL_FUNCDECL_SYS (getprogname
, const char *, (void) _GL_ATTRIBUTE_PURE
);
546 _GL_FUNCDECL_SYS (getprogname
, const char *, (void));
549 _GL_CXXALIAS_SYS (getprogname
, const char *, (void));
552 _GL_CXXALIASWARN (getprogname
);
554 #elif defined GNULIB_POSIXCHECK
556 # if HAVE_RAW_DECL_GETPROGNAME
557 _GL_WARN_ON_USE (getprogname
, "getprogname is unportable - "
558 "use gnulib module getprogname for portability");
562 #if @GNULIB_GETSUBOPT@
563 /* Assuming *OPTIONP is a comma separated list of elements of the form
564 "token" or "token=value", getsubopt parses the first of these elements.
565 If the first element refers to a "token" that is member of the given
566 NULL-terminated array of tokens:
567 - It replaces the comma with a NUL byte, updates *OPTIONP to point past
568 the first option and the comma, sets *VALUEP to the value of the
569 element (or NULL if it doesn't contain an "=" sign),
570 - It returns the index of the "token" in the given array of tokens.
571 Otherwise it returns -1, and *OPTIONP and *VALUEP are undefined.
572 For more details see the POSIX specification.
573 https://pubs.opengroup.org/onlinepubs/9699919799/functions/getsubopt.html */
574 # if @REPLACE_GETSUBOPT@
575 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
577 # define getsubopt rpl_getsubopt
579 _GL_FUNCDECL_RPL (getsubopt
, int,
580 (char **optionp
, char *const *tokens
, char **valuep
)
581 _GL_ARG_NONNULL ((1, 2, 3)));
582 _GL_CXXALIAS_RPL (getsubopt
, int,
583 (char **optionp
, char *const *tokens
, char **valuep
));
585 # if !@HAVE_GETSUBOPT@
586 _GL_FUNCDECL_SYS (getsubopt
, int,
587 (char **optionp
, char *const *tokens
, char **valuep
)
588 _GL_ARG_NONNULL ((1, 2, 3)));
590 _GL_CXXALIAS_SYS (getsubopt
, int,
591 (char **optionp
, char *const *tokens
, char **valuep
));
594 _GL_CXXALIASWARN (getsubopt
);
596 #elif defined GNULIB_POSIXCHECK
598 # if HAVE_RAW_DECL_GETSUBOPT
599 _GL_WARN_ON_USE (getsubopt
, "getsubopt is unportable - "
600 "use gnulib module getsubopt for portability");
605 /* Change the ownership and access permission of the slave side of the
606 pseudo-terminal whose master side is specified by FD. */
608 _GL_FUNCDECL_SYS (grantpt
, int, (int fd
));
610 _GL_CXXALIAS_SYS (grantpt
, int, (int fd
));
611 _GL_CXXALIASWARN (grantpt
);
612 #elif defined GNULIB_POSIXCHECK
614 # if HAVE_RAW_DECL_GRANTPT
615 _GL_WARN_ON_USE (grantpt
, "grantpt is not portable - "
616 "use gnulib module grantpt for portability");
620 /* If _GL_USE_STDLIB_ALLOC is nonzero, the including module does not
621 rely on GNU or POSIX semantics for malloc and realloc (for example,
622 by never specifying a zero size), so it does not need malloc or
623 realloc to be redefined. */
624 #if @GNULIB_MALLOC_POSIX@
625 # if (@GNULIB_MALLOC_POSIX@ && @REPLACE_MALLOC_FOR_MALLOC_POSIX@) \
626 || (@GNULIB_MALLOC_GNU@ && @REPLACE_MALLOC_FOR_MALLOC_GNU@)
627 # if !((defined __cplusplus && defined GNULIB_NAMESPACE) \
628 || _GL_USE_STDLIB_ALLOC)
630 # define malloc rpl_malloc
632 _GL_FUNCDECL_RPL (malloc
, void *,
634 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
);
635 _GL_CXXALIAS_RPL (malloc
, void *, (size_t size
));
638 /* For -Wmismatched-dealloc: Associate malloc with free or rpl_free. */
639 # if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2
640 _GL_FUNCDECL_SYS (malloc
, void *,
642 _GL_ATTRIBUTE_NOTHROW
643 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
);
645 _GL_FUNCDECL_SYS (malloc
, void *,
647 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
);
650 _GL_CXXALIAS_SYS (malloc
, void *, (size_t size
));
653 _GL_CXXALIASWARN (malloc
);
656 # if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined malloc
657 /* For -Wmismatched-dealloc: Associate malloc with free or rpl_free. */
658 # if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2
659 _GL_FUNCDECL_SYS (malloc
, void *,
661 _GL_ATTRIBUTE_NOTHROW
662 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
);
664 _GL_FUNCDECL_SYS (malloc
, void *,
666 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
);
669 # if defined GNULIB_POSIXCHECK && !_GL_USE_STDLIB_ALLOC
671 /* Assume malloc is always declared. */
672 _GL_WARN_ON_USE (malloc
, "malloc is not POSIX compliant everywhere - "
673 "use gnulib module malloc-posix for portability");
677 /* Return maximum number of bytes of a multibyte character. */
678 #if @REPLACE_MB_CUR_MAX@
679 # if !GNULIB_defined_MB_CUR_MAX
681 int gl_MB_CUR_MAX (void)
683 /* Turn the value 3 to the value 4, as needed for the UTF-8 encoding. */
684 return MB_CUR_MAX
+ (MB_CUR_MAX
== 3);
687 # define MB_CUR_MAX gl_MB_CUR_MAX ()
688 # define GNULIB_defined_MB_CUR_MAX 1
692 /* Convert a string to a wide string. */
693 #if @GNULIB_MBSTOWCS@
694 # if @REPLACE_MBSTOWCS@
695 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
697 # define mbstowcs rpl_mbstowcs
699 _GL_FUNCDECL_RPL (mbstowcs
, size_t,
700 (wchar_t *restrict dest
, const char *restrict src
,
702 _GL_ARG_NONNULL ((2)));
703 _GL_CXXALIAS_RPL (mbstowcs
, size_t,
704 (wchar_t *restrict dest
, const char *restrict src
,
707 _GL_CXXALIAS_SYS (mbstowcs
, size_t,
708 (wchar_t *restrict dest
, const char *restrict src
,
712 _GL_CXXALIASWARN (mbstowcs
);
714 #elif defined GNULIB_POSIXCHECK
716 # if HAVE_RAW_DECL_MBSTOWCS
717 _GL_WARN_ON_USE (mbstowcs
, "mbstowcs is unportable - "
718 "use gnulib module mbstowcs for portability");
722 /* Convert a multibyte character to a wide character. */
724 # if @REPLACE_MBTOWC@
725 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
727 # define mbtowc rpl_mbtowc
729 _GL_FUNCDECL_RPL (mbtowc
, int,
730 (wchar_t *restrict pwc
, const char *restrict s
, size_t n
));
731 _GL_CXXALIAS_RPL (mbtowc
, int,
732 (wchar_t *restrict pwc
, const char *restrict s
, size_t n
));
735 _GL_FUNCDECL_SYS (mbtowc
, int,
736 (wchar_t *restrict pwc
, const char *restrict s
, size_t n
));
738 _GL_CXXALIAS_SYS (mbtowc
, int,
739 (wchar_t *restrict pwc
, const char *restrict s
, size_t n
));
742 _GL_CXXALIASWARN (mbtowc
);
744 #elif defined GNULIB_POSIXCHECK
746 # if HAVE_RAW_DECL_MBTOWC
747 _GL_WARN_ON_USE (mbtowc
, "mbtowc is not portable - "
748 "use gnulib module mbtowc for portability");
753 /* Create a unique temporary directory from TEMPLATE.
754 The last six characters of TEMPLATE must be "XXXXXX";
755 they are replaced with a string that makes the directory name unique.
756 Returns TEMPLATE, or a null pointer if it cannot get a unique name.
757 The directory is created mode 700. */
759 _GL_FUNCDECL_SYS (mkdtemp
, char *, (char * /*template*/) _GL_ARG_NONNULL ((1)));
761 _GL_CXXALIAS_SYS (mkdtemp
, char *, (char * /*template*/));
762 _GL_CXXALIASWARN (mkdtemp
);
763 #elif defined GNULIB_POSIXCHECK
765 # if HAVE_RAW_DECL_MKDTEMP
766 _GL_WARN_ON_USE (mkdtemp
, "mkdtemp is unportable - "
767 "use gnulib module mkdtemp for portability");
771 #if @GNULIB_MKOSTEMP@
772 /* Create a unique temporary file from TEMPLATE.
773 The last six characters of TEMPLATE must be "XXXXXX";
774 they are replaced with a string that makes the file name unique.
775 The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
776 and O_TEXT, O_BINARY (defined in "binary-io.h").
777 The file is then created, with the specified flags, ensuring it didn't exist
779 The file is created read-write (mask at least 0600 & ~umask), but it may be
780 world-readable and world-writable (mask 0666 & ~umask), depending on the
782 Returns the open file descriptor if successful, otherwise -1 and errno
784 # if @REPLACE_MKOSTEMP@
785 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
787 # define mkostemp rpl_mkostemp
789 _GL_FUNCDECL_RPL (mkostemp
, int, (char * /*template*/, int /*flags*/)
790 _GL_ARG_NONNULL ((1)));
791 _GL_CXXALIAS_RPL (mkostemp
, int, (char * /*template*/, int /*flags*/));
793 # if !@HAVE_MKOSTEMP@
794 _GL_FUNCDECL_SYS (mkostemp
, int, (char * /*template*/, int /*flags*/)
795 _GL_ARG_NONNULL ((1)));
797 _GL_CXXALIAS_SYS (mkostemp
, int, (char * /*template*/, int /*flags*/));
800 _GL_CXXALIASWARN (mkostemp
);
802 #elif defined GNULIB_POSIXCHECK
804 # if HAVE_RAW_DECL_MKOSTEMP
805 _GL_WARN_ON_USE (mkostemp
, "mkostemp is unportable - "
806 "use gnulib module mkostemp for portability");
810 #if @GNULIB_MKOSTEMPS@
811 /* Create a unique temporary file from TEMPLATE.
812 The last six characters of TEMPLATE before a suffix of length
813 SUFFIXLEN must be "XXXXXX";
814 they are replaced with a string that makes the file name unique.
815 The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
816 and O_TEXT, O_BINARY (defined in "binary-io.h").
817 The file is then created, with the specified flags, ensuring it didn't exist
819 The file is created read-write (mask at least 0600 & ~umask), but it may be
820 world-readable and world-writable (mask 0666 & ~umask), depending on the
822 Returns the open file descriptor if successful, otherwise -1 and errno
824 # if @REPLACE_MKOSTEMPS@
825 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
827 # define mkostemps rpl_mkostemps
829 _GL_FUNCDECL_RPL (mkostemps
, int,
830 (char * /*template*/, int /*suffixlen*/, int /*flags*/)
831 _GL_ARG_NONNULL ((1)));
832 _GL_CXXALIAS_RPL (mkostemps
, int,
833 (char * /*template*/, int /*suffixlen*/, int /*flags*/));
835 # if !@HAVE_MKOSTEMPS@
836 _GL_FUNCDECL_SYS (mkostemps
, int,
837 (char * /*template*/, int /*suffixlen*/, int /*flags*/)
838 _GL_ARG_NONNULL ((1)));
840 _GL_CXXALIAS_SYS (mkostemps
, int,
841 (char * /*template*/, int /*suffixlen*/, int /*flags*/));
844 _GL_CXXALIASWARN (mkostemps
);
846 #elif defined GNULIB_POSIXCHECK
848 # if HAVE_RAW_DECL_MKOSTEMPS
849 _GL_WARN_ON_USE (mkostemps
, "mkostemps is unportable - "
850 "use gnulib module mkostemps for portability");
855 /* Create a unique temporary file from TEMPLATE.
856 The last six characters of TEMPLATE must be "XXXXXX";
857 they are replaced with a string that makes the file name unique.
858 The file is then created, ensuring it didn't exist before.
859 The file is created read-write (mask at least 0600 & ~umask), but it may be
860 world-readable and world-writable (mask 0666 & ~umask), depending on the
862 Returns the open file descriptor if successful, otherwise -1 and errno
864 # if @REPLACE_MKSTEMP@
865 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
866 # define mkstemp rpl_mkstemp
868 _GL_FUNCDECL_RPL (mkstemp
, int, (char * /*template*/) _GL_ARG_NONNULL ((1)));
869 _GL_CXXALIAS_RPL (mkstemp
, int, (char * /*template*/));
871 # if ! @HAVE_MKSTEMP@
872 _GL_FUNCDECL_SYS (mkstemp
, int, (char * /*template*/) _GL_ARG_NONNULL ((1)));
874 _GL_CXXALIAS_SYS (mkstemp
, int, (char * /*template*/));
876 _GL_CXXALIASWARN (mkstemp
);
877 #elif defined GNULIB_POSIXCHECK
879 # if HAVE_RAW_DECL_MKSTEMP
880 _GL_WARN_ON_USE (mkstemp
, "mkstemp is unportable - "
881 "use gnulib module mkstemp for portability");
885 #if @GNULIB_MKSTEMPS@
886 /* Create a unique temporary file from TEMPLATE.
887 The last six characters of TEMPLATE prior to a suffix of length
888 SUFFIXLEN must be "XXXXXX";
889 they are replaced with a string that makes the file name unique.
890 The file is then created, ensuring it didn't exist before.
891 The file is created read-write (mask at least 0600 & ~umask), but it may be
892 world-readable and world-writable (mask 0666 & ~umask), depending on the
894 Returns the open file descriptor if successful, otherwise -1 and errno
896 # if !@HAVE_MKSTEMPS@
897 _GL_FUNCDECL_SYS (mkstemps
, int, (char * /*template*/, int /*suffixlen*/)
898 _GL_ARG_NONNULL ((1)));
900 _GL_CXXALIAS_SYS (mkstemps
, int, (char * /*template*/, int /*suffixlen*/));
901 _GL_CXXALIASWARN (mkstemps
);
902 #elif defined GNULIB_POSIXCHECK
904 # if HAVE_RAW_DECL_MKSTEMPS
905 _GL_WARN_ON_USE (mkstemps
, "mkstemps is unportable - "
906 "use gnulib module mkstemps for portability");
910 #if @GNULIB_MDA_MKTEMP@
911 /* On native Windows, map 'mktemp' to '_mktemp', so that -loldnames is not
912 required. In C++ with GNULIB_NAMESPACE, avoid differences between
913 platforms by defining GNULIB_NAMESPACE::mktemp always. */
914 # if defined _WIN32 && !defined __CYGWIN__
915 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
917 # define mktemp _mktemp
919 _GL_CXXALIAS_MDA (mktemp
, char *, (char * /*template*/));
921 _GL_CXXALIAS_SYS (mktemp
, char *, (char * /*template*/));
923 _GL_CXXALIASWARN (mktemp
);
926 /* Allocate memory with indefinite extent and specified alignment. */
927 #if @GNULIB_POSIX_MEMALIGN@
928 # if @REPLACE_POSIX_MEMALIGN@
929 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
930 # undef posix_memalign
931 # define posix_memalign rpl_posix_memalign
933 _GL_FUNCDECL_RPL (posix_memalign
, int,
934 (void **memptr
, size_t alignment
, size_t size
)
935 _GL_ARG_NONNULL ((1)));
936 _GL_CXXALIAS_RPL (posix_memalign
, int,
937 (void **memptr
, size_t alignment
, size_t size
));
939 # if @HAVE_POSIX_MEMALIGN@
940 _GL_CXXALIAS_SYS (posix_memalign
, int,
941 (void **memptr
, size_t alignment
, size_t size
));
944 # if __GLIBC__ >= 2 && @HAVE_POSIX_MEMALIGN@
945 _GL_CXXALIASWARN (posix_memalign
);
947 #elif defined GNULIB_POSIXCHECK
948 # undef posix_memalign
949 # if HAVE_RAW_DECL_POSIX_MEMALIGN
950 _GL_WARN_ON_USE (posix_memalign
, "posix_memalign is not portable - "
951 "use gnulib module posix_memalign for portability");
955 #if @GNULIB_POSIX_OPENPT@
956 /* Return an FD open to the master side of a pseudo-terminal. Flags should
957 include O_RDWR, and may also include O_NOCTTY. */
958 # if @REPLACE_POSIX_OPENPT@
959 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
961 # define posix_openpt rpl_posix_openpt
963 _GL_FUNCDECL_RPL (posix_openpt
, int, (int flags
));
964 _GL_CXXALIAS_RPL (posix_openpt
, int, (int flags
));
966 # if !@HAVE_POSIX_OPENPT@
967 _GL_FUNCDECL_SYS (posix_openpt
, int, (int flags
));
969 _GL_CXXALIAS_SYS (posix_openpt
, int, (int flags
));
972 _GL_CXXALIASWARN (posix_openpt
);
974 #elif defined GNULIB_POSIXCHECK
976 # if HAVE_RAW_DECL_POSIX_OPENPT
977 _GL_WARN_ON_USE (posix_openpt
, "posix_openpt is not portable - "
978 "use gnulib module posix_openpt for portability");
983 /* Return the pathname of the pseudo-terminal slave associated with
984 the master FD is open on, or NULL on errors. */
985 # if @REPLACE_PTSNAME@
986 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
988 # define ptsname rpl_ptsname
990 _GL_FUNCDECL_RPL (ptsname
, char *, (int fd
));
991 _GL_CXXALIAS_RPL (ptsname
, char *, (int fd
));
994 _GL_FUNCDECL_SYS (ptsname
, char *, (int fd
));
996 _GL_CXXALIAS_SYS (ptsname
, char *, (int fd
));
998 _GL_CXXALIASWARN (ptsname
);
999 #elif defined GNULIB_POSIXCHECK
1001 # if HAVE_RAW_DECL_PTSNAME
1002 _GL_WARN_ON_USE (ptsname
, "ptsname is not portable - "
1003 "use gnulib module ptsname for portability");
1007 #if @GNULIB_PTSNAME_R@
1008 /* Set the pathname of the pseudo-terminal slave associated with
1009 the master FD is open on and return 0, or set errno and return
1010 non-zero on errors. */
1011 # if @REPLACE_PTSNAME_R@
1012 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1014 # define ptsname_r rpl_ptsname_r
1016 _GL_FUNCDECL_RPL (ptsname_r
, int, (int fd
, char *buf
, size_t len
));
1017 _GL_CXXALIAS_RPL (ptsname_r
, int, (int fd
, char *buf
, size_t len
));
1019 # if !@HAVE_PTSNAME_R@
1020 _GL_FUNCDECL_SYS (ptsname_r
, int, (int fd
, char *buf
, size_t len
));
1022 _GL_CXXALIAS_SYS (ptsname_r
, int, (int fd
, char *buf
, size_t len
));
1024 # ifndef GNULIB_defined_ptsname_r
1025 # define GNULIB_defined_ptsname_r (!@HAVE_PTSNAME_R@ || @REPLACE_PTSNAME_R@)
1027 _GL_CXXALIASWARN (ptsname_r
);
1028 #elif defined GNULIB_POSIXCHECK
1030 # if HAVE_RAW_DECL_PTSNAME_R
1031 _GL_WARN_ON_USE (ptsname_r
, "ptsname_r is not portable - "
1032 "use gnulib module ptsname_r for portability");
1037 # if @REPLACE_PUTENV@
1038 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1040 # define putenv rpl_putenv
1042 _GL_FUNCDECL_RPL (putenv
, int, (char *string
) _GL_ARG_NONNULL ((1)));
1043 _GL_CXXALIAS_RPL (putenv
, int, (char *string
));
1044 # elif defined _WIN32 && !defined __CYGWIN__
1045 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1047 # define putenv _putenv
1049 _GL_CXXALIAS_MDA (putenv
, int, (char *string
));
1050 # elif defined __KLIBC__
1051 /* Need to cast, because on OS/2 kLIBC, the first parameter is
1052 const char *string. */
1053 _GL_CXXALIAS_SYS_CAST (putenv
, int, (char *string
));
1055 _GL_CXXALIAS_SYS (putenv
, int, (char *string
));
1057 _GL_CXXALIASWARN (putenv
);
1058 #elif @GNULIB_MDA_PUTENV@
1059 /* On native Windows, map 'putenv' to '_putenv', so that -loldnames is not
1060 required. In C++ with GNULIB_NAMESPACE, avoid differences between
1061 platforms by defining GNULIB_NAMESPACE::putenv always. */
1062 # if defined _WIN32 && !defined __CYGWIN__
1063 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1065 # define putenv _putenv
1067 /* Need to cast, because on mingw, the parameter is either
1068 'const char *string' or 'char *string'. */
1069 _GL_CXXALIAS_MDA_CAST (putenv
, int, (char *string
));
1070 # elif defined __KLIBC__
1071 /* Need to cast, because on OS/2 kLIBC, the first parameter is
1072 const char *string. */
1073 _GL_CXXALIAS_SYS_CAST (putenv
, int, (char *string
));
1075 _GL_CXXALIAS_SYS (putenv
, int, (char *string
));
1077 _GL_CXXALIASWARN (putenv
);
1080 #if @GNULIB_QSORT_R@
1081 /* Sort an array of NMEMB elements, starting at address BASE, each element
1082 occupying SIZE bytes, in ascending order according to the comparison
1083 function COMPARE. */
1087 # if !GNULIB_defined_qsort_r_fn_types
1088 typedef int (*_gl_qsort_r_compar_fn
) (void const *, void const *, void *);
1089 # define GNULIB_defined_qsort_r_fn_types 1
1094 # if @REPLACE_QSORT_R@
1095 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1097 # define qsort_r rpl_qsort_r
1099 _GL_FUNCDECL_RPL (qsort_r
, void, (void *base
, size_t nmemb
, size_t size
,
1100 _gl_qsort_r_compar_fn compare
,
1101 void *arg
) _GL_ARG_NONNULL ((1, 4)));
1102 _GL_CXXALIAS_RPL (qsort_r
, void, (void *base
, size_t nmemb
, size_t size
,
1103 _gl_qsort_r_compar_fn compare
,
1106 # if !@HAVE_QSORT_R@
1107 _GL_FUNCDECL_SYS (qsort_r
, void, (void *base
, size_t nmemb
, size_t size
,
1108 _gl_qsort_r_compar_fn compare
,
1109 void *arg
) _GL_ARG_NONNULL ((1, 4)));
1111 _GL_CXXALIAS_SYS (qsort_r
, void, (void *base
, size_t nmemb
, size_t size
,
1112 _gl_qsort_r_compar_fn compare
,
1116 _GL_CXXALIASWARN (qsort_r
);
1118 #elif defined GNULIB_POSIXCHECK
1120 # if HAVE_RAW_DECL_QSORT_R
1121 _GL_WARN_ON_USE (qsort_r
, "qsort_r is not portable - "
1122 "use gnulib module qsort_r for portability");
1127 #if @GNULIB_RAND@ || (@GNULIB_RANDOM_R@ && !@HAVE_RANDOM_R@)
1129 # define RAND_MAX 2147483647
1136 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1138 # define rand rpl_rand
1140 _GL_FUNCDECL_RPL (rand
, int, (void));
1141 _GL_CXXALIAS_RPL (rand
, int, (void));
1143 _GL_CXXALIAS_SYS (rand
, int, (void));
1146 _GL_CXXALIASWARN (rand
);
1152 # if @REPLACE_RANDOM@
1153 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1155 # define random rpl_random
1157 _GL_FUNCDECL_RPL (random
, long, (void));
1158 _GL_CXXALIAS_RPL (random
, long, (void));
1161 _GL_FUNCDECL_SYS (random
, long, (void));
1163 /* Need to cast, because on Haiku, the return type is
1165 _GL_CXXALIAS_SYS_CAST (random
, long, (void));
1168 _GL_CXXALIASWARN (random
);
1170 #elif defined GNULIB_POSIXCHECK
1172 # if HAVE_RAW_DECL_RANDOM
1173 _GL_WARN_ON_USE (random
, "random is unportable - "
1174 "use gnulib module random for portability");
1179 # if @REPLACE_RANDOM@
1180 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1182 # define srandom rpl_srandom
1184 _GL_FUNCDECL_RPL (srandom
, void, (unsigned int seed
));
1185 _GL_CXXALIAS_RPL (srandom
, void, (unsigned int seed
));
1188 _GL_FUNCDECL_SYS (srandom
, void, (unsigned int seed
));
1190 /* Need to cast, because on FreeBSD, the first parameter is
1191 unsigned long seed. */
1192 _GL_CXXALIAS_SYS_CAST (srandom
, void, (unsigned int seed
));
1195 _GL_CXXALIASWARN (srandom
);
1197 #elif defined GNULIB_POSIXCHECK
1199 # if HAVE_RAW_DECL_SRANDOM
1200 _GL_WARN_ON_USE (srandom
, "srandom is unportable - "
1201 "use gnulib module random for portability");
1206 # if @REPLACE_INITSTATE@
1207 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1209 # define initstate rpl_initstate
1211 _GL_FUNCDECL_RPL (initstate
, char *,
1212 (unsigned int seed
, char *buf
, size_t buf_size
)
1213 _GL_ARG_NONNULL ((2)));
1214 _GL_CXXALIAS_RPL (initstate
, char *,
1215 (unsigned int seed
, char *buf
, size_t buf_size
));
1217 # if !@HAVE_INITSTATE@ || !@HAVE_DECL_INITSTATE@
1218 _GL_FUNCDECL_SYS (initstate
, char *,
1219 (unsigned int seed
, char *buf
, size_t buf_size
)
1220 _GL_ARG_NONNULL ((2)));
1222 /* Need to cast, because on FreeBSD, the first parameter is
1223 unsigned long seed. */
1224 _GL_CXXALIAS_SYS_CAST (initstate
, char *,
1225 (unsigned int seed
, char *buf
, size_t buf_size
));
1228 _GL_CXXALIASWARN (initstate
);
1230 #elif defined GNULIB_POSIXCHECK
1232 # if HAVE_RAW_DECL_INITSTATE
1233 _GL_WARN_ON_USE (initstate
, "initstate is unportable - "
1234 "use gnulib module random for portability");
1239 # if @REPLACE_SETSTATE@
1240 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1242 # define setstate rpl_setstate
1244 _GL_FUNCDECL_RPL (setstate
, char *, (char *arg_state
) _GL_ARG_NONNULL ((1)));
1245 _GL_CXXALIAS_RPL (setstate
, char *, (char *arg_state
));
1247 # if !@HAVE_SETSTATE@ || !@HAVE_DECL_SETSTATE@
1248 _GL_FUNCDECL_SYS (setstate
, char *, (char *arg_state
) _GL_ARG_NONNULL ((1)));
1250 /* Need to cast, because on Mac OS X 10.13, HP-UX, Solaris the first parameter
1251 is const char *arg_state. */
1252 _GL_CXXALIAS_SYS_CAST (setstate
, char *, (char *arg_state
));
1255 _GL_CXXALIASWARN (setstate
);
1257 #elif defined GNULIB_POSIXCHECK
1259 # if HAVE_RAW_DECL_SETSTATE
1260 _GL_WARN_ON_USE (setstate
, "setstate is unportable - "
1261 "use gnulib module random for portability");
1266 #if @GNULIB_RANDOM_R@
1267 # if @REPLACE_RANDOM_R@
1268 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1270 # define random_r rpl_random_r
1272 _GL_FUNCDECL_RPL (random_r
, int, (struct random_data
*buf
, int32_t *result
)
1273 _GL_ARG_NONNULL ((1, 2)));
1274 _GL_CXXALIAS_RPL (random_r
, int, (struct random_data
*buf
, int32_t *result
));
1276 # if !@HAVE_RANDOM_R@
1277 _GL_FUNCDECL_SYS (random_r
, int, (struct random_data
*buf
, int32_t *result
)
1278 _GL_ARG_NONNULL ((1, 2)));
1280 _GL_CXXALIAS_SYS (random_r
, int, (struct random_data
*buf
, int32_t *result
));
1282 _GL_CXXALIASWARN (random_r
);
1283 #elif defined GNULIB_POSIXCHECK
1285 # if HAVE_RAW_DECL_RANDOM_R
1286 _GL_WARN_ON_USE (random_r
, "random_r is unportable - "
1287 "use gnulib module random_r for portability");
1291 #if @GNULIB_RANDOM_R@
1292 # if @REPLACE_RANDOM_R@
1293 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1295 # define srandom_r rpl_srandom_r
1297 _GL_FUNCDECL_RPL (srandom_r
, int,
1298 (unsigned int seed
, struct random_data
*rand_state
)
1299 _GL_ARG_NONNULL ((2)));
1300 _GL_CXXALIAS_RPL (srandom_r
, int,
1301 (unsigned int seed
, struct random_data
*rand_state
));
1303 # if !@HAVE_RANDOM_R@
1304 _GL_FUNCDECL_SYS (srandom_r
, int,
1305 (unsigned int seed
, struct random_data
*rand_state
)
1306 _GL_ARG_NONNULL ((2)));
1308 _GL_CXXALIAS_SYS (srandom_r
, int,
1309 (unsigned int seed
, struct random_data
*rand_state
));
1311 _GL_CXXALIASWARN (srandom_r
);
1312 #elif defined GNULIB_POSIXCHECK
1314 # if HAVE_RAW_DECL_SRANDOM_R
1315 _GL_WARN_ON_USE (srandom_r
, "srandom_r is unportable - "
1316 "use gnulib module random_r for portability");
1320 #if @GNULIB_RANDOM_R@
1321 # if @REPLACE_RANDOM_R@
1322 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1324 # define initstate_r rpl_initstate_r
1326 _GL_FUNCDECL_RPL (initstate_r
, int,
1327 (unsigned int seed
, char *buf
, size_t buf_size
,
1328 struct random_data
*rand_state
)
1329 _GL_ARG_NONNULL ((2, 4)));
1330 _GL_CXXALIAS_RPL (initstate_r
, int,
1331 (unsigned int seed
, char *buf
, size_t buf_size
,
1332 struct random_data
*rand_state
));
1334 # if !@HAVE_RANDOM_R@
1335 _GL_FUNCDECL_SYS (initstate_r
, int,
1336 (unsigned int seed
, char *buf
, size_t buf_size
,
1337 struct random_data
*rand_state
)
1338 _GL_ARG_NONNULL ((2, 4)));
1340 /* Need to cast, because on Haiku, the third parameter is
1341 unsigned long buf_size. */
1342 _GL_CXXALIAS_SYS_CAST (initstate_r
, int,
1343 (unsigned int seed
, char *buf
, size_t buf_size
,
1344 struct random_data
*rand_state
));
1346 _GL_CXXALIASWARN (initstate_r
);
1347 #elif defined GNULIB_POSIXCHECK
1349 # if HAVE_RAW_DECL_INITSTATE_R
1350 _GL_WARN_ON_USE (initstate_r
, "initstate_r is unportable - "
1351 "use gnulib module random_r for portability");
1355 #if @GNULIB_RANDOM_R@
1356 # if @REPLACE_RANDOM_R@
1357 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1359 # define setstate_r rpl_setstate_r
1361 _GL_FUNCDECL_RPL (setstate_r
, int,
1362 (char *arg_state
, struct random_data
*rand_state
)
1363 _GL_ARG_NONNULL ((1, 2)));
1364 _GL_CXXALIAS_RPL (setstate_r
, int,
1365 (char *arg_state
, struct random_data
*rand_state
));
1367 # if !@HAVE_RANDOM_R@
1368 _GL_FUNCDECL_SYS (setstate_r
, int,
1369 (char *arg_state
, struct random_data
*rand_state
)
1370 _GL_ARG_NONNULL ((1, 2)));
1372 /* Need to cast, because on Haiku, the first parameter is
1374 _GL_CXXALIAS_SYS_CAST (setstate_r
, int,
1375 (char *arg_state
, struct random_data
*rand_state
));
1377 _GL_CXXALIASWARN (setstate_r
);
1378 #elif defined GNULIB_POSIXCHECK
1380 # if HAVE_RAW_DECL_SETSTATE_R
1381 _GL_WARN_ON_USE (setstate_r
, "setstate_r is unportable - "
1382 "use gnulib module random_r for portability");
1387 #if @GNULIB_REALLOC_POSIX@
1388 # if (@GNULIB_REALLOC_POSIX@ && @REPLACE_REALLOC_FOR_REALLOC_POSIX@) \
1389 || (@GNULIB_REALLOC_GNU@ && @REPLACE_REALLOC_FOR_REALLOC_GNU@)
1390 # if !((defined __cplusplus && defined GNULIB_NAMESPACE) \
1391 || _GL_USE_STDLIB_ALLOC)
1393 # define realloc rpl_realloc
1395 _GL_FUNCDECL_RPL (realloc
, void *, (void *ptr
, size_t size
)
1396 _GL_ATTRIBUTE_DEALLOC_FREE
);
1397 _GL_CXXALIAS_RPL (realloc
, void *, (void *ptr
, size_t size
));
1400 /* For -Wmismatched-dealloc: Associate realloc with free or rpl_free. */
1401 # if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2
1402 _GL_FUNCDECL_SYS (realloc
, void *,
1403 (void *ptr
, size_t size
)
1404 _GL_ATTRIBUTE_NOTHROW
1405 _GL_ATTRIBUTE_DEALLOC_FREE
);
1407 _GL_FUNCDECL_SYS (realloc
, void *,
1408 (void *ptr
, size_t size
)
1409 _GL_ATTRIBUTE_DEALLOC_FREE
);
1412 _GL_CXXALIAS_SYS (realloc
, void *, (void *ptr
, size_t size
));
1415 _GL_CXXALIASWARN (realloc
);
1418 # if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined realloc
1419 /* For -Wmismatched-dealloc: Associate realloc with free or rpl_free. */
1420 # if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2
1421 _GL_FUNCDECL_SYS (realloc
, void *,
1422 (void *ptr
, size_t size
)
1423 _GL_ATTRIBUTE_NOTHROW
1424 _GL_ATTRIBUTE_DEALLOC_FREE
);
1426 _GL_FUNCDECL_SYS (realloc
, void *,
1427 (void *ptr
, size_t size
)
1428 _GL_ATTRIBUTE_DEALLOC_FREE
);
1431 # if defined GNULIB_POSIXCHECK && !_GL_USE_STDLIB_ALLOC
1433 /* Assume realloc is always declared. */
1434 _GL_WARN_ON_USE (realloc
, "realloc is not POSIX compliant everywhere - "
1435 "use gnulib module realloc-posix for portability");
1440 #if @GNULIB_REALLOCARRAY@
1441 # if @REPLACE_REALLOCARRAY@
1442 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1443 # undef reallocarray
1444 # define reallocarray rpl_reallocarray
1446 _GL_FUNCDECL_RPL (reallocarray
, void *,
1447 (void *ptr
, size_t nmemb
, size_t size
));
1448 _GL_CXXALIAS_RPL (reallocarray
, void *,
1449 (void *ptr
, size_t nmemb
, size_t size
));
1451 # if ! @HAVE_REALLOCARRAY@
1452 _GL_FUNCDECL_SYS (reallocarray
, void *,
1453 (void *ptr
, size_t nmemb
, size_t size
));
1455 _GL_CXXALIAS_SYS (reallocarray
, void *,
1456 (void *ptr
, size_t nmemb
, size_t size
));
1459 _GL_CXXALIASWARN (reallocarray
);
1461 #elif defined GNULIB_POSIXCHECK
1462 # undef reallocarray
1463 # if HAVE_RAW_DECL_REALLOCARRAY
1464 _GL_WARN_ON_USE (reallocarray
, "reallocarray is not portable - "
1465 "use gnulib module reallocarray for portability");
1469 #if @GNULIB_REALPATH@
1470 # if @REPLACE_REALPATH@
1471 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1472 # define realpath rpl_realpath
1474 _GL_FUNCDECL_RPL (realpath
, char *,
1475 (const char *restrict name
, char *restrict resolved
)
1476 _GL_ARG_NONNULL ((1)));
1477 _GL_CXXALIAS_RPL (realpath
, char *,
1478 (const char *restrict name
, char *restrict resolved
));
1480 # if !@HAVE_REALPATH@
1481 _GL_FUNCDECL_SYS (realpath
, char *,
1482 (const char *restrict name
, char *restrict resolved
)
1483 _GL_ARG_NONNULL ((1)));
1485 _GL_CXXALIAS_SYS (realpath
, char *,
1486 (const char *restrict name
, char *restrict resolved
));
1488 _GL_CXXALIASWARN (realpath
);
1489 #elif defined GNULIB_POSIXCHECK
1491 # if HAVE_RAW_DECL_REALPATH
1492 _GL_WARN_ON_USE (realpath
, "realpath is unportable - use gnulib module "
1493 "canonicalize or canonicalize-lgpl for portability");
1497 #if @GNULIB_RPMATCH@
1498 /* Test a user response to a question.
1499 Return 1 if it is affirmative, 0 if it is negative, or -1 if not clear. */
1500 # if !@HAVE_RPMATCH@
1501 _GL_FUNCDECL_SYS (rpmatch
, int, (const char *response
) _GL_ARG_NONNULL ((1)));
1503 _GL_CXXALIAS_SYS (rpmatch
, int, (const char *response
));
1504 _GL_CXXALIASWARN (rpmatch
);
1505 #elif defined GNULIB_POSIXCHECK
1507 # if HAVE_RAW_DECL_RPMATCH
1508 _GL_WARN_ON_USE (rpmatch
, "rpmatch is unportable - "
1509 "use gnulib module rpmatch for portability");
1513 #if @GNULIB_SECURE_GETENV@
1514 /* Look up NAME in the environment, returning 0 in insecure situations. */
1515 # if !@HAVE_SECURE_GETENV@
1516 _GL_FUNCDECL_SYS (secure_getenv
, char *,
1517 (char const *name
) _GL_ARG_NONNULL ((1)));
1519 _GL_CXXALIAS_SYS (secure_getenv
, char *, (char const *name
));
1520 _GL_CXXALIASWARN (secure_getenv
);
1521 #elif defined GNULIB_POSIXCHECK
1522 # undef secure_getenv
1523 # if HAVE_RAW_DECL_SECURE_GETENV
1524 _GL_WARN_ON_USE (secure_getenv
, "secure_getenv is unportable - "
1525 "use gnulib module secure_getenv for portability");
1530 /* Set NAME to VALUE in the environment.
1531 If REPLACE is nonzero, overwrite an existing value. */
1532 # if @REPLACE_SETENV@
1533 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1535 # define setenv rpl_setenv
1537 _GL_FUNCDECL_RPL (setenv
, int,
1538 (const char *name
, const char *value
, int replace
)
1539 _GL_ARG_NONNULL ((1)));
1540 _GL_CXXALIAS_RPL (setenv
, int,
1541 (const char *name
, const char *value
, int replace
));
1543 # if !@HAVE_DECL_SETENV@
1544 _GL_FUNCDECL_SYS (setenv
, int,
1545 (const char *name
, const char *value
, int replace
)
1546 _GL_ARG_NONNULL ((1)));
1548 _GL_CXXALIAS_SYS (setenv
, int,
1549 (const char *name
, const char *value
, int replace
));
1551 # if !(@REPLACE_SETENV@ && !@HAVE_DECL_SETENV@)
1552 _GL_CXXALIASWARN (setenv
);
1554 #elif defined GNULIB_POSIXCHECK
1556 # if HAVE_RAW_DECL_SETENV
1557 _GL_WARN_ON_USE (setenv
, "setenv is unportable - "
1558 "use gnulib module setenv for portability");
1563 /* Parse a double from STRING, updating ENDP if appropriate. */
1564 # if @REPLACE_STRTOD@
1565 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1566 # define strtod rpl_strtod
1568 # define GNULIB_defined_strtod_function 1
1569 _GL_FUNCDECL_RPL (strtod
, double,
1570 (const char *restrict str
, char **restrict endp
)
1571 _GL_ARG_NONNULL ((1)));
1572 _GL_CXXALIAS_RPL (strtod
, double,
1573 (const char *restrict str
, char **restrict endp
));
1576 _GL_FUNCDECL_SYS (strtod
, double,
1577 (const char *restrict str
, char **restrict endp
)
1578 _GL_ARG_NONNULL ((1)));
1580 _GL_CXXALIAS_SYS (strtod
, double,
1581 (const char *restrict str
, char **restrict endp
));
1584 _GL_CXXALIASWARN (strtod
);
1586 #elif defined GNULIB_POSIXCHECK
1588 # if HAVE_RAW_DECL_STRTOD
1589 _GL_WARN_ON_USE (strtod
, "strtod is unportable - "
1590 "use gnulib module strtod for portability");
1595 /* Parse a float from STRING, updating ENDP if appropriate. */
1596 # if @REPLACE_STRTOF@
1597 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1598 # define strtof rpl_strtof
1600 # define GNULIB_defined_strtof_function 1
1601 _GL_FUNCDECL_RPL (strtof
, float,
1602 (const char *restrict str
, char **restrict endp
)
1603 _GL_ARG_NONNULL ((1)));
1604 _GL_CXXALIAS_RPL (strtof
, float,
1605 (const char *restrict str
, char **restrict endp
));
1608 _GL_FUNCDECL_SYS (strtof
, float,
1609 (const char *restrict str
, char **restrict endp
)
1610 _GL_ARG_NONNULL ((1)));
1612 _GL_CXXALIAS_SYS (strtof
, float,
1613 (const char *restrict str
, char **restrict endp
));
1616 _GL_CXXALIASWARN (strtof
);
1618 #elif defined GNULIB_POSIXCHECK
1620 # if HAVE_RAW_DECL_STRTOF
1621 _GL_WARN_ON_USE (strtof
, "strtof is unportable - "
1622 "use gnulib module strtof for portability");
1626 #if @GNULIB_STRTOLD@
1627 /* Parse a 'long double' from STRING, updating ENDP if appropriate. */
1628 # if @REPLACE_STRTOLD@
1629 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1630 # define strtold rpl_strtold
1632 # define GNULIB_defined_strtold_function 1
1633 _GL_FUNCDECL_RPL (strtold
, long double,
1634 (const char *restrict str
, char **restrict endp
)
1635 _GL_ARG_NONNULL ((1)));
1636 _GL_CXXALIAS_RPL (strtold
, long double,
1637 (const char *restrict str
, char **restrict endp
));
1639 # if !@HAVE_STRTOLD@
1640 _GL_FUNCDECL_SYS (strtold
, long double,
1641 (const char *restrict str
, char **restrict endp
)
1642 _GL_ARG_NONNULL ((1)));
1644 _GL_CXXALIAS_SYS (strtold
, long double,
1645 (const char *restrict str
, char **restrict endp
));
1647 _GL_CXXALIASWARN (strtold
);
1648 #elif defined GNULIB_POSIXCHECK
1650 # if HAVE_RAW_DECL_STRTOLD
1651 _GL_WARN_ON_USE (strtold
, "strtold is unportable - "
1652 "use gnulib module strtold for portability");
1657 /* Parse a signed integer whose textual representation starts at STRING.
1658 The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0,
1659 it may be decimal or octal (with prefix "0") or hexadecimal (with prefix
1661 If ENDPTR is not NULL, the address of the first byte after the integer is
1663 Upon overflow, the return value is LONG_MAX or LONG_MIN, and errno is set
1665 # if @REPLACE_STRTOL@
1666 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1667 # define strtol rpl_strtol
1669 # define GNULIB_defined_strtol_function 1
1670 _GL_FUNCDECL_RPL (strtol
, long,
1671 (const char *restrict string
, char **restrict endptr
,
1673 _GL_ARG_NONNULL ((1)));
1674 _GL_CXXALIAS_RPL (strtol
, long,
1675 (const char *restrict string
, char **restrict endptr
,
1679 _GL_FUNCDECL_SYS (strtol
, long,
1680 (const char *restrict string
, char **restrict endptr
,
1682 _GL_ARG_NONNULL ((1)));
1684 _GL_CXXALIAS_SYS (strtol
, long,
1685 (const char *restrict string
, char **restrict endptr
,
1689 _GL_CXXALIASWARN (strtol
);
1691 #elif defined GNULIB_POSIXCHECK
1693 # if HAVE_RAW_DECL_STRTOL
1694 _GL_WARN_ON_USE (strtol
, "strtol is unportable - "
1695 "use gnulib module strtol for portability");
1699 #if @GNULIB_STRTOLL@
1700 /* Parse a signed integer whose textual representation starts at STRING.
1701 The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0,
1702 it may be decimal or octal (with prefix "0") or hexadecimal (with prefix
1704 If ENDPTR is not NULL, the address of the first byte after the integer is
1706 Upon overflow, the return value is LLONG_MAX or LLONG_MIN, and errno is set
1708 # if @REPLACE_STRTOLL@
1709 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1710 # define strtoll rpl_strtoll
1712 # define GNULIB_defined_strtoll_function 1
1713 _GL_FUNCDECL_RPL (strtoll
, long long,
1714 (const char *restrict string
, char **restrict endptr
,
1716 _GL_ARG_NONNULL ((1)));
1717 _GL_CXXALIAS_RPL (strtoll
, long long,
1718 (const char *restrict string
, char **restrict endptr
,
1721 # if !@HAVE_STRTOLL@
1722 _GL_FUNCDECL_SYS (strtoll
, long long,
1723 (const char *restrict string
, char **restrict endptr
,
1725 _GL_ARG_NONNULL ((1)));
1727 _GL_CXXALIAS_SYS (strtoll
, long long,
1728 (const char *restrict string
, char **restrict endptr
,
1731 _GL_CXXALIASWARN (strtoll
);
1732 #elif defined GNULIB_POSIXCHECK
1734 # if HAVE_RAW_DECL_STRTOLL
1735 _GL_WARN_ON_USE (strtoll
, "strtoll is unportable - "
1736 "use gnulib module strtoll for portability");
1740 #if @GNULIB_STRTOUL@
1741 /* Parse an unsigned integer whose textual representation starts at STRING.
1742 The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0,
1743 it may be decimal or octal (with prefix "0") or hexadecimal (with prefix
1745 If ENDPTR is not NULL, the address of the first byte after the integer is
1747 Upon overflow, the return value is ULONG_MAX, and errno is set to ERANGE. */
1748 # if @REPLACE_STRTOUL@
1749 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1750 # define strtoul rpl_strtoul
1752 # define GNULIB_defined_strtoul_function 1
1753 _GL_FUNCDECL_RPL (strtoul
, unsigned long,
1754 (const char *restrict string
, char **restrict endptr
,
1756 _GL_ARG_NONNULL ((1)));
1757 _GL_CXXALIAS_RPL (strtoul
, unsigned long,
1758 (const char *restrict string
, char **restrict endptr
,
1761 # if !@HAVE_STRTOUL@
1762 _GL_FUNCDECL_SYS (strtoul
, unsigned long,
1763 (const char *restrict string
, char **restrict endptr
,
1765 _GL_ARG_NONNULL ((1)));
1767 _GL_CXXALIAS_SYS (strtoul
, unsigned long,
1768 (const char *restrict string
, char **restrict endptr
,
1772 _GL_CXXALIASWARN (strtoul
);
1774 #elif defined GNULIB_POSIXCHECK
1776 # if HAVE_RAW_DECL_STRTOUL
1777 _GL_WARN_ON_USE (strtoul
, "strtoul is unportable - "
1778 "use gnulib module strtoul for portability");
1782 #if @GNULIB_STRTOULL@
1783 /* Parse an unsigned integer whose textual representation starts at STRING.
1784 The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0,
1785 it may be decimal or octal (with prefix "0") or hexadecimal (with prefix
1787 If ENDPTR is not NULL, the address of the first byte after the integer is
1789 Upon overflow, the return value is ULLONG_MAX, and errno is set to
1791 # if @REPLACE_STRTOULL@
1792 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1793 # define strtoull rpl_strtoull
1795 # define GNULIB_defined_strtoull_function 1
1796 _GL_FUNCDECL_RPL (strtoull
, unsigned long long,
1797 (const char *restrict string
, char **restrict endptr
,
1799 _GL_ARG_NONNULL ((1)));
1800 _GL_CXXALIAS_RPL (strtoull
, unsigned long long,
1801 (const char *restrict string
, char **restrict endptr
,
1804 # if !@HAVE_STRTOULL@
1805 _GL_FUNCDECL_SYS (strtoull
, unsigned long long,
1806 (const char *restrict string
, char **restrict endptr
,
1808 _GL_ARG_NONNULL ((1)));
1810 _GL_CXXALIAS_SYS (strtoull
, unsigned long long,
1811 (const char *restrict string
, char **restrict endptr
,
1814 _GL_CXXALIASWARN (strtoull
);
1815 #elif defined GNULIB_POSIXCHECK
1817 # if HAVE_RAW_DECL_STRTOULL
1818 _GL_WARN_ON_USE (strtoull
, "strtoull is unportable - "
1819 "use gnulib module strtoull for portability");
1823 #if @GNULIB_UNLOCKPT@
1824 /* Unlock the slave side of the pseudo-terminal whose master side is specified
1825 by FD, so that it can be opened. */
1826 # if !@HAVE_UNLOCKPT@
1827 _GL_FUNCDECL_SYS (unlockpt
, int, (int fd
));
1829 _GL_CXXALIAS_SYS (unlockpt
, int, (int fd
));
1830 _GL_CXXALIASWARN (unlockpt
);
1831 #elif defined GNULIB_POSIXCHECK
1833 # if HAVE_RAW_DECL_UNLOCKPT
1834 _GL_WARN_ON_USE (unlockpt
, "unlockpt is not portable - "
1835 "use gnulib module unlockpt for portability");
1839 #if @GNULIB_UNSETENV@
1840 /* Remove the variable NAME from the environment. */
1841 # if @REPLACE_UNSETENV@
1842 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1844 # define unsetenv rpl_unsetenv
1846 _GL_FUNCDECL_RPL (unsetenv
, int, (const char *name
) _GL_ARG_NONNULL ((1)));
1847 _GL_CXXALIAS_RPL (unsetenv
, int, (const char *name
));
1849 # if !@HAVE_DECL_UNSETENV@
1850 _GL_FUNCDECL_SYS (unsetenv
, int, (const char *name
) _GL_ARG_NONNULL ((1)));
1852 _GL_CXXALIAS_SYS (unsetenv
, int, (const char *name
));
1854 # if !(@REPLACE_UNSETENV@ && !@HAVE_DECL_UNSETENV@)
1855 _GL_CXXALIASWARN (unsetenv
);
1857 #elif defined GNULIB_POSIXCHECK
1859 # if HAVE_RAW_DECL_UNSETENV
1860 _GL_WARN_ON_USE (unsetenv
, "unsetenv is unportable - "
1861 "use gnulib module unsetenv for portability");
1865 /* Convert a wide character to a multibyte character. */
1867 # if @REPLACE_WCTOMB@
1868 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1870 # define wctomb rpl_wctomb
1872 _GL_FUNCDECL_RPL (wctomb
, int, (char *s
, wchar_t wc
));
1873 _GL_CXXALIAS_RPL (wctomb
, int, (char *s
, wchar_t wc
));
1875 _GL_CXXALIAS_SYS (wctomb
, int, (char *s
, wchar_t wc
));
1878 _GL_CXXALIASWARN (wctomb
);
1883 #endif /* _@GUARD_PREFIX@_STDLIB_H */
1884 #endif /* _@GUARD_PREFIX@_STDLIB_H */