posix_memalign: New module.
[gnulib.git] / lib / stdlib.in.h
blob58e4bba0a8f816910c1b46911a3e009f2bc9e62b
1 /* A GNU-like <stdlib.h>.
3 Copyright (C) 1995, 2001-2004, 2006-2020 Free Software Foundation, Inc.
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
10 This program 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 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <https://www.gnu.org/licenses/>. */
18 #if __GNUC__ >= 3
19 @PRAGMA_SYSTEM_HEADER@
20 #endif
21 @PRAGMA_COLUMNS@
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@
29 #else
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 /* NetBSD 5.0 mis-defines NULL. */
41 #include <stddef.h>
43 /* MirBSD 10 defines WEXITSTATUS in <sys/wait.h>, not in <stdlib.h>. */
44 #if @GNULIB_SYSTEM_POSIX@ && !defined WEXITSTATUS
45 # include <sys/wait.h>
46 #endif
48 /* Solaris declares getloadavg() in <sys/loadavg.h>. */
49 #if (@GNULIB_GETLOADAVG@ || defined GNULIB_POSIXCHECK) && @HAVE_SYS_LOADAVG_H@
50 /* OpenIndiana has a bug: <sys/time.h> must be included before
51 <sys/loadavg.h>. */
52 # include <sys/time.h>
53 # include <sys/loadavg.h>
54 #endif
56 /* Native Windows platforms declare mktemp() in <io.h>. */
57 #if 0 && (defined _WIN32 && ! defined __CYGWIN__)
58 # include <io.h>
59 #endif
61 #if @GNULIB_RANDOM_R@
63 /* OSF/1 5.1 declares 'struct random_data' in <random.h>, which is included
64 from <stdlib.h> if _REENTRANT is defined. Include it whenever we need
65 'struct random_data'. */
66 # if @HAVE_RANDOM_H@
67 # include <random.h>
68 # endif
70 # if !@HAVE_STRUCT_RANDOM_DATA@ || @REPLACE_RANDOM_R@ || !@HAVE_RANDOM_R@
71 # include <stdint.h>
72 # endif
74 # if !@HAVE_STRUCT_RANDOM_DATA@
75 /* Define 'struct random_data'.
76 But allow multiple gnulib generated <stdlib.h> replacements to coexist. */
77 # if !GNULIB_defined_struct_random_data
78 struct random_data
80 int32_t *fptr; /* Front pointer. */
81 int32_t *rptr; /* Rear pointer. */
82 int32_t *state; /* Array of state values. */
83 int rand_type; /* Type of random number generator. */
84 int rand_deg; /* Degree of random number generator. */
85 int rand_sep; /* Distance between front and rear. */
86 int32_t *end_ptr; /* Pointer behind state table. */
88 # define GNULIB_defined_struct_random_data 1
89 # endif
90 # endif
91 #endif
93 #if (@GNULIB_MKSTEMP@ || @GNULIB_MKSTEMPS@ || @GNULIB_MKOSTEMP@ || @GNULIB_MKOSTEMPS@ || @GNULIB_GETSUBOPT@ || defined GNULIB_POSIXCHECK) && ! defined __GLIBC__ && !(defined _WIN32 && ! defined __CYGWIN__)
94 /* On Mac OS X 10.3, only <unistd.h> declares mkstemp. */
95 /* On Mac OS X 10.5, only <unistd.h> declares mkstemps. */
96 /* On Mac OS X 10.13, only <unistd.h> declares mkostemp and mkostemps. */
97 /* On Cygwin 1.7.1, only <unistd.h> declares getsubopt. */
98 /* But avoid namespace pollution on glibc systems and native Windows. */
99 # include <unistd.h>
100 #endif
102 /* The __attribute__ feature is available in gcc versions 2.5 and later.
103 The attribute __pure__ was added in gcc 2.96. */
104 #ifndef _GL_ATTRIBUTE_PURE
105 # if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || defined __clang__
106 # define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
107 # else
108 # define _GL_ATTRIBUTE_PURE /* empty */
109 # endif
110 #endif
112 /* The definition of _Noreturn is copied here. */
114 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
116 /* The definition of _GL_ARG_NONNULL is copied here. */
118 /* The definition of _GL_WARN_ON_USE is copied here. */
121 /* Some systems do not define EXIT_*, despite otherwise supporting C89. */
122 #ifndef EXIT_SUCCESS
123 # define EXIT_SUCCESS 0
124 #endif
125 /* Tandem/NSK and other platforms that define EXIT_FAILURE as -1 interfere
126 with proper operation of xargs. */
127 #ifndef EXIT_FAILURE
128 # define EXIT_FAILURE 1
129 #elif EXIT_FAILURE != 1
130 # undef EXIT_FAILURE
131 # define EXIT_FAILURE 1
132 #endif
135 #if @GNULIB__EXIT@
136 /* Terminate the current process with the given return code, without running
137 the 'atexit' handlers. */
138 # if !@HAVE__EXIT@
139 _GL_FUNCDECL_SYS (_Exit, _Noreturn void, (int status));
140 # endif
141 _GL_CXXALIAS_SYS (_Exit, void, (int status));
142 _GL_CXXALIASWARN (_Exit);
143 #elif defined GNULIB_POSIXCHECK
144 # undef _Exit
145 # if HAVE_RAW_DECL__EXIT
146 _GL_WARN_ON_USE (_Exit, "_Exit is unportable - "
147 "use gnulib module _Exit for portability");
148 # endif
149 #endif
152 #if @GNULIB_ATOLL@
153 /* Parse a signed decimal integer.
154 Returns the value of the integer. Errors are not detected. */
155 # if !@HAVE_ATOLL@
156 _GL_FUNCDECL_SYS (atoll, long long, (const char *string)
157 _GL_ATTRIBUTE_PURE
158 _GL_ARG_NONNULL ((1)));
159 # endif
160 _GL_CXXALIAS_SYS (atoll, long long, (const char *string));
161 _GL_CXXALIASWARN (atoll);
162 #elif defined GNULIB_POSIXCHECK
163 # undef atoll
164 # if HAVE_RAW_DECL_ATOLL
165 _GL_WARN_ON_USE (atoll, "atoll is unportable - "
166 "use gnulib module atoll for portability");
167 # endif
168 #endif
170 #if @GNULIB_CALLOC_POSIX@
171 # if @REPLACE_CALLOC@
172 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
173 # undef calloc
174 # define calloc rpl_calloc
175 # endif
176 _GL_FUNCDECL_RPL (calloc, void *, (size_t nmemb, size_t size));
177 _GL_CXXALIAS_RPL (calloc, void *, (size_t nmemb, size_t size));
178 # else
179 _GL_CXXALIAS_SYS (calloc, void *, (size_t nmemb, size_t size));
180 # endif
181 # if __GLIBC__ >= 2
182 _GL_CXXALIASWARN (calloc);
183 # endif
184 #elif defined GNULIB_POSIXCHECK
185 # undef calloc
186 /* Assume calloc is always declared. */
187 _GL_WARN_ON_USE (calloc, "calloc is not POSIX compliant everywhere - "
188 "use gnulib module calloc-posix for portability");
189 #endif
191 #if @GNULIB_CANONICALIZE_FILE_NAME@
192 # if @REPLACE_CANONICALIZE_FILE_NAME@
193 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
194 # define canonicalize_file_name rpl_canonicalize_file_name
195 # endif
196 _GL_FUNCDECL_RPL (canonicalize_file_name, char *, (const char *name)
197 _GL_ARG_NONNULL ((1)));
198 _GL_CXXALIAS_RPL (canonicalize_file_name, char *, (const char *name));
199 # else
200 # if !@HAVE_CANONICALIZE_FILE_NAME@
201 _GL_FUNCDECL_SYS (canonicalize_file_name, char *, (const char *name)
202 _GL_ARG_NONNULL ((1)));
203 # endif
204 _GL_CXXALIAS_SYS (canonicalize_file_name, char *, (const char *name));
205 # endif
206 # ifndef GNULIB_defined_canonicalize_file_name
207 # define GNULIB_defined_canonicalize_file_name \
208 (!@HAVE_CANONICALIZE_FILE_NAME@ || @REPLACE_CANONICALIZE_FILE_NAME@)
209 # endif
210 _GL_CXXALIASWARN (canonicalize_file_name);
211 #elif defined GNULIB_POSIXCHECK
212 # undef canonicalize_file_name
213 # if HAVE_RAW_DECL_CANONICALIZE_FILE_NAME
214 _GL_WARN_ON_USE (canonicalize_file_name,
215 "canonicalize_file_name is unportable - "
216 "use gnulib module canonicalize-lgpl for portability");
217 # endif
218 #endif
220 #if defined _WIN32 && !defined __CYGWIN__
221 # undef ecvt
222 # define ecvt _ecvt
223 #endif
225 #if defined _WIN32 && !defined __CYGWIN__
226 # undef fcvt
227 # define fcvt _fcvt
228 #endif
230 #if defined _WIN32 && !defined __CYGWIN__
231 # undef gcvt
232 # define gcvt _gcvt
233 #endif
235 #if @GNULIB_GETLOADAVG@
236 /* Store max(NELEM,3) load average numbers in LOADAVG[].
237 The three numbers are the load average of the last 1 minute, the last 5
238 minutes, and the last 15 minutes, respectively.
239 LOADAVG is an array of NELEM numbers. */
240 # if !@HAVE_DECL_GETLOADAVG@
241 _GL_FUNCDECL_SYS (getloadavg, int, (double loadavg[], int nelem)
242 _GL_ARG_NONNULL ((1)));
243 # endif
244 _GL_CXXALIAS_SYS (getloadavg, int, (double loadavg[], int nelem));
245 _GL_CXXALIASWARN (getloadavg);
246 #elif defined GNULIB_POSIXCHECK
247 # undef getloadavg
248 # if HAVE_RAW_DECL_GETLOADAVG
249 _GL_WARN_ON_USE (getloadavg, "getloadavg is not portable - "
250 "use gnulib module getloadavg for portability");
251 # endif
252 #endif
254 #if @GNULIB_GETSUBOPT@
255 /* Assuming *OPTIONP is a comma separated list of elements of the form
256 "token" or "token=value", getsubopt parses the first of these elements.
257 If the first element refers to a "token" that is member of the given
258 NULL-terminated array of tokens:
259 - It replaces the comma with a NUL byte, updates *OPTIONP to point past
260 the first option and the comma, sets *VALUEP to the value of the
261 element (or NULL if it doesn't contain an "=" sign),
262 - It returns the index of the "token" in the given array of tokens.
263 Otherwise it returns -1, and *OPTIONP and *VALUEP are undefined.
264 For more details see the POSIX specification.
265 https://pubs.opengroup.org/onlinepubs/9699919799/functions/getsubopt.html */
266 # if !@HAVE_GETSUBOPT@
267 _GL_FUNCDECL_SYS (getsubopt, int,
268 (char **optionp, char *const *tokens, char **valuep)
269 _GL_ARG_NONNULL ((1, 2, 3)));
270 # endif
271 _GL_CXXALIAS_SYS (getsubopt, int,
272 (char **optionp, char *const *tokens, char **valuep));
273 _GL_CXXALIASWARN (getsubopt);
274 #elif defined GNULIB_POSIXCHECK
275 # undef getsubopt
276 # if HAVE_RAW_DECL_GETSUBOPT
277 _GL_WARN_ON_USE (getsubopt, "getsubopt is unportable - "
278 "use gnulib module getsubopt for portability");
279 # endif
280 #endif
282 #if @GNULIB_GRANTPT@
283 /* Change the ownership and access permission of the slave side of the
284 pseudo-terminal whose master side is specified by FD. */
285 # if !@HAVE_GRANTPT@
286 _GL_FUNCDECL_SYS (grantpt, int, (int fd));
287 # endif
288 _GL_CXXALIAS_SYS (grantpt, int, (int fd));
289 _GL_CXXALIASWARN (grantpt);
290 #elif defined GNULIB_POSIXCHECK
291 # undef grantpt
292 # if HAVE_RAW_DECL_GRANTPT
293 _GL_WARN_ON_USE (grantpt, "grantpt is not portable - "
294 "use gnulib module grantpt for portability");
295 # endif
296 #endif
298 /* If _GL_USE_STDLIB_ALLOC is nonzero, the including module does not
299 rely on GNU or POSIX semantics for malloc and realloc (for example,
300 by never specifying a zero size), so it does not need malloc or
301 realloc to be redefined. */
302 #if @GNULIB_MALLOC_POSIX@
303 # if @REPLACE_MALLOC@
304 # if !((defined __cplusplus && defined GNULIB_NAMESPACE) \
305 || _GL_USE_STDLIB_ALLOC)
306 # undef malloc
307 # define malloc rpl_malloc
308 # endif
309 _GL_FUNCDECL_RPL (malloc, void *, (size_t size));
310 _GL_CXXALIAS_RPL (malloc, void *, (size_t size));
311 # else
312 _GL_CXXALIAS_SYS (malloc, void *, (size_t size));
313 # endif
314 # if __GLIBC__ >= 2
315 _GL_CXXALIASWARN (malloc);
316 # endif
317 #elif defined GNULIB_POSIXCHECK && !_GL_USE_STDLIB_ALLOC
318 # undef malloc
319 /* Assume malloc is always declared. */
320 _GL_WARN_ON_USE (malloc, "malloc is not POSIX compliant everywhere - "
321 "use gnulib module malloc-posix for portability");
322 #endif
324 /* Convert a multibyte character to a wide character. */
325 #if @GNULIB_MBTOWC@
326 # if @REPLACE_MBTOWC@
327 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
328 # undef mbtowc
329 # define mbtowc rpl_mbtowc
330 # endif
331 _GL_FUNCDECL_RPL (mbtowc, int,
332 (wchar_t *restrict pwc, const char *restrict s, size_t n));
333 _GL_CXXALIAS_RPL (mbtowc, int,
334 (wchar_t *restrict pwc, const char *restrict s, size_t n));
335 # else
336 # if !@HAVE_MBTOWC@
337 _GL_FUNCDECL_SYS (mbtowc, int,
338 (wchar_t *restrict pwc, const char *restrict s, size_t n));
339 # endif
340 _GL_CXXALIAS_SYS (mbtowc, int,
341 (wchar_t *restrict pwc, const char *restrict s, size_t n));
342 # endif
343 # if __GLIBC__ >= 2
344 _GL_CXXALIASWARN (mbtowc);
345 # endif
346 #elif defined GNULIB_POSIXCHECK
347 # undef mbtowc
348 # if HAVE_RAW_DECL_MBTOWC
349 _GL_WARN_ON_USE (mbtowc, "mbtowc is not portable - "
350 "use gnulib module mbtowc for portability");
351 # endif
352 #endif
354 #if @GNULIB_MKDTEMP@
355 /* Create a unique temporary directory from TEMPLATE.
356 The last six characters of TEMPLATE must be "XXXXXX";
357 they are replaced with a string that makes the directory name unique.
358 Returns TEMPLATE, or a null pointer if it cannot get a unique name.
359 The directory is created mode 700. */
360 # if !@HAVE_MKDTEMP@
361 _GL_FUNCDECL_SYS (mkdtemp, char *, (char * /*template*/) _GL_ARG_NONNULL ((1)));
362 # endif
363 _GL_CXXALIAS_SYS (mkdtemp, char *, (char * /*template*/));
364 _GL_CXXALIASWARN (mkdtemp);
365 #elif defined GNULIB_POSIXCHECK
366 # undef mkdtemp
367 # if HAVE_RAW_DECL_MKDTEMP
368 _GL_WARN_ON_USE (mkdtemp, "mkdtemp is unportable - "
369 "use gnulib module mkdtemp for portability");
370 # endif
371 #endif
373 #if @GNULIB_MKOSTEMP@
374 /* Create a unique temporary file from TEMPLATE.
375 The last six characters of TEMPLATE must be "XXXXXX";
376 they are replaced with a string that makes the file name unique.
377 The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
378 and O_TEXT, O_BINARY (defined in "binary-io.h").
379 The file is then created, with the specified flags, ensuring it didn't exist
380 before.
381 The file is created read-write (mask at least 0600 & ~umask), but it may be
382 world-readable and world-writable (mask 0666 & ~umask), depending on the
383 implementation.
384 Returns the open file descriptor if successful, otherwise -1 and errno
385 set. */
386 # if !@HAVE_MKOSTEMP@
387 _GL_FUNCDECL_SYS (mkostemp, int, (char * /*template*/, int /*flags*/)
388 _GL_ARG_NONNULL ((1)));
389 # endif
390 _GL_CXXALIAS_SYS (mkostemp, int, (char * /*template*/, int /*flags*/));
391 _GL_CXXALIASWARN (mkostemp);
392 #elif defined GNULIB_POSIXCHECK
393 # undef mkostemp
394 # if HAVE_RAW_DECL_MKOSTEMP
395 _GL_WARN_ON_USE (mkostemp, "mkostemp is unportable - "
396 "use gnulib module mkostemp for portability");
397 # endif
398 #endif
400 #if @GNULIB_MKOSTEMPS@
401 /* Create a unique temporary file from TEMPLATE.
402 The last six characters of TEMPLATE before a suffix of length
403 SUFFIXLEN must be "XXXXXX";
404 they are replaced with a string that makes the file name unique.
405 The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
406 and O_TEXT, O_BINARY (defined in "binary-io.h").
407 The file is then created, with the specified flags, ensuring it didn't exist
408 before.
409 The file is created read-write (mask at least 0600 & ~umask), but it may be
410 world-readable and world-writable (mask 0666 & ~umask), depending on the
411 implementation.
412 Returns the open file descriptor if successful, otherwise -1 and errno
413 set. */
414 # if !@HAVE_MKOSTEMPS@
415 _GL_FUNCDECL_SYS (mkostemps, int,
416 (char * /*template*/, int /*suffixlen*/, int /*flags*/)
417 _GL_ARG_NONNULL ((1)));
418 # endif
419 _GL_CXXALIAS_SYS (mkostemps, int,
420 (char * /*template*/, int /*suffixlen*/, int /*flags*/));
421 _GL_CXXALIASWARN (mkostemps);
422 #elif defined GNULIB_POSIXCHECK
423 # undef mkostemps
424 # if HAVE_RAW_DECL_MKOSTEMPS
425 _GL_WARN_ON_USE (mkostemps, "mkostemps is unportable - "
426 "use gnulib module mkostemps for portability");
427 # endif
428 #endif
430 #if @GNULIB_MKSTEMP@
431 /* Create a unique temporary file from TEMPLATE.
432 The last six characters of TEMPLATE must be "XXXXXX";
433 they are replaced with a string that makes the file name unique.
434 The file is then created, ensuring it didn't exist before.
435 The file is created read-write (mask at least 0600 & ~umask), but it may be
436 world-readable and world-writable (mask 0666 & ~umask), depending on the
437 implementation.
438 Returns the open file descriptor if successful, otherwise -1 and errno
439 set. */
440 # if @REPLACE_MKSTEMP@
441 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
442 # define mkstemp rpl_mkstemp
443 # endif
444 _GL_FUNCDECL_RPL (mkstemp, int, (char * /*template*/) _GL_ARG_NONNULL ((1)));
445 _GL_CXXALIAS_RPL (mkstemp, int, (char * /*template*/));
446 # else
447 # if ! @HAVE_MKSTEMP@
448 _GL_FUNCDECL_SYS (mkstemp, int, (char * /*template*/) _GL_ARG_NONNULL ((1)));
449 # endif
450 _GL_CXXALIAS_SYS (mkstemp, int, (char * /*template*/));
451 # endif
452 _GL_CXXALIASWARN (mkstemp);
453 #elif defined GNULIB_POSIXCHECK
454 # undef mkstemp
455 # if HAVE_RAW_DECL_MKSTEMP
456 _GL_WARN_ON_USE (mkstemp, "mkstemp is unportable - "
457 "use gnulib module mkstemp for portability");
458 # endif
459 #endif
461 #if @GNULIB_MKSTEMPS@
462 /* Create a unique temporary file from TEMPLATE.
463 The last six characters of TEMPLATE prior to a suffix of length
464 SUFFIXLEN must be "XXXXXX";
465 they are replaced with a string that makes the file name unique.
466 The file is then created, ensuring it didn't exist before.
467 The file is created read-write (mask at least 0600 & ~umask), but it may be
468 world-readable and world-writable (mask 0666 & ~umask), depending on the
469 implementation.
470 Returns the open file descriptor if successful, otherwise -1 and errno
471 set. */
472 # if !@HAVE_MKSTEMPS@
473 _GL_FUNCDECL_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/)
474 _GL_ARG_NONNULL ((1)));
475 # endif
476 _GL_CXXALIAS_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/));
477 _GL_CXXALIASWARN (mkstemps);
478 #elif defined GNULIB_POSIXCHECK
479 # undef mkstemps
480 # if HAVE_RAW_DECL_MKSTEMPS
481 _GL_WARN_ON_USE (mkstemps, "mkstemps is unportable - "
482 "use gnulib module mkstemps for portability");
483 # endif
484 #endif
486 #if defined _WIN32 && !defined __CYGWIN__
487 # undef mktemp
488 # define mktemp _mktemp
489 #endif
491 /* Allocate memory with indefinite extent and specified alignment. */
492 #if @GNULIB_POSIX_MEMALIGN@
493 # if @REPLACE_POSIX_MEMALIGN@
494 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
495 # undef posix_memalign
496 # define posix_memalign rpl_posix_memalign
497 # endif
498 _GL_FUNCDECL_RPL (posix_memalign, int,
499 (void **memptr, size_t alignment, size_t size)
500 _GL_ARG_NONNULL ((1)));
501 _GL_CXXALIAS_RPL (posix_memalign, int,
502 (void **memptr, size_t alignment, size_t size));
503 # else
504 # if @HAVE_POSIX_MEMALIGN@
505 _GL_CXXALIAS_SYS (posix_memalign, int,
506 (void **memptr, size_t alignment, size_t size));
507 # endif
508 # endif
509 # if @HAVE_POSIX_MEMALIGN@
510 _GL_CXXALIASWARN (posix_memalign);
511 # endif
512 #elif defined GNULIB_POSIXCHECK
513 # undef posix_memalign
514 # if HAVE_RAW_DECL_POSIX_MEMALIGN
515 _GL_WARN_ON_USE (posix_memalign, "posix_memalign is not portable - "
516 "use gnulib module posix_memalign for portability");
517 # endif
518 #endif
520 #if @GNULIB_POSIX_OPENPT@
521 /* Return an FD open to the master side of a pseudo-terminal. Flags should
522 include O_RDWR, and may also include O_NOCTTY. */
523 # if !@HAVE_POSIX_OPENPT@
524 _GL_FUNCDECL_SYS (posix_openpt, int, (int flags));
525 # endif
526 _GL_CXXALIAS_SYS (posix_openpt, int, (int flags));
527 _GL_CXXALIASWARN (posix_openpt);
528 #elif defined GNULIB_POSIXCHECK
529 # undef posix_openpt
530 # if HAVE_RAW_DECL_POSIX_OPENPT
531 _GL_WARN_ON_USE (posix_openpt, "posix_openpt is not portable - "
532 "use gnulib module posix_openpt for portability");
533 # endif
534 #endif
536 #if @GNULIB_PTSNAME@
537 /* Return the pathname of the pseudo-terminal slave associated with
538 the master FD is open on, or NULL on errors. */
539 # if @REPLACE_PTSNAME@
540 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
541 # undef ptsname
542 # define ptsname rpl_ptsname
543 # endif
544 _GL_FUNCDECL_RPL (ptsname, char *, (int fd));
545 _GL_CXXALIAS_RPL (ptsname, char *, (int fd));
546 # else
547 # if !@HAVE_PTSNAME@
548 _GL_FUNCDECL_SYS (ptsname, char *, (int fd));
549 # endif
550 _GL_CXXALIAS_SYS (ptsname, char *, (int fd));
551 # endif
552 _GL_CXXALIASWARN (ptsname);
553 #elif defined GNULIB_POSIXCHECK
554 # undef ptsname
555 # if HAVE_RAW_DECL_PTSNAME
556 _GL_WARN_ON_USE (ptsname, "ptsname is not portable - "
557 "use gnulib module ptsname for portability");
558 # endif
559 #endif
561 #if @GNULIB_PTSNAME_R@
562 /* Set the pathname of the pseudo-terminal slave associated with
563 the master FD is open on and return 0, or set errno and return
564 non-zero on errors. */
565 # if @REPLACE_PTSNAME_R@
566 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
567 # undef ptsname_r
568 # define ptsname_r rpl_ptsname_r
569 # endif
570 _GL_FUNCDECL_RPL (ptsname_r, int, (int fd, char *buf, size_t len));
571 _GL_CXXALIAS_RPL (ptsname_r, int, (int fd, char *buf, size_t len));
572 # else
573 # if !@HAVE_PTSNAME_R@
574 _GL_FUNCDECL_SYS (ptsname_r, int, (int fd, char *buf, size_t len));
575 # endif
576 _GL_CXXALIAS_SYS (ptsname_r, int, (int fd, char *buf, size_t len));
577 # endif
578 # ifndef GNULIB_defined_ptsname_r
579 # define GNULIB_defined_ptsname_r (!@HAVE_PTSNAME_R@ || @REPLACE_PTSNAME_R@)
580 # endif
581 _GL_CXXALIASWARN (ptsname_r);
582 #elif defined GNULIB_POSIXCHECK
583 # undef ptsname_r
584 # if HAVE_RAW_DECL_PTSNAME_R
585 _GL_WARN_ON_USE (ptsname_r, "ptsname_r is not portable - "
586 "use gnulib module ptsname_r for portability");
587 # endif
588 #endif
590 #if @GNULIB_PUTENV@
591 # if @REPLACE_PUTENV@
592 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
593 # undef putenv
594 # define putenv rpl_putenv
595 # endif
596 _GL_FUNCDECL_RPL (putenv, int, (char *string) _GL_ARG_NONNULL ((1)));
597 _GL_CXXALIAS_RPL (putenv, int, (char *string));
598 # elif defined _WIN32 && !defined __CYGWIN__
599 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
600 # undef putenv
601 # define putenv _putenv
602 # endif
603 _GL_CXXALIAS_MDA (putenv, int, (char *string));
604 # else
605 _GL_CXXALIAS_SYS (putenv, int, (char *string));
606 # endif
607 _GL_CXXALIASWARN (putenv);
608 #elif defined _WIN32 && !defined __CYGWIN__
609 # undef putenv
610 # define putenv _putenv
611 #endif
613 #if @GNULIB_QSORT_R@
614 /* Sort an array of NMEMB elements, starting at address BASE, each element
615 occupying SIZE bytes, in ascending order according to the comparison
616 function COMPARE. */
617 # if @REPLACE_QSORT_R@
618 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
619 # undef qsort_r
620 # define qsort_r rpl_qsort_r
621 # endif
622 _GL_FUNCDECL_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size,
623 int (*compare) (void const *, void const *,
624 void *),
625 void *arg) _GL_ARG_NONNULL ((1, 4)));
626 _GL_CXXALIAS_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size,
627 int (*compare) (void const *, void const *,
628 void *),
629 void *arg));
630 # else
631 # if !@HAVE_QSORT_R@
632 _GL_FUNCDECL_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size,
633 int (*compare) (void const *, void const *,
634 void *),
635 void *arg) _GL_ARG_NONNULL ((1, 4)));
636 # endif
637 _GL_CXXALIAS_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size,
638 int (*compare) (void const *, void const *,
639 void *),
640 void *arg));
641 # endif
642 _GL_CXXALIASWARN (qsort_r);
643 #elif defined GNULIB_POSIXCHECK
644 # undef qsort_r
645 # if HAVE_RAW_DECL_QSORT_R
646 _GL_WARN_ON_USE (qsort_r, "qsort_r is not portable - "
647 "use gnulib module qsort_r for portability");
648 # endif
649 #endif
652 #if @GNULIB_RANDOM_R@
653 # if !@HAVE_RANDOM_R@
654 # ifndef RAND_MAX
655 # define RAND_MAX 2147483647
656 # endif
657 # endif
658 #endif
661 #if @GNULIB_RANDOM@
662 # if @REPLACE_RANDOM@
663 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
664 # undef random
665 # define random rpl_random
666 # endif
667 _GL_FUNCDECL_RPL (random, long, (void));
668 _GL_CXXALIAS_RPL (random, long, (void));
669 # else
670 # if !@HAVE_RANDOM@
671 _GL_FUNCDECL_SYS (random, long, (void));
672 # endif
673 /* Need to cast, because on Haiku, the return type is
674 int. */
675 _GL_CXXALIAS_SYS_CAST (random, long, (void));
676 # endif
677 _GL_CXXALIASWARN (random);
678 #elif defined GNULIB_POSIXCHECK
679 # undef random
680 # if HAVE_RAW_DECL_RANDOM
681 _GL_WARN_ON_USE (random, "random is unportable - "
682 "use gnulib module random for portability");
683 # endif
684 #endif
686 #if @GNULIB_RANDOM@
687 # if @REPLACE_RANDOM@
688 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
689 # undef srandom
690 # define srandom rpl_srandom
691 # endif
692 _GL_FUNCDECL_RPL (srandom, void, (unsigned int seed));
693 _GL_CXXALIAS_RPL (srandom, void, (unsigned int seed));
694 # else
695 # if !@HAVE_RANDOM@
696 _GL_FUNCDECL_SYS (srandom, void, (unsigned int seed));
697 # endif
698 /* Need to cast, because on FreeBSD, the first parameter is
699 unsigned long seed. */
700 _GL_CXXALIAS_SYS_CAST (srandom, void, (unsigned int seed));
701 # endif
702 _GL_CXXALIASWARN (srandom);
703 #elif defined GNULIB_POSIXCHECK
704 # undef srandom
705 # if HAVE_RAW_DECL_SRANDOM
706 _GL_WARN_ON_USE (srandom, "srandom is unportable - "
707 "use gnulib module random for portability");
708 # endif
709 #endif
711 #if @GNULIB_RANDOM@
712 # if @REPLACE_INITSTATE@
713 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
714 # undef initstate
715 # define initstate rpl_initstate
716 # endif
717 _GL_FUNCDECL_RPL (initstate, char *,
718 (unsigned int seed, char *buf, size_t buf_size)
719 _GL_ARG_NONNULL ((2)));
720 _GL_CXXALIAS_RPL (initstate, char *,
721 (unsigned int seed, char *buf, size_t buf_size));
722 # else
723 # if !@HAVE_INITSTATE@ || !@HAVE_DECL_INITSTATE@
724 _GL_FUNCDECL_SYS (initstate, char *,
725 (unsigned int seed, char *buf, size_t buf_size)
726 _GL_ARG_NONNULL ((2)));
727 # endif
728 /* Need to cast, because on FreeBSD, the first parameter is
729 unsigned long seed. */
730 _GL_CXXALIAS_SYS_CAST (initstate, char *,
731 (unsigned int seed, char *buf, size_t buf_size));
732 # endif
733 _GL_CXXALIASWARN (initstate);
734 #elif defined GNULIB_POSIXCHECK
735 # undef initstate
736 # if HAVE_RAW_DECL_INITSTATE
737 _GL_WARN_ON_USE (initstate, "initstate is unportable - "
738 "use gnulib module random for portability");
739 # endif
740 #endif
742 #if @GNULIB_RANDOM@
743 # if @REPLACE_SETSTATE@
744 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
745 # undef setstate
746 # define setstate rpl_setstate
747 # endif
748 _GL_FUNCDECL_RPL (setstate, char *, (char *arg_state) _GL_ARG_NONNULL ((1)));
749 _GL_CXXALIAS_RPL (setstate, char *, (char *arg_state));
750 # else
751 # if !@HAVE_SETSTATE@ || !@HAVE_DECL_SETSTATE@
752 _GL_FUNCDECL_SYS (setstate, char *, (char *arg_state) _GL_ARG_NONNULL ((1)));
753 # endif
754 /* Need to cast, because on Mac OS X 10.13, HP-UX, Solaris the first parameter
755 is const char *arg_state. */
756 _GL_CXXALIAS_SYS_CAST (setstate, char *, (char *arg_state));
757 # endif
758 _GL_CXXALIASWARN (setstate);
759 #elif defined GNULIB_POSIXCHECK
760 # undef setstate
761 # if HAVE_RAW_DECL_SETSTATE
762 _GL_WARN_ON_USE (setstate, "setstate is unportable - "
763 "use gnulib module random for portability");
764 # endif
765 #endif
768 #if @GNULIB_RANDOM_R@
769 # if @REPLACE_RANDOM_R@
770 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
771 # undef random_r
772 # define random_r rpl_random_r
773 # endif
774 _GL_FUNCDECL_RPL (random_r, int, (struct random_data *buf, int32_t *result)
775 _GL_ARG_NONNULL ((1, 2)));
776 _GL_CXXALIAS_RPL (random_r, int, (struct random_data *buf, int32_t *result));
777 # else
778 # if !@HAVE_RANDOM_R@
779 _GL_FUNCDECL_SYS (random_r, int, (struct random_data *buf, int32_t *result)
780 _GL_ARG_NONNULL ((1, 2)));
781 # endif
782 _GL_CXXALIAS_SYS (random_r, int, (struct random_data *buf, int32_t *result));
783 # endif
784 _GL_CXXALIASWARN (random_r);
785 #elif defined GNULIB_POSIXCHECK
786 # undef random_r
787 # if HAVE_RAW_DECL_RANDOM_R
788 _GL_WARN_ON_USE (random_r, "random_r is unportable - "
789 "use gnulib module random_r for portability");
790 # endif
791 #endif
793 #if @GNULIB_RANDOM_R@
794 # if @REPLACE_RANDOM_R@
795 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
796 # undef srandom_r
797 # define srandom_r rpl_srandom_r
798 # endif
799 _GL_FUNCDECL_RPL (srandom_r, int,
800 (unsigned int seed, struct random_data *rand_state)
801 _GL_ARG_NONNULL ((2)));
802 _GL_CXXALIAS_RPL (srandom_r, int,
803 (unsigned int seed, struct random_data *rand_state));
804 # else
805 # if !@HAVE_RANDOM_R@
806 _GL_FUNCDECL_SYS (srandom_r, int,
807 (unsigned int seed, struct random_data *rand_state)
808 _GL_ARG_NONNULL ((2)));
809 # endif
810 _GL_CXXALIAS_SYS (srandom_r, int,
811 (unsigned int seed, struct random_data *rand_state));
812 # endif
813 _GL_CXXALIASWARN (srandom_r);
814 #elif defined GNULIB_POSIXCHECK
815 # undef srandom_r
816 # if HAVE_RAW_DECL_SRANDOM_R
817 _GL_WARN_ON_USE (srandom_r, "srandom_r is unportable - "
818 "use gnulib module random_r for portability");
819 # endif
820 #endif
822 #if @GNULIB_RANDOM_R@
823 # if @REPLACE_RANDOM_R@
824 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
825 # undef initstate_r
826 # define initstate_r rpl_initstate_r
827 # endif
828 _GL_FUNCDECL_RPL (initstate_r, int,
829 (unsigned int seed, char *buf, size_t buf_size,
830 struct random_data *rand_state)
831 _GL_ARG_NONNULL ((2, 4)));
832 _GL_CXXALIAS_RPL (initstate_r, int,
833 (unsigned int seed, char *buf, size_t buf_size,
834 struct random_data *rand_state));
835 # else
836 # if !@HAVE_RANDOM_R@
837 _GL_FUNCDECL_SYS (initstate_r, int,
838 (unsigned int seed, char *buf, size_t buf_size,
839 struct random_data *rand_state)
840 _GL_ARG_NONNULL ((2, 4)));
841 # endif
842 /* Need to cast, because on Haiku, the third parameter is
843 unsigned long buf_size. */
844 _GL_CXXALIAS_SYS_CAST (initstate_r, int,
845 (unsigned int seed, char *buf, size_t buf_size,
846 struct random_data *rand_state));
847 # endif
848 _GL_CXXALIASWARN (initstate_r);
849 #elif defined GNULIB_POSIXCHECK
850 # undef initstate_r
851 # if HAVE_RAW_DECL_INITSTATE_R
852 _GL_WARN_ON_USE (initstate_r, "initstate_r is unportable - "
853 "use gnulib module random_r for portability");
854 # endif
855 #endif
857 #if @GNULIB_RANDOM_R@
858 # if @REPLACE_RANDOM_R@
859 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
860 # undef setstate_r
861 # define setstate_r rpl_setstate_r
862 # endif
863 _GL_FUNCDECL_RPL (setstate_r, int,
864 (char *arg_state, struct random_data *rand_state)
865 _GL_ARG_NONNULL ((1, 2)));
866 _GL_CXXALIAS_RPL (setstate_r, int,
867 (char *arg_state, struct random_data *rand_state));
868 # else
869 # if !@HAVE_RANDOM_R@
870 _GL_FUNCDECL_SYS (setstate_r, int,
871 (char *arg_state, struct random_data *rand_state)
872 _GL_ARG_NONNULL ((1, 2)));
873 # endif
874 /* Need to cast, because on Haiku, the first parameter is
875 void *arg_state. */
876 _GL_CXXALIAS_SYS_CAST (setstate_r, int,
877 (char *arg_state, struct random_data *rand_state));
878 # endif
879 _GL_CXXALIASWARN (setstate_r);
880 #elif defined GNULIB_POSIXCHECK
881 # undef setstate_r
882 # if HAVE_RAW_DECL_SETSTATE_R
883 _GL_WARN_ON_USE (setstate_r, "setstate_r is unportable - "
884 "use gnulib module random_r for portability");
885 # endif
886 #endif
889 #if @GNULIB_REALLOC_POSIX@
890 # if @REPLACE_REALLOC@
891 # if !((defined __cplusplus && defined GNULIB_NAMESPACE) \
892 || _GL_USE_STDLIB_ALLOC)
893 # undef realloc
894 # define realloc rpl_realloc
895 # endif
896 _GL_FUNCDECL_RPL (realloc, void *, (void *ptr, size_t size));
897 _GL_CXXALIAS_RPL (realloc, void *, (void *ptr, size_t size));
898 # else
899 _GL_CXXALIAS_SYS (realloc, void *, (void *ptr, size_t size));
900 # endif
901 # if __GLIBC__ >= 2
902 _GL_CXXALIASWARN (realloc);
903 # endif
904 #elif defined GNULIB_POSIXCHECK && !_GL_USE_STDLIB_ALLOC
905 # undef realloc
906 /* Assume realloc is always declared. */
907 _GL_WARN_ON_USE (realloc, "realloc is not POSIX compliant everywhere - "
908 "use gnulib module realloc-posix for portability");
909 #endif
912 #if @GNULIB_REALLOCARRAY@
913 # if ! @HAVE_REALLOCARRAY@
914 _GL_FUNCDECL_SYS (reallocarray, void *,
915 (void *ptr, size_t nmemb, size_t size));
916 # endif
917 _GL_CXXALIAS_SYS (reallocarray, void *,
918 (void *ptr, size_t nmemb, size_t size));
919 _GL_CXXALIASWARN (reallocarray);
920 #elif defined GNULIB_POSIXCHECK
921 # undef reallocarray
922 # if HAVE_RAW_DECL_REALLOCARRAY
923 _GL_WARN_ON_USE (reallocarray, "reallocarray is not portable - "
924 "use gnulib module reallocarray for portability");
925 # endif
926 #endif
928 #if @GNULIB_REALPATH@
929 # if @REPLACE_REALPATH@
930 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
931 # define realpath rpl_realpath
932 # endif
933 _GL_FUNCDECL_RPL (realpath, char *,
934 (const char *restrict name, char *restrict resolved)
935 _GL_ARG_NONNULL ((1)));
936 _GL_CXXALIAS_RPL (realpath, char *,
937 (const char *restrict name, char *restrict resolved));
938 # else
939 # if !@HAVE_REALPATH@
940 _GL_FUNCDECL_SYS (realpath, char *,
941 (const char *restrict name, char *restrict resolved)
942 _GL_ARG_NONNULL ((1)));
943 # endif
944 _GL_CXXALIAS_SYS (realpath, char *,
945 (const char *restrict name, char *restrict resolved));
946 # endif
947 _GL_CXXALIASWARN (realpath);
948 #elif defined GNULIB_POSIXCHECK
949 # undef realpath
950 # if HAVE_RAW_DECL_REALPATH
951 _GL_WARN_ON_USE (realpath, "realpath is unportable - use gnulib module "
952 "canonicalize or canonicalize-lgpl for portability");
953 # endif
954 #endif
956 #if @GNULIB_RPMATCH@
957 /* Test a user response to a question.
958 Return 1 if it is affirmative, 0 if it is negative, or -1 if not clear. */
959 # if !@HAVE_RPMATCH@
960 _GL_FUNCDECL_SYS (rpmatch, int, (const char *response) _GL_ARG_NONNULL ((1)));
961 # endif
962 _GL_CXXALIAS_SYS (rpmatch, int, (const char *response));
963 _GL_CXXALIASWARN (rpmatch);
964 #elif defined GNULIB_POSIXCHECK
965 # undef rpmatch
966 # if HAVE_RAW_DECL_RPMATCH
967 _GL_WARN_ON_USE (rpmatch, "rpmatch is unportable - "
968 "use gnulib module rpmatch for portability");
969 # endif
970 #endif
972 #if @GNULIB_SECURE_GETENV@
973 /* Look up NAME in the environment, returning 0 in insecure situations. */
974 # if !@HAVE_SECURE_GETENV@
975 _GL_FUNCDECL_SYS (secure_getenv, char *,
976 (char const *name) _GL_ARG_NONNULL ((1)));
977 # endif
978 _GL_CXXALIAS_SYS (secure_getenv, char *, (char const *name));
979 _GL_CXXALIASWARN (secure_getenv);
980 #elif defined GNULIB_POSIXCHECK
981 # undef secure_getenv
982 # if HAVE_RAW_DECL_SECURE_GETENV
983 _GL_WARN_ON_USE (secure_getenv, "secure_getenv is unportable - "
984 "use gnulib module secure_getenv for portability");
985 # endif
986 #endif
988 #if @GNULIB_SETENV@
989 /* Set NAME to VALUE in the environment.
990 If REPLACE is nonzero, overwrite an existing value. */
991 # if @REPLACE_SETENV@
992 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
993 # undef setenv
994 # define setenv rpl_setenv
995 # endif
996 _GL_FUNCDECL_RPL (setenv, int,
997 (const char *name, const char *value, int replace)
998 _GL_ARG_NONNULL ((1)));
999 _GL_CXXALIAS_RPL (setenv, int,
1000 (const char *name, const char *value, int replace));
1001 # else
1002 # if !@HAVE_DECL_SETENV@
1003 _GL_FUNCDECL_SYS (setenv, int,
1004 (const char *name, const char *value, int replace)
1005 _GL_ARG_NONNULL ((1)));
1006 # endif
1007 _GL_CXXALIAS_SYS (setenv, int,
1008 (const char *name, const char *value, int replace));
1009 # endif
1010 # if !(@REPLACE_SETENV@ && !@HAVE_DECL_SETENV@)
1011 _GL_CXXALIASWARN (setenv);
1012 # endif
1013 #elif defined GNULIB_POSIXCHECK
1014 # undef setenv
1015 # if HAVE_RAW_DECL_SETENV
1016 _GL_WARN_ON_USE (setenv, "setenv is unportable - "
1017 "use gnulib module setenv for portability");
1018 # endif
1019 #endif
1021 #if @GNULIB_STRTOD@
1022 /* Parse a double from STRING, updating ENDP if appropriate. */
1023 # if @REPLACE_STRTOD@
1024 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1025 # define strtod rpl_strtod
1026 # endif
1027 # define GNULIB_defined_strtod_function 1
1028 _GL_FUNCDECL_RPL (strtod, double,
1029 (const char *restrict str, char **restrict endp)
1030 _GL_ARG_NONNULL ((1)));
1031 _GL_CXXALIAS_RPL (strtod, double,
1032 (const char *restrict str, char **restrict endp));
1033 # else
1034 # if !@HAVE_STRTOD@
1035 _GL_FUNCDECL_SYS (strtod, double,
1036 (const char *restrict str, char **restrict endp)
1037 _GL_ARG_NONNULL ((1)));
1038 # endif
1039 _GL_CXXALIAS_SYS (strtod, double,
1040 (const char *restrict str, char **restrict endp));
1041 # endif
1042 # if __GLIBC__ >= 2
1043 _GL_CXXALIASWARN (strtod);
1044 # endif
1045 #elif defined GNULIB_POSIXCHECK
1046 # undef strtod
1047 # if HAVE_RAW_DECL_STRTOD
1048 _GL_WARN_ON_USE (strtod, "strtod is unportable - "
1049 "use gnulib module strtod for portability");
1050 # endif
1051 #endif
1053 #if @GNULIB_STRTOLD@
1054 /* Parse a 'long double' from STRING, updating ENDP if appropriate. */
1055 # if @REPLACE_STRTOLD@
1056 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1057 # define strtold rpl_strtold
1058 # endif
1059 # define GNULIB_defined_strtold_function 1
1060 _GL_FUNCDECL_RPL (strtold, long double,
1061 (const char *restrict str, char **restrict endp)
1062 _GL_ARG_NONNULL ((1)));
1063 _GL_CXXALIAS_RPL (strtold, long double,
1064 (const char *restrict str, char **restrict endp));
1065 # else
1066 # if !@HAVE_STRTOLD@
1067 _GL_FUNCDECL_SYS (strtold, long double,
1068 (const char *restrict str, char **restrict endp)
1069 _GL_ARG_NONNULL ((1)));
1070 # endif
1071 _GL_CXXALIAS_SYS (strtold, long double,
1072 (const char *restrict str, char **restrict endp));
1073 # endif
1074 _GL_CXXALIASWARN (strtold);
1075 #elif defined GNULIB_POSIXCHECK
1076 # undef strtold
1077 # if HAVE_RAW_DECL_STRTOLD
1078 _GL_WARN_ON_USE (strtold, "strtold is unportable - "
1079 "use gnulib module strtold for portability");
1080 # endif
1081 #endif
1083 #if @GNULIB_STRTOLL@
1084 /* Parse a signed integer whose textual representation starts at STRING.
1085 The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0,
1086 it may be decimal or octal (with prefix "0") or hexadecimal (with prefix
1087 "0x").
1088 If ENDPTR is not NULL, the address of the first byte after the integer is
1089 stored in *ENDPTR.
1090 Upon overflow, the return value is LLONG_MAX or LLONG_MIN, and errno is set
1091 to ERANGE. */
1092 # if !@HAVE_STRTOLL@
1093 _GL_FUNCDECL_SYS (strtoll, long long,
1094 (const char *restrict string, char **restrict endptr,
1095 int base)
1096 _GL_ARG_NONNULL ((1)));
1097 # endif
1098 _GL_CXXALIAS_SYS (strtoll, long long,
1099 (const char *restrict string, char **restrict endptr,
1100 int base));
1101 _GL_CXXALIASWARN (strtoll);
1102 #elif defined GNULIB_POSIXCHECK
1103 # undef strtoll
1104 # if HAVE_RAW_DECL_STRTOLL
1105 _GL_WARN_ON_USE (strtoll, "strtoll is unportable - "
1106 "use gnulib module strtoll for portability");
1107 # endif
1108 #endif
1110 #if @GNULIB_STRTOULL@
1111 /* Parse an unsigned integer whose textual representation starts at STRING.
1112 The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0,
1113 it may be decimal or octal (with prefix "0") or hexadecimal (with prefix
1114 "0x").
1115 If ENDPTR is not NULL, the address of the first byte after the integer is
1116 stored in *ENDPTR.
1117 Upon overflow, the return value is ULLONG_MAX, and errno is set to
1118 ERANGE. */
1119 # if !@HAVE_STRTOULL@
1120 _GL_FUNCDECL_SYS (strtoull, unsigned long long,
1121 (const char *restrict string, char **restrict endptr,
1122 int base)
1123 _GL_ARG_NONNULL ((1)));
1124 # endif
1125 _GL_CXXALIAS_SYS (strtoull, unsigned long long,
1126 (const char *restrict string, char **restrict endptr,
1127 int base));
1128 _GL_CXXALIASWARN (strtoull);
1129 #elif defined GNULIB_POSIXCHECK
1130 # undef strtoull
1131 # if HAVE_RAW_DECL_STRTOULL
1132 _GL_WARN_ON_USE (strtoull, "strtoull is unportable - "
1133 "use gnulib module strtoull for portability");
1134 # endif
1135 #endif
1137 #if @GNULIB_UNLOCKPT@
1138 /* Unlock the slave side of the pseudo-terminal whose master side is specified
1139 by FD, so that it can be opened. */
1140 # if !@HAVE_UNLOCKPT@
1141 _GL_FUNCDECL_SYS (unlockpt, int, (int fd));
1142 # endif
1143 _GL_CXXALIAS_SYS (unlockpt, int, (int fd));
1144 _GL_CXXALIASWARN (unlockpt);
1145 #elif defined GNULIB_POSIXCHECK
1146 # undef unlockpt
1147 # if HAVE_RAW_DECL_UNLOCKPT
1148 _GL_WARN_ON_USE (unlockpt, "unlockpt is not portable - "
1149 "use gnulib module unlockpt for portability");
1150 # endif
1151 #endif
1153 #if @GNULIB_UNSETENV@
1154 /* Remove the variable NAME from the environment. */
1155 # if @REPLACE_UNSETENV@
1156 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1157 # undef unsetenv
1158 # define unsetenv rpl_unsetenv
1159 # endif
1160 _GL_FUNCDECL_RPL (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1)));
1161 _GL_CXXALIAS_RPL (unsetenv, int, (const char *name));
1162 # else
1163 # if !@HAVE_DECL_UNSETENV@
1164 _GL_FUNCDECL_SYS (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1)));
1165 # endif
1166 _GL_CXXALIAS_SYS (unsetenv, int, (const char *name));
1167 # endif
1168 # if !(@REPLACE_UNSETENV@ && !@HAVE_DECL_UNSETENV@)
1169 _GL_CXXALIASWARN (unsetenv);
1170 # endif
1171 #elif defined GNULIB_POSIXCHECK
1172 # undef unsetenv
1173 # if HAVE_RAW_DECL_UNSETENV
1174 _GL_WARN_ON_USE (unsetenv, "unsetenv is unportable - "
1175 "use gnulib module unsetenv for portability");
1176 # endif
1177 #endif
1179 /* Convert a wide character to a multibyte character. */
1180 #if @GNULIB_WCTOMB@
1181 # if @REPLACE_WCTOMB@
1182 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1183 # undef wctomb
1184 # define wctomb rpl_wctomb
1185 # endif
1186 _GL_FUNCDECL_RPL (wctomb, int, (char *s, wchar_t wc));
1187 _GL_CXXALIAS_RPL (wctomb, int, (char *s, wchar_t wc));
1188 # else
1189 _GL_CXXALIAS_SYS (wctomb, int, (char *s, wchar_t wc));
1190 # endif
1191 # if __GLIBC__ >= 2
1192 _GL_CXXALIASWARN (wctomb);
1193 # endif
1194 #endif
1197 #endif /* _@GUARD_PREFIX@_STDLIB_H */
1198 #endif /* _@GUARD_PREFIX@_STDLIB_H */
1199 #endif