Debian Codegraph @

lib/stdlib.in.h

raw symbols SCIP
1 /* A GNU-like <stdlib.h>.
2
3 Copyright (C) 1995, 2001-2004, 2006-2023 Free Software Foundation, Inc.
4
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.
9
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.
14
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/>. */
17
18 #if __GNUC__ >= 3
19 @PRAGMA_SYSTEM_HEADER@
20 #endif
21 @PRAGMA_COLUMNS@
22
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. */
26
27 #@INCLUDE_NEXT@ @NEXT_STDLIB_H@
28
29 #else
30 /* Normal invocation convention. */
31
32 #ifndef _@GUARD_PREFIX@_STDLIB_H
33
34 /* The include_next requires a split double-inclusion guard. */
35 #@INCLUDE_NEXT@ @NEXT_STDLIB_H@
36
37 #ifndef _@GUARD_PREFIX@_STDLIB_H
38 #define _@GUARD_PREFIX@_STDLIB_H
39
40 /* NetBSD 5.0 mis-defines NULL. */
41 #include <stddef.h>
42
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
47
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
55
56 /* Native Windows platforms declare _mktemp() in <io.h>. */
57 #if defined _WIN32 && !defined __CYGWIN__
58 # include <io.h>
59 #endif
60
61 #if @GNULIB_RANDOM_R@
62
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
69
70 # if !@HAVE_STRUCT_RANDOM_DATA@ || @REPLACE_RANDOM_R@ || !@HAVE_RANDOM_R@
71 # include <stdint.h>
72 # endif
73
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
79 {
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. */
87 };
88 # define GNULIB_defined_struct_random_data 1
89 # endif
90 # endif
91 #endif
92
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
101
102 /* _GL_ATTRIBUTE_DEALLOC (F, I) declares that the function returns pointers
103 that can be freed by passing them as the Ith argument to the
104 function F. */
105 #ifndef _GL_ATTRIBUTE_DEALLOC
106 # if __GNUC__ >= 11
107 # define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
108 # else
109 # define _GL_ATTRIBUTE_DEALLOC(f, i)
110 # endif
111 #endif
112
113 /* _GL_ATTRIBUTE_DEALLOC_FREE declares that the function returns pointers that
114 can be freed via 'free'; it can be used only after declaring 'free'. */
115 /* Applies to: functions. Cannot be used on inline functions. */
116 #ifndef _GL_ATTRIBUTE_DEALLOC_FREE
117 # define _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_DEALLOC (free, 1)
118 #endif
119
120 /* _GL_ATTRIBUTE_MALLOC declares that the function returns a pointer to freshly
121 allocated memory. */
122 /* Applies to: functions. */
123 #ifndef _GL_ATTRIBUTE_MALLOC
124 # if __GNUC__ >= 3 || defined __clang__
125 # define _GL_ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
126 # else
127 # define _GL_ATTRIBUTE_MALLOC
128 # endif
129 #endif
130
131 /* The __attribute__ feature is available in gcc versions 2.5 and later.
132 The attribute __pure__ was added in gcc 2.96. */
133 #ifndef _GL_ATTRIBUTE_PURE
134 # if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || defined __clang__
135 # define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
136 # else
137 # define _GL_ATTRIBUTE_PURE /* empty */
138 # endif
139 #endif
140
141 /* The definition of _Noreturn is copied here. */
142
143 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
144
145 /* The definition of _GL_ARG_NONNULL is copied here. */
146
147 /* The definition of _GL_WARN_ON_USE is copied here. */
148
149
150 /* Some systems do not define EXIT_*, despite otherwise supporting C89. */
151 #ifndef EXIT_SUCCESS
152 # define EXIT_SUCCESS 0
153 #endif
154 /* Tandem/NSK and other platforms that define EXIT_FAILURE as -1 interfere
155 with proper operation of xargs. */
156 #ifndef EXIT_FAILURE
157 # define EXIT_FAILURE 1
158 #elif EXIT_FAILURE != 1
159 # undef EXIT_FAILURE
160 # define EXIT_FAILURE 1
161 #endif
162
163
164 #if @GNULIB__EXIT@
165 /* Terminate the current process with the given return code, without running
166 the 'atexit' handlers. */
167 # if @REPLACE__EXIT@
168 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
169 # undef _Exit
170 # define _Exit rpl__Exit
171 # endif
172 _GL_FUNCDECL_RPL (_Exit, _Noreturn void, (int status));
173 _GL_CXXALIAS_RPL (_Exit, void, (int status));
174 # else
175 # if !@HAVE__EXIT@
176 _GL_FUNCDECL_SYS (_Exit, _Noreturn void, (int status));
177 # endif
178 _GL_CXXALIAS_SYS (_Exit, void, (int status));
179 # endif
180 # if __GLIBC__ >= 2
181 _GL_CXXALIASWARN (_Exit);
182 # endif
183 #elif defined GNULIB_POSIXCHECK
184 # undef _Exit
185 # if HAVE_RAW_DECL__EXIT
186 _GL_WARN_ON_USE (_Exit, "_Exit is unportable - "
187 "use gnulib module _Exit for portability");
188 # endif
189 #endif
190
191
192 #if @GNULIB_FREE_POSIX@
193 # if @REPLACE_FREE@
194 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
195 # undef free
196 # define free rpl_free
197 # endif
198 # if defined __cplusplus && (__GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2)
199 _GL_FUNCDECL_RPL (free, void, (void *ptr) throw ());
200 # else
201 _GL_FUNCDECL_RPL (free, void, (void *ptr));
202 # endif
203 _GL_CXXALIAS_RPL (free, void, (void *ptr));
204 # else
205 _GL_CXXALIAS_SYS (free, void, (void *ptr));
206 # endif
207 # if __GLIBC__ >= 2
208 _GL_CXXALIASWARN (free);
209 # endif
210 #elif defined GNULIB_POSIXCHECK
211 # undef free
212 /* Assume free is always declared. */
213 _GL_WARN_ON_USE (free, "free is not future POSIX compliant everywhere - "
214 "use gnulib module free for portability");
215 #endif
216
217
218 /* Allocate memory with indefinite extent and specified alignment. */
219 #if @GNULIB_ALIGNED_ALLOC@
220 # if @REPLACE_ALIGNED_ALLOC@
221 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
222 # undef aligned_alloc
223 # define aligned_alloc rpl_aligned_alloc
224 # endif
225 _GL_FUNCDECL_RPL (aligned_alloc, void *,
226 (size_t alignment, size_t size)
227 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
228 _GL_CXXALIAS_RPL (aligned_alloc, void *, (size_t alignment, size_t size));
229 # else
230 # if @HAVE_ALIGNED_ALLOC@
231 # if __GNUC__ >= 11
232 /* For -Wmismatched-dealloc: Associate aligned_alloc with free or rpl_free. */
233 _GL_FUNCDECL_SYS (aligned_alloc, void *,
234 (size_t alignment, size_t size)
235 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
236 # endif
237 _GL_CXXALIAS_SYS (aligned_alloc, void *, (size_t alignment, size_t size));
238 # endif
239 # endif
240 # if (__GLIBC__ >= 2) && @HAVE_ALIGNED_ALLOC@
241 _GL_CXXALIASWARN (aligned_alloc);
242 # endif
243 #else
244 # if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined aligned_alloc
245 /* For -Wmismatched-dealloc: Associate aligned_alloc with free or rpl_free. */
246 _GL_FUNCDECL_SYS (aligned_alloc, void *,
247 (size_t alignment, size_t size)
248 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
249 # endif
250 # if defined GNULIB_POSIXCHECK
251 # undef aligned_alloc
252 # if HAVE_RAW_DECL_ALIGNED_ALLOC
253 _GL_WARN_ON_USE (aligned_alloc, "aligned_alloc is not portable - "
254 "use gnulib module aligned_alloc for portability");
255 # endif
256 # endif
257 #endif
258
259 #if @GNULIB_ATOLL@
260 /* Parse a signed decimal integer.
261 Returns the value of the integer. Errors are not detected. */
262 # if !@HAVE_ATOLL@
263 _GL_FUNCDECL_SYS (atoll, long long, (const char *string)
264 _GL_ATTRIBUTE_PURE
265 _GL_ARG_NONNULL ((1)));
266 # endif
267 _GL_CXXALIAS_SYS (atoll, long long, (const char *string));
268 _GL_CXXALIASWARN (atoll);
269 #elif defined GNULIB_POSIXCHECK
270 # undef atoll
271 # if HAVE_RAW_DECL_ATOLL
272 _GL_WARN_ON_USE (atoll, "atoll is unportable - "
273 "use gnulib module atoll for portability");
274 # endif
275 #endif
276
277 #if @GNULIB_CALLOC_POSIX@
278 # if (@GNULIB_CALLOC_POSIX@ && @REPLACE_CALLOC_FOR_CALLOC_POSIX@) \
279 || (@GNULIB_CALLOC_GNU@ && @REPLACE_CALLOC_FOR_CALLOC_GNU@)
280 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
281 # undef calloc
282 # define calloc rpl_calloc
283 # endif
284 _GL_FUNCDECL_RPL (calloc, void *,
285 (size_t nmemb, size_t size)
286 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
287 _GL_CXXALIAS_RPL (calloc, void *, (size_t nmemb, size_t size));
288 # else
289 # if __GNUC__ >= 11
290 /* For -Wmismatched-dealloc: Associate calloc with free or rpl_free. */
291 _GL_FUNCDECL_SYS (calloc, void *,
292 (size_t nmemb, size_t size)
293 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
294 # endif
295 _GL_CXXALIAS_SYS (calloc, void *, (size_t nmemb, size_t size));
296 # endif
297 # if __GLIBC__ >= 2
298 _GL_CXXALIASWARN (calloc);
299 # endif
300 #else
301 # if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined calloc
302 /* For -Wmismatched-dealloc: Associate calloc with free or rpl_free. */
303 _GL_FUNCDECL_SYS (calloc, void *,
304 (size_t nmemb, size_t size)
305 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
306 # endif
307 # if defined GNULIB_POSIXCHECK
308 # undef calloc
309 /* Assume calloc is always declared. */
310 _GL_WARN_ON_USE (calloc, "calloc is not POSIX compliant everywhere - "
311 "use gnulib module calloc-posix for portability");
312 # endif
313 #endif
314
315 #if @GNULIB_CANONICALIZE_FILE_NAME@
316 # if @REPLACE_CANONICALIZE_FILE_NAME@
317 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
318 # define canonicalize_file_name rpl_canonicalize_file_name
319 # endif
320 _GL_FUNCDECL_RPL (canonicalize_file_name, char *,
321 (const char *name)
322 _GL_ARG_NONNULL ((1))
323 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
324 _GL_CXXALIAS_RPL (canonicalize_file_name, char *, (const char *name));
325 # else
326 # if !@HAVE_CANONICALIZE_FILE_NAME@ || __GNUC__ >= 11
327 _GL_FUNCDECL_SYS (canonicalize_file_name, char *,
328 (const char *name)
329 _GL_ARG_NONNULL ((1))
330 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
331 # endif
332 _GL_CXXALIAS_SYS (canonicalize_file_name, char *, (const char *name));
333 # endif
334 # ifndef GNULIB_defined_canonicalize_file_name
335 # define GNULIB_defined_canonicalize_file_name \
336 (!@HAVE_CANONICALIZE_FILE_NAME@ || @REPLACE_CANONICALIZE_FILE_NAME@)
337 # endif
338 _GL_CXXALIASWARN (canonicalize_file_name);
339 #else
340 # if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined canonicalize_file_name
341 /* For -Wmismatched-dealloc: Associate canonicalize_file_name with free or
342 rpl_free. */
343 _GL_FUNCDECL_SYS (canonicalize_file_name, char *,
344 (const char *name)
345 _GL_ARG_NONNULL ((1))
346 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
347 # endif
348 # if defined GNULIB_POSIXCHECK
349 # undef canonicalize_file_name
350 # if HAVE_RAW_DECL_CANONICALIZE_FILE_NAME
351 _GL_WARN_ON_USE (canonicalize_file_name,
352 "canonicalize_file_name is unportable - "
353 "use gnulib module canonicalize-lgpl for portability");
354 # endif
355 # endif
356 #endif
357
358 #if @GNULIB_MDA_ECVT@
359 /* On native Windows, map 'ecvt' to '_ecvt', so that -loldnames is not
360 required. In C++ with GNULIB_NAMESPACE, avoid differences between
361 platforms by defining GNULIB_NAMESPACE::ecvt on all platforms that have
362 it. */
363 # if defined _WIN32 && !defined __CYGWIN__
364 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
365 # undef ecvt
366 # define ecvt _ecvt
367 # endif
368 _GL_CXXALIAS_MDA (ecvt, char *,
369 (double number, int ndigits, int *decptp, int *signp));
370 # else
371 # if @HAVE_DECL_ECVT@
372 _GL_CXXALIAS_SYS (ecvt, char *,
373 (double number, int ndigits, int *decptp, int *signp));
374 # endif
375 # endif
376 # if (defined _WIN32 && !defined __CYGWIN__) || @HAVE_DECL_ECVT@
377 _GL_CXXALIASWARN (ecvt);
378 # endif
379 #endif
380
381 #if @GNULIB_MDA_FCVT@
382 /* On native Windows, map 'fcvt' to '_fcvt', so that -loldnames is not
383 required. In C++ with GNULIB_NAMESPACE, avoid differences between
384 platforms by defining GNULIB_NAMESPACE::fcvt on all platforms that have
385 it. */
386 # if defined _WIN32 && !defined __CYGWIN__
387 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
388 # undef fcvt
389 # define fcvt _fcvt
390 # endif
391 _GL_CXXALIAS_MDA (fcvt, char *,
392 (double number, int ndigits, int *decptp, int *signp));
393 # else
394 # if @HAVE_DECL_FCVT@
395 _GL_CXXALIAS_SYS (fcvt, char *,
396 (double number, int ndigits, int *decptp, int *signp));
397 # endif
398 # endif
399 # if (defined _WIN32 && !defined __CYGWIN__) || @HAVE_DECL_FCVT@
400 _GL_CXXALIASWARN (fcvt);
401 # endif
402 #endif
403
404 #if @GNULIB_MDA_GCVT@
405 /* On native Windows, map 'gcvt' to '_gcvt', so that -loldnames is not
406 required. In C++ with GNULIB_NAMESPACE, avoid differences between
407 platforms by defining GNULIB_NAMESPACE::gcvt on all platforms that have
408 it. */
409 # if defined _WIN32 && !defined __CYGWIN__
410 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
411 # undef gcvt
412 # define gcvt _gcvt
413 # endif
414 _GL_CXXALIAS_MDA (gcvt, char *, (double number, int ndigits, char *buf));
415 # else
416 # if @HAVE_DECL_GCVT@
417 _GL_CXXALIAS_SYS (gcvt, char *, (double number, int ndigits, char *buf));
418 # endif
419 # endif
420 # if (defined _WIN32 && !defined __CYGWIN__) || @HAVE_DECL_GCVT@
421 _GL_CXXALIASWARN (gcvt);
422 # endif
423 #endif
424
425 #if @GNULIB_GETLOADAVG@
426 /* Store max(NELEM,3) load average numbers in LOADAVG[].
427 The three numbers are the load average of the last 1 minute, the last 5
428 minutes, and the last 15 minutes, respectively.
429 LOADAVG is an array of NELEM numbers. */
430 # if @REPLACE_GETLOADAVG@
431 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
432 # undef getloadavg
433 # define getloadavg rpl_getloadavg
434 # endif
435 _GL_FUNCDECL_RPL (getloadavg, int, (double loadavg[], int nelem)
436 _GL_ARG_NONNULL ((1)));
437 _GL_CXXALIAS_RPL (getloadavg, int, (double loadavg[], int nelem));
438 # else
439 # if !@HAVE_DECL_GETLOADAVG@
440 _GL_FUNCDECL_SYS (getloadavg, int, (double loadavg[], int nelem)
441 _GL_ARG_NONNULL ((1)));
442 # endif
443 _GL_CXXALIAS_SYS (getloadavg, int, (double loadavg[], int nelem));
444 # endif
445 # if __GLIBC__ >= 2
446 _GL_CXXALIASWARN (getloadavg);
447 # endif
448 #elif defined GNULIB_POSIXCHECK
449 # undef getloadavg
450 # if HAVE_RAW_DECL_GETLOADAVG
451 _GL_WARN_ON_USE (getloadavg, "getloadavg is not portable - "
452 "use gnulib module getloadavg for portability");
453 # endif
454 #endif
455
456 #if @GNULIB_GETPROGNAME@
457 /* Return the base name of the executing program.
458 On native Windows this will usually end in ".exe" or ".EXE". */
459 # if @REPLACE_GETPROGNAME@
460 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
461 # undef getprogname
462 # define getprogname rpl_getprogname
463 # endif
464 # ifdef HAVE_DECL_PROGRAM_INVOCATION_NAME
465 _GL_FUNCDECL_RPL (getprogname, const char *, (void) _GL_ATTRIBUTE_PURE);
466 # else
467 _GL_FUNCDECL_RPL (getprogname, const char *, (void));
468 # endif
469 _GL_CXXALIAS_RPL (getprogname, const char *, (void));
470 # else
471 # if !@HAVE_GETPROGNAME@
472 # ifdef HAVE_DECL_PROGRAM_INVOCATION_NAME
473 _GL_FUNCDECL_SYS (getprogname, const char *, (void) _GL_ATTRIBUTE_PURE);
474 # else
475 _GL_FUNCDECL_SYS (getprogname, const char *, (void));
476 # endif
477 # endif
478 _GL_CXXALIAS_SYS (getprogname, const char *, (void));
479 # endif
480 # if __GLIBC__ >= 2
481 _GL_CXXALIASWARN (getprogname);
482 # endif
483 #elif defined GNULIB_POSIXCHECK
484 # undef getprogname
485 # if HAVE_RAW_DECL_GETPROGNAME
486 _GL_WARN_ON_USE (getprogname, "getprogname is unportable - "
487 "use gnulib module getprogname for portability");
488 # endif
489 #endif
490
491 #if @GNULIB_GETSUBOPT@
492 /* Assuming *OPTIONP is a comma separated list of elements of the form
493 "token" or "token=value", getsubopt parses the first of these elements.
494 If the first element refers to a "token" that is member of the given
495 NULL-terminated array of tokens:
496 - It replaces the comma with a NUL byte, updates *OPTIONP to point past
497 the first option and the comma, sets *VALUEP to the value of the
498 element (or NULL if it doesn't contain an "=" sign),
499 - It returns the index of the "token" in the given array of tokens.
500 Otherwise it returns -1, and *OPTIONP and *VALUEP are undefined.
501 For more details see the POSIX specification.
502 https://pubs.opengroup.org/onlinepubs/9699919799/functions/getsubopt.html */
503 # if @REPLACE_GETSUBOPT@
504 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
505 # undef getsubopt
506 # define getsubopt rpl_getsubopt
507 # endif
508 _GL_FUNCDECL_RPL (getsubopt, int,
509 (char **optionp, char *const *tokens, char **valuep)
510 _GL_ARG_NONNULL ((1, 2, 3)));
511 _GL_CXXALIAS_RPL (getsubopt, int,
512 (char **optionp, char *const *tokens, char **valuep));
513 # else
514 # if !@HAVE_GETSUBOPT@
515 _GL_FUNCDECL_SYS (getsubopt, int,
516 (char **optionp, char *const *tokens, char **valuep)
517 _GL_ARG_NONNULL ((1, 2, 3)));
518 # endif
519 _GL_CXXALIAS_SYS (getsubopt, int,
520 (char **optionp, char *const *tokens, char **valuep));
521 # endif
522 # if __GLIBC__ >= 2
523 _GL_CXXALIASWARN (getsubopt);
524 # endif
525 #elif defined GNULIB_POSIXCHECK
526 # undef getsubopt
527 # if HAVE_RAW_DECL_GETSUBOPT
528 _GL_WARN_ON_USE (getsubopt, "getsubopt is unportable - "
529 "use gnulib module getsubopt for portability");
530 # endif
531 #endif
532
533 #if @GNULIB_GRANTPT@
534 /* Change the ownership and access permission of the slave side of the
535 pseudo-terminal whose master side is specified by FD. */
536 # if !@HAVE_GRANTPT@
537 _GL_FUNCDECL_SYS (grantpt, int, (int fd));
538 # endif
539 _GL_CXXALIAS_SYS (grantpt, int, (int fd));
540 _GL_CXXALIASWARN (grantpt);
541 #elif defined GNULIB_POSIXCHECK
542 # undef grantpt
543 # if HAVE_RAW_DECL_GRANTPT
544 _GL_WARN_ON_USE (grantpt, "grantpt is not portable - "
545 "use gnulib module grantpt for portability");
546 # endif
547 #endif
548
549 /* If _GL_USE_STDLIB_ALLOC is nonzero, the including module does not
550 rely on GNU or POSIX semantics for malloc and realloc (for example,
551 by never specifying a zero size), so it does not need malloc or
552 realloc to be redefined. */
553 #if @GNULIB_MALLOC_POSIX@
554 # if (@GNULIB_MALLOC_POSIX@ && @REPLACE_MALLOC_FOR_MALLOC_POSIX@) \
555 || (@GNULIB_MALLOC_GNU@ && @REPLACE_MALLOC_FOR_MALLOC_GNU@)
556 # if !((defined __cplusplus && defined GNULIB_NAMESPACE) \
557 || _GL_USE_STDLIB_ALLOC)
558 # undef malloc
559 # define malloc rpl_malloc
560 # endif
561 _GL_FUNCDECL_RPL (malloc, void *,
562 (size_t size)
563 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
564 _GL_CXXALIAS_RPL (malloc, void *, (size_t size));
565 # else
566 # if __GNUC__ >= 11
567 /* For -Wmismatched-dealloc: Associate malloc with free or rpl_free. */
568 _GL_FUNCDECL_SYS (malloc, void *,
569 (size_t size)
570 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
571 # endif
572 _GL_CXXALIAS_SYS (malloc, void *, (size_t size));
573 # endif
574 # if __GLIBC__ >= 2
575 _GL_CXXALIASWARN (malloc);
576 # endif
577 #else
578 # if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined malloc
579 /* For -Wmismatched-dealloc: Associate malloc with free or rpl_free. */
580 _GL_FUNCDECL_SYS (malloc, void *,
581 (size_t size)
582 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
583 # endif
584 # if defined GNULIB_POSIXCHECK && !_GL_USE_STDLIB_ALLOC
585 # undef malloc
586 /* Assume malloc is always declared. */
587 _GL_WARN_ON_USE (malloc, "malloc is not POSIX compliant everywhere - "
588 "use gnulib module malloc-posix for portability");
589 # endif
590 #endif
591
592 /* Convert a multibyte character to a wide character. */
593 #if @GNULIB_MBTOWC@
594 # if @REPLACE_MBTOWC@
595 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
596 # undef mbtowc
597 # define mbtowc rpl_mbtowc
598 # endif
599 _GL_FUNCDECL_RPL (mbtowc, int,
600 (wchar_t *restrict pwc, const char *restrict s, size_t n));
601 _GL_CXXALIAS_RPL (mbtowc, int,
602 (wchar_t *restrict pwc, const char *restrict s, size_t n));
603 # else
604 # if !@HAVE_MBTOWC@
605 _GL_FUNCDECL_SYS (mbtowc, int,
606 (wchar_t *restrict pwc, const char *restrict s, size_t n));
607 # endif
608 _GL_CXXALIAS_SYS (mbtowc, int,
609 (wchar_t *restrict pwc, const char *restrict s, size_t n));
610 # endif
611 # if __GLIBC__ >= 2
612 _GL_CXXALIASWARN (mbtowc);
613 # endif
614 #elif defined GNULIB_POSIXCHECK
615 # undef mbtowc
616 # if HAVE_RAW_DECL_MBTOWC
617 _GL_WARN_ON_USE (mbtowc, "mbtowc is not portable - "
618 "use gnulib module mbtowc for portability");
619 # endif
620 #endif
621
622 #if @GNULIB_MKDTEMP@
623 /* Create a unique temporary directory from TEMPLATE.
624 The last six characters of TEMPLATE must be "XXXXXX";
625 they are replaced with a string that makes the directory name unique.
626 Returns TEMPLATE, or a null pointer if it cannot get a unique name.
627 The directory is created mode 700. */
628 # if !@HAVE_MKDTEMP@
629 _GL_FUNCDECL_SYS (mkdtemp, char *, (char * /*template*/) _GL_ARG_NONNULL ((1)));
630 # endif
631 _GL_CXXALIAS_SYS (mkdtemp, char *, (char * /*template*/));
632 _GL_CXXALIASWARN (mkdtemp);
633 #elif defined GNULIB_POSIXCHECK
634 # undef mkdtemp
635 # if HAVE_RAW_DECL_MKDTEMP
636 _GL_WARN_ON_USE (mkdtemp, "mkdtemp is unportable - "
637 "use gnulib module mkdtemp for portability");
638 # endif
639 #endif
640
641 #if @GNULIB_MKOSTEMP@
642 /* Create a unique temporary file from TEMPLATE.
643 The last six characters of TEMPLATE must be "XXXXXX";
644 they are replaced with a string that makes the file name unique.
645 The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
646 and O_TEXT, O_BINARY (defined in "binary-io.h").
647 The file is then created, with the specified flags, ensuring it didn't exist
648 before.
649 The file is created read-write (mask at least 0600 & ~umask), but it may be
650 world-readable and world-writable (mask 0666 & ~umask), depending on the
651 implementation.
652 Returns the open file descriptor if successful, otherwise -1 and errno
653 set. */
654 # if @REPLACE_MKOSTEMP@
655 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
656 # undef mkostemp
657 # define mkostemp rpl_mkostemp
658 # endif
659 _GL_FUNCDECL_RPL (mkostemp, int, (char * /*template*/, int /*flags*/)
660 _GL_ARG_NONNULL ((1)));
661 _GL_CXXALIAS_RPL (mkostemp, int, (char * /*template*/, int /*flags*/));
662 # else
663 # if !@HAVE_MKOSTEMP@
664 _GL_FUNCDECL_SYS (mkostemp, int, (char * /*template*/, int /*flags*/)
665 _GL_ARG_NONNULL ((1)));
666 # endif
667 _GL_CXXALIAS_SYS (mkostemp, int, (char * /*template*/, int /*flags*/));
668 # endif
669 # if __GLIBC__ >= 2
670 _GL_CXXALIASWARN (mkostemp);
671 # endif
672 #elif defined GNULIB_POSIXCHECK
673 # undef mkostemp
674 # if HAVE_RAW_DECL_MKOSTEMP
675 _GL_WARN_ON_USE (mkostemp, "mkostemp is unportable - "
676 "use gnulib module mkostemp for portability");
677 # endif
678 #endif
679
680 #if @GNULIB_MKOSTEMPS@
681 /* Create a unique temporary file from TEMPLATE.
682 The last six characters of TEMPLATE before a suffix of length
683 SUFFIXLEN must be "XXXXXX";
684 they are replaced with a string that makes the file name unique.
685 The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
686 and O_TEXT, O_BINARY (defined in "binary-io.h").
687 The file is then created, with the specified flags, ensuring it didn't exist
688 before.
689 The file is created read-write (mask at least 0600 & ~umask), but it may be
690 world-readable and world-writable (mask 0666 & ~umask), depending on the
691 implementation.
692 Returns the open file descriptor if successful, otherwise -1 and errno
693 set. */
694 # if @REPLACE_MKOSTEMPS@
695 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
696 # undef mkostemps
697 # define mkostemps rpl_mkostemps
698 # endif
699 _GL_FUNCDECL_RPL (mkostemps, int,
700 (char * /*template*/, int /*suffixlen*/, int /*flags*/)
701 _GL_ARG_NONNULL ((1)));
702 _GL_CXXALIAS_RPL (mkostemps, int,
703 (char * /*template*/, int /*suffixlen*/, int /*flags*/));
704 # else
705 # if !@HAVE_MKOSTEMPS@
706 _GL_FUNCDECL_SYS (mkostemps, int,
707 (char * /*template*/, int /*suffixlen*/, int /*flags*/)
708 _GL_ARG_NONNULL ((1)));
709 # endif
710 _GL_CXXALIAS_SYS (mkostemps, int,
711 (char * /*template*/, int /*suffixlen*/, int /*flags*/));
712 # endif
713 # if __GLIBC__ >= 2
714 _GL_CXXALIASWARN (mkostemps);
715 # endif
716 #elif defined GNULIB_POSIXCHECK
717 # undef mkostemps
718 # if HAVE_RAW_DECL_MKOSTEMPS
719 _GL_WARN_ON_USE (mkostemps, "mkostemps is unportable - "
720 "use gnulib module mkostemps for portability");
721 # endif
722 #endif
723
724 #if @GNULIB_MKSTEMP@
725 /* Create a unique temporary file from TEMPLATE.
726 The last six characters of TEMPLATE must be "XXXXXX";
727 they are replaced with a string that makes the file name unique.
728 The file is then created, ensuring it didn't exist before.
729 The file is created read-write (mask at least 0600 & ~umask), but it may be
730 world-readable and world-writable (mask 0666 & ~umask), depending on the
731 implementation.
732 Returns the open file descriptor if successful, otherwise -1 and errno
733 set. */
734 # if @REPLACE_MKSTEMP@
735 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
736 # define mkstemp rpl_mkstemp
737 # endif
738 _GL_FUNCDECL_RPL (mkstemp, int, (char * /*template*/) _GL_ARG_NONNULL ((1)));
739 _GL_CXXALIAS_RPL (mkstemp, int, (char * /*template*/));
740 # else
741 # if ! @HAVE_MKSTEMP@
742 _GL_FUNCDECL_SYS (mkstemp, int, (char * /*template*/) _GL_ARG_NONNULL ((1)));
743 # endif
744 _GL_CXXALIAS_SYS (mkstemp, int, (char * /*template*/));
745 # endif
746 _GL_CXXALIASWARN (mkstemp);
747 #elif defined GNULIB_POSIXCHECK
748 # undef mkstemp
749 # if HAVE_RAW_DECL_MKSTEMP
750 _GL_WARN_ON_USE (mkstemp, "mkstemp is unportable - "
751 "use gnulib module mkstemp for portability");
752 # endif
753 #endif
754
755 #if @GNULIB_MKSTEMPS@
756 /* Create a unique temporary file from TEMPLATE.
757 The last six characters of TEMPLATE prior to a suffix of length
758 SUFFIXLEN must be "XXXXXX";
759 they are replaced with a string that makes the file name unique.
760 The file is then created, ensuring it didn't exist before.
761 The file is created read-write (mask at least 0600 & ~umask), but it may be
762 world-readable and world-writable (mask 0666 & ~umask), depending on the
763 implementation.
764 Returns the open file descriptor if successful, otherwise -1 and errno
765 set. */
766 # if !@HAVE_MKSTEMPS@
767 _GL_FUNCDECL_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/)
768 _GL_ARG_NONNULL ((1)));
769 # endif
770 _GL_CXXALIAS_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/));
771 _GL_CXXALIASWARN (mkstemps);
772 #elif defined GNULIB_POSIXCHECK
773 # undef mkstemps
774 # if HAVE_RAW_DECL_MKSTEMPS
775 _GL_WARN_ON_USE (mkstemps, "mkstemps is unportable - "
776 "use gnulib module mkstemps for portability");
777 # endif
778 #endif
779
780 #if @GNULIB_MDA_MKTEMP@
781 /* On native Windows, map 'mktemp' to '_mktemp', so that -loldnames is not
782 required. In C++ with GNULIB_NAMESPACE, avoid differences between
783 platforms by defining GNULIB_NAMESPACE::mktemp always. */
784 # if defined _WIN32 && !defined __CYGWIN__
785 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
786 # undef mktemp
787 # define mktemp _mktemp
788 # endif
789 _GL_CXXALIAS_MDA (mktemp, char *, (char * /*template*/));
790 # else
791 _GL_CXXALIAS_SYS (mktemp, char *, (char * /*template*/));
792 # endif
793 _GL_CXXALIASWARN (mktemp);
794 #endif
795
796 /* Allocate memory with indefinite extent and specified alignment. */
797 #if @GNULIB_POSIX_MEMALIGN@
798 # if @REPLACE_POSIX_MEMALIGN@
799 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
800 # undef posix_memalign
801 # define posix_memalign rpl_posix_memalign
802 # endif
803 _GL_FUNCDECL_RPL (posix_memalign, int,
804 (void **memptr, size_t alignment, size_t size)
805 _GL_ARG_NONNULL ((1)));
806 _GL_CXXALIAS_RPL (posix_memalign, int,
807 (void **memptr, size_t alignment, size_t size));
808 # else
809 # if @HAVE_POSIX_MEMALIGN@
810 _GL_CXXALIAS_SYS (posix_memalign, int,
811 (void **memptr, size_t alignment, size_t size));
812 # endif
813 # endif
814 # if __GLIBC__ >= 2 && @HAVE_POSIX_MEMALIGN@
815 _GL_CXXALIASWARN (posix_memalign);
816 # endif
817 #elif defined GNULIB_POSIXCHECK
818 # undef posix_memalign
819 # if HAVE_RAW_DECL_POSIX_MEMALIGN
820 _GL_WARN_ON_USE (posix_memalign, "posix_memalign is not portable - "
821 "use gnulib module posix_memalign for portability");
822 # endif
823 #endif
824
825 #if @GNULIB_POSIX_OPENPT@
826 /* Return an FD open to the master side of a pseudo-terminal. Flags should
827 include O_RDWR, and may also include O_NOCTTY. */
828 # if @REPLACE_POSIX_OPENPT@
829 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
830 # undef posix_openpt
831 # define posix_openpt rpl_posix_openpt
832 # endif
833 _GL_FUNCDECL_RPL (posix_openpt, int, (int flags));
834 _GL_CXXALIAS_RPL (posix_openpt, int, (int flags));
835 # else
836 # if !@HAVE_POSIX_OPENPT@
837 _GL_FUNCDECL_SYS (posix_openpt, int, (int flags));
838 # endif
839 _GL_CXXALIAS_SYS (posix_openpt, int, (int flags));
840 # endif
841 # if __GLIBC__ >= 2
842 _GL_CXXALIASWARN (posix_openpt);
843 # endif
844 #elif defined GNULIB_POSIXCHECK
845 # undef posix_openpt
846 # if HAVE_RAW_DECL_POSIX_OPENPT
847 _GL_WARN_ON_USE (posix_openpt, "posix_openpt is not portable - "
848 "use gnulib module posix_openpt for portability");
849 # endif
850 #endif
851
852 #if @GNULIB_PTSNAME@
853 /* Return the pathname of the pseudo-terminal slave associated with
854 the master FD is open on, or NULL on errors. */
855 # if @REPLACE_PTSNAME@
856 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
857 # undef ptsname
858 # define ptsname rpl_ptsname
859 # endif
860 _GL_FUNCDECL_RPL (ptsname, char *, (int fd));
861 _GL_CXXALIAS_RPL (ptsname, char *, (int fd));
862 # else
863 # if !@HAVE_PTSNAME@
864 _GL_FUNCDECL_SYS (ptsname, char *, (int fd));
865 # endif
866 _GL_CXXALIAS_SYS (ptsname, char *, (int fd));
867 # endif
868 _GL_CXXALIASWARN (ptsname);
869 #elif defined GNULIB_POSIXCHECK
870 # undef ptsname
871 # if HAVE_RAW_DECL_PTSNAME
872 _GL_WARN_ON_USE (ptsname, "ptsname is not portable - "
873 "use gnulib module ptsname for portability");
874 # endif
875 #endif
876
877 #if @GNULIB_PTSNAME_R@
878 /* Set the pathname of the pseudo-terminal slave associated with
879 the master FD is open on and return 0, or set errno and return
880 non-zero on errors. */
881 # if @REPLACE_PTSNAME_R@
882 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
883 # undef ptsname_r
884 # define ptsname_r rpl_ptsname_r
885 # endif
886 _GL_FUNCDECL_RPL (ptsname_r, int, (int fd, char *buf, size_t len));
887 _GL_CXXALIAS_RPL (ptsname_r, int, (int fd, char *buf, size_t len));
888 # else
889 # if !@HAVE_PTSNAME_R@
890 _GL_FUNCDECL_SYS (ptsname_r, int, (int fd, char *buf, size_t len));
891 # endif
892 _GL_CXXALIAS_SYS (ptsname_r, int, (int fd, char *buf, size_t len));
893 # endif
894 # ifndef GNULIB_defined_ptsname_r
895 # define GNULIB_defined_ptsname_r (!@HAVE_PTSNAME_R@ || @REPLACE_PTSNAME_R@)
896 # endif
897 _GL_CXXALIASWARN (ptsname_r);
898 #elif defined GNULIB_POSIXCHECK
899 # undef ptsname_r
900 # if HAVE_RAW_DECL_PTSNAME_R
901 _GL_WARN_ON_USE (ptsname_r, "ptsname_r is not portable - "
902 "use gnulib module ptsname_r for portability");
903 # endif
904 #endif
905
906 #if @GNULIB_PUTENV@
907 # if @REPLACE_PUTENV@
908 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
909 # undef putenv
910 # define putenv rpl_putenv
911 # endif
912 _GL_FUNCDECL_RPL (putenv, int, (char *string) _GL_ARG_NONNULL ((1)));
913 _GL_CXXALIAS_RPL (putenv, int, (char *string));
914 # elif defined _WIN32 && !defined __CYGWIN__
915 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
916 # undef putenv
917 # define putenv _putenv
918 # endif
919 _GL_CXXALIAS_MDA (putenv, int, (char *string));
920 # else
921 _GL_CXXALIAS_SYS (putenv, int, (char *string));
922 # endif
923 _GL_CXXALIASWARN (putenv);
924 #elif @GNULIB_MDA_PUTENV@
925 /* On native Windows, map 'putenv' to '_putenv', so that -loldnames is not
926 required. In C++ with GNULIB_NAMESPACE, avoid differences between
927 platforms by defining GNULIB_NAMESPACE::putenv always. */
928 # if defined _WIN32 && !defined __CYGWIN__
929 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
930 # undef putenv
931 # define putenv _putenv
932 # endif
933 /* Need to cast, because on mingw, the parameter is either
934 'const char *string' or 'char *string'. */
935 _GL_CXXALIAS_MDA_CAST (putenv, int, (char *string));
936 # else
937 _GL_CXXALIAS_SYS (putenv, int, (char *string));
938 # endif
939 _GL_CXXALIASWARN (putenv);
940 #endif
941
942 #if @GNULIB_QSORT_R@
943 /* Sort an array of NMEMB elements, starting at address BASE, each element
944 occupying SIZE bytes, in ascending order according to the comparison
945 function COMPARE. */
946 # ifdef __cplusplus
947 extern "C" {
948 # endif
949 # if !GNULIB_defined_qsort_r_fn_types
950 typedef int (*_gl_qsort_r_compar_fn) (void const *, void const *, void *);
951 # define GNULIB_defined_qsort_r_fn_types 1
952 # endif
953 # ifdef __cplusplus
954 }
955 # endif
956 # if @REPLACE_QSORT_R@
957 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
958 # undef qsort_r
959 # define qsort_r rpl_qsort_r
960 # endif
961 _GL_FUNCDECL_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size,
962 _gl_qsort_r_compar_fn compare,
963 void *arg) _GL_ARG_NONNULL ((1, 4)));
964 _GL_CXXALIAS_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size,
965 _gl_qsort_r_compar_fn compare,
966 void *arg));
967 # else
968 # if !@HAVE_QSORT_R@
969 _GL_FUNCDECL_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size,
970 _gl_qsort_r_compar_fn compare,
971 void *arg) _GL_ARG_NONNULL ((1, 4)));
972 # endif
973 _GL_CXXALIAS_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size,
974 _gl_qsort_r_compar_fn compare,
975 void *arg));
976 # endif
977 _GL_CXXALIASWARN (qsort_r);
978 #elif defined GNULIB_POSIXCHECK
979 # undef qsort_r
980 # if HAVE_RAW_DECL_QSORT_R
981 _GL_WARN_ON_USE (qsort_r, "qsort_r is not portable - "
982 "use gnulib module qsort_r for portability");
983 # endif
984 #endif
985
986
987 #if @GNULIB_RANDOM_R@
988 # if !@HAVE_RANDOM_R@
989 # ifndef RAND_MAX
990 # define RAND_MAX 2147483647
991 # endif
992 # endif
993 #endif
994
995
996 #if @GNULIB_RANDOM@
997 # if @REPLACE_RANDOM@
998 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
999 # undef random
1000 # define random rpl_random
1001 # endif
1002 _GL_FUNCDECL_RPL (random, long, (void));
1003 _GL_CXXALIAS_RPL (random, long, (void));
1004 # else
1005 # if !@HAVE_RANDOM@
1006 _GL_FUNCDECL_SYS (random, long, (void));
1007 # endif
1008 /* Need to cast, because on Haiku, the return type is
1009 int. */
1010 _GL_CXXALIAS_SYS_CAST (random, long, (void));
1011 # endif
1012 _GL_CXXALIASWARN (random);
1013 #elif defined GNULIB_POSIXCHECK
1014 # undef random
1015 # if HAVE_RAW_DECL_RANDOM
1016 _GL_WARN_ON_USE (random, "random is unportable - "
1017 "use gnulib module random for portability");
1018 # endif
1019 #endif
1020
1021 #if @GNULIB_RANDOM@
1022 # if @REPLACE_RANDOM@
1023 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1024 # undef srandom
1025 # define srandom rpl_srandom
1026 # endif
1027 _GL_FUNCDECL_RPL (srandom, void, (unsigned int seed));
1028 _GL_CXXALIAS_RPL (srandom, void, (unsigned int seed));
1029 # else
1030 # if !@HAVE_RANDOM@
1031 _GL_FUNCDECL_SYS (srandom, void, (unsigned int seed));
1032 # endif
1033 /* Need to cast, because on FreeBSD, the first parameter is
1034 unsigned long seed. */
1035 _GL_CXXALIAS_SYS_CAST (srandom, void, (unsigned int seed));
1036 # endif
1037 _GL_CXXALIASWARN (srandom);
1038 #elif defined GNULIB_POSIXCHECK
1039 # undef srandom
1040 # if HAVE_RAW_DECL_SRANDOM
1041 _GL_WARN_ON_USE (srandom, "srandom is unportable - "
1042 "use gnulib module random for portability");
1043 # endif
1044 #endif
1045
1046 #if @GNULIB_RANDOM@
1047 # if @REPLACE_INITSTATE@
1048 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1049 # undef initstate
1050 # define initstate rpl_initstate
1051 # endif
1052 _GL_FUNCDECL_RPL (initstate, char *,
1053 (unsigned int seed, char *buf, size_t buf_size)
1054 _GL_ARG_NONNULL ((2)));
1055 _GL_CXXALIAS_RPL (initstate, char *,
1056 (unsigned int seed, char *buf, size_t buf_size));
1057 # else
1058 # if !@HAVE_INITSTATE@ || !@HAVE_DECL_INITSTATE@
1059 _GL_FUNCDECL_SYS (initstate, char *,
1060 (unsigned int seed, char *buf, size_t buf_size)
1061 _GL_ARG_NONNULL ((2)));
1062 # endif
1063 /* Need to cast, because on FreeBSD, the first parameter is
1064 unsigned long seed. */
1065 _GL_CXXALIAS_SYS_CAST (initstate, char *,
1066 (unsigned int seed, char *buf, size_t buf_size));
1067 # endif
1068 # if __GLIBC__ >= 2
1069 _GL_CXXALIASWARN (initstate);
1070 # endif
1071 #elif defined GNULIB_POSIXCHECK
1072 # undef initstate
1073 # if HAVE_RAW_DECL_INITSTATE
1074 _GL_WARN_ON_USE (initstate, "initstate is unportable - "
1075 "use gnulib module random for portability");
1076 # endif
1077 #endif
1078
1079 #if @GNULIB_RANDOM@
1080 # if @REPLACE_SETSTATE@
1081 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1082 # undef setstate
1083 # define setstate rpl_setstate
1084 # endif
1085 _GL_FUNCDECL_RPL (setstate, char *, (char *arg_state) _GL_ARG_NONNULL ((1)));
1086 _GL_CXXALIAS_RPL (setstate, char *, (char *arg_state));
1087 # else
1088 # if !@HAVE_SETSTATE@ || !@HAVE_DECL_SETSTATE@
1089 _GL_FUNCDECL_SYS (setstate, char *, (char *arg_state) _GL_ARG_NONNULL ((1)));
1090 # endif
1091 /* Need to cast, because on Mac OS X 10.13, HP-UX, Solaris the first parameter
1092 is const char *arg_state. */
1093 _GL_CXXALIAS_SYS_CAST (setstate, char *, (char *arg_state));
1094 # endif
1095 # if __GLIBC__ >= 2
1096 _GL_CXXALIASWARN (setstate);
1097 # endif
1098 #elif defined GNULIB_POSIXCHECK
1099 # undef setstate
1100 # if HAVE_RAW_DECL_SETSTATE
1101 _GL_WARN_ON_USE (setstate, "setstate is unportable - "
1102 "use gnulib module random for portability");
1103 # endif
1104 #endif
1105
1106
1107 #if @GNULIB_RANDOM_R@
1108 # if @REPLACE_RANDOM_R@
1109 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1110 # undef random_r
1111 # define random_r rpl_random_r
1112 # endif
1113 _GL_FUNCDECL_RPL (random_r, int, (struct random_data *buf, int32_t *result)
1114 _GL_ARG_NONNULL ((1, 2)));
1115 _GL_CXXALIAS_RPL (random_r, int, (struct random_data *buf, int32_t *result));
1116 # else
1117 # if !@HAVE_RANDOM_R@
1118 _GL_FUNCDECL_SYS (random_r, int, (struct random_data *buf, int32_t *result)
1119 _GL_ARG_NONNULL ((1, 2)));
1120 # endif
1121 _GL_CXXALIAS_SYS (random_r, int, (struct random_data *buf, int32_t *result));
1122 # endif
1123 _GL_CXXALIASWARN (random_r);
1124 #elif defined GNULIB_POSIXCHECK
1125 # undef random_r
1126 # if HAVE_RAW_DECL_RANDOM_R
1127 _GL_WARN_ON_USE (random_r, "random_r is unportable - "
1128 "use gnulib module random_r for portability");
1129 # endif
1130 #endif
1131
1132 #if @GNULIB_RANDOM_R@
1133 # if @REPLACE_RANDOM_R@
1134 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1135 # undef srandom_r
1136 # define srandom_r rpl_srandom_r
1137 # endif
1138 _GL_FUNCDECL_RPL (srandom_r, int,
1139 (unsigned int seed, struct random_data *rand_state)
1140 _GL_ARG_NONNULL ((2)));
1141 _GL_CXXALIAS_RPL (srandom_r, int,
1142 (unsigned int seed, struct random_data *rand_state));
1143 # else
1144 # if !@HAVE_RANDOM_R@
1145 _GL_FUNCDECL_SYS (srandom_r, int,
1146 (unsigned int seed, struct random_data *rand_state)
1147 _GL_ARG_NONNULL ((2)));
1148 # endif
1149 _GL_CXXALIAS_SYS (srandom_r, int,
1150 (unsigned int seed, struct random_data *rand_state));
1151 # endif
1152 _GL_CXXALIASWARN (srandom_r);
1153 #elif defined GNULIB_POSIXCHECK
1154 # undef srandom_r
1155 # if HAVE_RAW_DECL_SRANDOM_R
1156 _GL_WARN_ON_USE (srandom_r, "srandom_r is unportable - "
1157 "use gnulib module random_r for portability");
1158 # endif
1159 #endif
1160
1161 #if @GNULIB_RANDOM_R@
1162 # if @REPLACE_RANDOM_R@
1163 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1164 # undef initstate_r
1165 # define initstate_r rpl_initstate_r
1166 # endif
1167 _GL_FUNCDECL_RPL (initstate_r, int,
1168 (unsigned int seed, char *buf, size_t buf_size,
1169 struct random_data *rand_state)
1170 _GL_ARG_NONNULL ((2, 4)));
1171 _GL_CXXALIAS_RPL (initstate_r, int,
1172 (unsigned int seed, char *buf, size_t buf_size,
1173 struct random_data *rand_state));
1174 # else
1175 # if !@HAVE_RANDOM_R@
1176 _GL_FUNCDECL_SYS (initstate_r, int,
1177 (unsigned int seed, char *buf, size_t buf_size,
1178 struct random_data *rand_state)
1179 _GL_ARG_NONNULL ((2, 4)));
1180 # endif
1181 /* Need to cast, because on Haiku, the third parameter is
1182 unsigned long buf_size. */
1183 _GL_CXXALIAS_SYS_CAST (initstate_r, int,
1184 (unsigned int seed, char *buf, size_t buf_size,
1185 struct random_data *rand_state));
1186 # endif
1187 _GL_CXXALIASWARN (initstate_r);
1188 #elif defined GNULIB_POSIXCHECK
1189 # undef initstate_r
1190 # if HAVE_RAW_DECL_INITSTATE_R
1191 _GL_WARN_ON_USE (initstate_r, "initstate_r is unportable - "
1192 "use gnulib module random_r for portability");
1193 # endif
1194 #endif
1195
1196 #if @GNULIB_RANDOM_R@
1197 # if @REPLACE_RANDOM_R@
1198 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1199 # undef setstate_r
1200 # define setstate_r rpl_setstate_r
1201 # endif
1202 _GL_FUNCDECL_RPL (setstate_r, int,
1203 (char *arg_state, struct random_data *rand_state)
1204 _GL_ARG_NONNULL ((1, 2)));
1205 _GL_CXXALIAS_RPL (setstate_r, int,
1206 (char *arg_state, struct random_data *rand_state));
1207 # else
1208 # if !@HAVE_RANDOM_R@
1209 _GL_FUNCDECL_SYS (setstate_r, int,
1210 (char *arg_state, struct random_data *rand_state)
1211 _GL_ARG_NONNULL ((1, 2)));
1212 # endif
1213 /* Need to cast, because on Haiku, the first parameter is
1214 void *arg_state. */
1215 _GL_CXXALIAS_SYS_CAST (setstate_r, int,
1216 (char *arg_state, struct random_data *rand_state));
1217 # endif
1218 _GL_CXXALIASWARN (setstate_r);
1219 #elif defined GNULIB_POSIXCHECK
1220 # undef setstate_r
1221 # if HAVE_RAW_DECL_SETSTATE_R
1222 _GL_WARN_ON_USE (setstate_r, "setstate_r is unportable - "
1223 "use gnulib module random_r for portability");
1224 # endif
1225 #endif
1226
1227
1228 #if @GNULIB_REALLOC_POSIX@
1229 # if (@GNULIB_REALLOC_POSIX@ && @REPLACE_REALLOC_FOR_REALLOC_POSIX@) \
1230 || (@GNULIB_REALLOC_GNU@ && @REPLACE_REALLOC_FOR_REALLOC_GNU@)
1231 # if !((defined __cplusplus && defined GNULIB_NAMESPACE) \
1232 || _GL_USE_STDLIB_ALLOC)
1233 # undef realloc
1234 # define realloc rpl_realloc
1235 # endif
1236 _GL_FUNCDECL_RPL (realloc, void *, (void *ptr, size_t size)
1237 _GL_ATTRIBUTE_DEALLOC_FREE);
1238 _GL_CXXALIAS_RPL (realloc, void *, (void *ptr, size_t size));
1239 # else
1240 # if __GNUC__ >= 11
1241 /* For -Wmismatched-dealloc: Associate realloc with free or rpl_free. */
1242 _GL_FUNCDECL_SYS (realloc, void *, (void *ptr, size_t size)
1243 _GL_ATTRIBUTE_DEALLOC_FREE);
1244 # endif
1245 _GL_CXXALIAS_SYS (realloc, void *, (void *ptr, size_t size));
1246 # endif
1247 # if __GLIBC__ >= 2
1248 _GL_CXXALIASWARN (realloc);
1249 # endif
1250 #else
1251 # if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined realloc
1252 /* For -Wmismatched-dealloc: Associate realloc with free or rpl_free. */
1253 _GL_FUNCDECL_SYS (realloc, void *, (void *ptr, size_t size)
1254 _GL_ATTRIBUTE_DEALLOC_FREE);
1255 # endif
1256 # if defined GNULIB_POSIXCHECK && !_GL_USE_STDLIB_ALLOC
1257 # undef realloc
1258 /* Assume realloc is always declared. */
1259 _GL_WARN_ON_USE (realloc, "realloc is not POSIX compliant everywhere - "
1260 "use gnulib module realloc-posix for portability");
1261 # endif
1262 #endif
1263
1264
1265 #if @GNULIB_REALLOCARRAY@
1266 # if @REPLACE_REALLOCARRAY@
1267 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1268 # undef reallocarray
1269 # define reallocarray rpl_reallocarray
1270 # endif
1271 _GL_FUNCDECL_RPL (reallocarray, void *,
1272 (void *ptr, size_t nmemb, size_t size));
1273 _GL_CXXALIAS_RPL (reallocarray, void *,
1274 (void *ptr, size_t nmemb, size_t size));
1275 # else
1276 # if ! @HAVE_REALLOCARRAY@
1277 _GL_FUNCDECL_SYS (reallocarray, void *,
1278 (void *ptr, size_t nmemb, size_t size));
1279 # endif
1280 _GL_CXXALIAS_SYS (reallocarray, void *,
1281 (void *ptr, size_t nmemb, size_t size));
1282 # endif
1283 # if __GLIBC__ >= 2
1284 _GL_CXXALIASWARN (reallocarray);
1285 # endif
1286 #elif defined GNULIB_POSIXCHECK
1287 # undef reallocarray
1288 # if HAVE_RAW_DECL_REALLOCARRAY
1289 _GL_WARN_ON_USE (reallocarray, "reallocarray is not portable - "
1290 "use gnulib module reallocarray for portability");
1291 # endif
1292 #endif
1293
1294 #if @GNULIB_REALPATH@
1295 # if @REPLACE_REALPATH@
1296 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1297 # define realpath rpl_realpath
1298 # endif
1299 _GL_FUNCDECL_RPL (realpath, char *,
1300 (const char *restrict name, char *restrict resolved)
1301 _GL_ARG_NONNULL ((1)));
1302 _GL_CXXALIAS_RPL (realpath, char *,
1303 (const char *restrict name, char *restrict resolved));
1304 # else
1305 # if !@HAVE_REALPATH@
1306 _GL_FUNCDECL_SYS (realpath, char *,
1307 (const char *restrict name, char *restrict resolved)
1308 _GL_ARG_NONNULL ((1)));
1309 # endif
1310 _GL_CXXALIAS_SYS (realpath, char *,
1311 (const char *restrict name, char *restrict resolved));
1312 # endif
1313 _GL_CXXALIASWARN (realpath);
1314 #elif defined GNULIB_POSIXCHECK
1315 # undef realpath
1316 # if HAVE_RAW_DECL_REALPATH
1317 _GL_WARN_ON_USE (realpath, "realpath is unportable - use gnulib module "
1318 "canonicalize or canonicalize-lgpl for portability");
1319 # endif
1320 #endif
1321
1322 #if @GNULIB_RPMATCH@
1323 /* Test a user response to a question.
1324 Return 1 if it is affirmative, 0 if it is negative, or -1 if not clear. */
1325 # if !@HAVE_RPMATCH@
1326 _GL_FUNCDECL_SYS (rpmatch, int, (const char *response) _GL_ARG_NONNULL ((1)));
1327 # endif
1328 _GL_CXXALIAS_SYS (rpmatch, int, (const char *response));
1329 _GL_CXXALIASWARN (rpmatch);
1330 #elif defined GNULIB_POSIXCHECK
1331 # undef rpmatch
1332 # if HAVE_RAW_DECL_RPMATCH
1333 _GL_WARN_ON_USE (rpmatch, "rpmatch is unportable - "
1334 "use gnulib module rpmatch for portability");
1335 # endif
1336 #endif
1337
1338 #if @GNULIB_SECURE_GETENV@
1339 /* Look up NAME in the environment, returning 0 in insecure situations. */
1340 # if !@HAVE_SECURE_GETENV@
1341 _GL_FUNCDECL_SYS (secure_getenv, char *,
1342 (char const *name) _GL_ARG_NONNULL ((1)));
1343 # endif
1344 _GL_CXXALIAS_SYS (secure_getenv, char *, (char const *name));
1345 _GL_CXXALIASWARN (secure_getenv);
1346 #elif defined GNULIB_POSIXCHECK
1347 # undef secure_getenv
1348 # if HAVE_RAW_DECL_SECURE_GETENV
1349 _GL_WARN_ON_USE (secure_getenv, "secure_getenv is unportable - "
1350 "use gnulib module secure_getenv for portability");
1351 # endif
1352 #endif
1353
1354 #if @GNULIB_SETENV@
1355 /* Set NAME to VALUE in the environment.
1356 If REPLACE is nonzero, overwrite an existing value. */
1357 # if @REPLACE_SETENV@
1358 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1359 # undef setenv
1360 # define setenv rpl_setenv
1361 # endif
1362 _GL_FUNCDECL_RPL (setenv, int,
1363 (const char *name, const char *value, int replace)
1364 _GL_ARG_NONNULL ((1)));
1365 _GL_CXXALIAS_RPL (setenv, int,
1366 (const char *name, const char *value, int replace));
1367 # else
1368 # if !@HAVE_DECL_SETENV@
1369 _GL_FUNCDECL_SYS (setenv, int,
1370 (const char *name, const char *value, int replace)
1371 _GL_ARG_NONNULL ((1)));
1372 # endif
1373 _GL_CXXALIAS_SYS (setenv, int,
1374 (const char *name, const char *value, int replace));
1375 # endif
1376 # if !(@REPLACE_SETENV@ && !@HAVE_DECL_SETENV@)
1377 _GL_CXXALIASWARN (setenv);
1378 # endif
1379 #elif defined GNULIB_POSIXCHECK
1380 # undef setenv
1381 # if HAVE_RAW_DECL_SETENV
1382 _GL_WARN_ON_USE (setenv, "setenv is unportable - "
1383 "use gnulib module setenv for portability");
1384 # endif
1385 #endif
1386
1387 #if @GNULIB_STRTOD@
1388 /* Parse a double from STRING, updating ENDP if appropriate. */
1389 # if @REPLACE_STRTOD@
1390 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1391 # define strtod rpl_strtod
1392 # endif
1393 # define GNULIB_defined_strtod_function 1
1394 _GL_FUNCDECL_RPL (strtod, double,
1395 (const char *restrict str, char **restrict endp)
1396 _GL_ARG_NONNULL ((1)));
1397 _GL_CXXALIAS_RPL (strtod, double,
1398 (const char *restrict str, char **restrict endp));
1399 # else
1400 # if !@HAVE_STRTOD@
1401 _GL_FUNCDECL_SYS (strtod, double,
1402 (const char *restrict str, char **restrict endp)
1403 _GL_ARG_NONNULL ((1)));
1404 # endif
1405 _GL_CXXALIAS_SYS (strtod, double,
1406 (const char *restrict str, char **restrict endp));
1407 # endif
1408 # if __GLIBC__ >= 2
1409 _GL_CXXALIASWARN (strtod);
1410 # endif
1411 #elif defined GNULIB_POSIXCHECK
1412 # undef strtod
1413 # if HAVE_RAW_DECL_STRTOD
1414 _GL_WARN_ON_USE (strtod, "strtod is unportable - "
1415 "use gnulib module strtod for portability");
1416 # endif
1417 #endif
1418
1419 #if @GNULIB_STRTOLD@
1420 /* Parse a 'long double' from STRING, updating ENDP if appropriate. */
1421 # if @REPLACE_STRTOLD@
1422 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1423 # define strtold rpl_strtold
1424 # endif
1425 # define GNULIB_defined_strtold_function 1
1426 _GL_FUNCDECL_RPL (strtold, long double,
1427 (const char *restrict str, char **restrict endp)
1428 _GL_ARG_NONNULL ((1)));
1429 _GL_CXXALIAS_RPL (strtold, long double,
1430 (const char *restrict str, char **restrict endp));
1431 # else
1432 # if !@HAVE_STRTOLD@
1433 _GL_FUNCDECL_SYS (strtold, long double,
1434 (const char *restrict str, char **restrict endp)
1435 _GL_ARG_NONNULL ((1)));
1436 # endif
1437 _GL_CXXALIAS_SYS (strtold, long double,
1438 (const char *restrict str, char **restrict endp));
1439 # endif
1440 _GL_CXXALIASWARN (strtold);
1441 #elif defined GNULIB_POSIXCHECK
1442 # undef strtold
1443 # if HAVE_RAW_DECL_STRTOLD
1444 _GL_WARN_ON_USE (strtold, "strtold is unportable - "
1445 "use gnulib module strtold for portability");
1446 # endif
1447 #endif
1448
1449 #if @GNULIB_STRTOL@
1450 /* Parse a signed integer whose textual representation starts at STRING.
1451 The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0,
1452 it may be decimal or octal (with prefix "0") or hexadecimal (with prefix
1453 "0x").
1454 If ENDPTR is not NULL, the address of the first byte after the integer is
1455 stored in *ENDPTR.
1456 Upon overflow, the return value is LONG_MAX or LONG_MIN, and errno is set
1457 to ERANGE. */
1458 # if @REPLACE_STRTOL@
1459 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1460 # define strtol rpl_strtol
1461 # endif
1462 # define GNULIB_defined_strtol_function 1
1463 _GL_FUNCDECL_RPL (strtol, long,
1464 (const char *restrict string, char **restrict endptr,
1465 int base)
1466 _GL_ARG_NONNULL ((1)));
1467 _GL_CXXALIAS_RPL (strtol, long,
1468 (const char *restrict string, char **restrict endptr,
1469 int base));
1470 # else
1471 # if !@HAVE_STRTOL@
1472 _GL_FUNCDECL_SYS (strtol, long,
1473 (const char *restrict string, char **restrict endptr,
1474 int base)
1475 _GL_ARG_NONNULL ((1)));
1476 # endif
1477 _GL_CXXALIAS_SYS (strtol, long,
1478 (const char *restrict string, char **restrict endptr,
1479 int base));
1480 # endif
1481 # if __GLIBC__ >= 2
1482 _GL_CXXALIASWARN (strtol);
1483 # endif
1484 #elif defined GNULIB_POSIXCHECK
1485 # undef strtol
1486 # if HAVE_RAW_DECL_STRTOL
1487 _GL_WARN_ON_USE (strtol, "strtol is unportable - "
1488 "use gnulib module strtol for portability");
1489 # endif
1490 #endif
1491
1492 #if @GNULIB_STRTOLL@
1493 /* Parse a signed integer whose textual representation starts at STRING.
1494 The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0,
1495 it may be decimal or octal (with prefix "0") or hexadecimal (with prefix
1496 "0x").
1497 If ENDPTR is not NULL, the address of the first byte after the integer is
1498 stored in *ENDPTR.
1499 Upon overflow, the return value is LLONG_MAX or LLONG_MIN, and errno is set
1500 to ERANGE. */
1501 # if @REPLACE_STRTOLL@
1502 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1503 # define strtoll rpl_strtoll
1504 # endif
1505 # define GNULIB_defined_strtoll_function 1
1506 _GL_FUNCDECL_RPL (strtoll, long long,
1507 (const char *restrict string, char **restrict endptr,
1508 int base)
1509 _GL_ARG_NONNULL ((1)));
1510 _GL_CXXALIAS_RPL (strtoll, long long,
1511 (const char *restrict string, char **restrict endptr,
1512 int base));
1513 # else
1514 # if !@HAVE_STRTOLL@
1515 _GL_FUNCDECL_SYS (strtoll, long long,
1516 (const char *restrict string, char **restrict endptr,
1517 int base)
1518 _GL_ARG_NONNULL ((1)));
1519 # endif
1520 _GL_CXXALIAS_SYS (strtoll, long long,
1521 (const char *restrict string, char **restrict endptr,
1522 int base));
1523 # endif
1524 _GL_CXXALIASWARN (strtoll);
1525 #elif defined GNULIB_POSIXCHECK
1526 # undef strtoll
1527 # if HAVE_RAW_DECL_STRTOLL
1528 _GL_WARN_ON_USE (strtoll, "strtoll is unportable - "
1529 "use gnulib module strtoll for portability");
1530 # endif
1531 #endif
1532
1533 #if @GNULIB_STRTOUL@
1534 /* Parse an unsigned integer whose textual representation starts at STRING.
1535 The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0,
1536 it may be decimal or octal (with prefix "0") or hexadecimal (with prefix
1537 "0x").
1538 If ENDPTR is not NULL, the address of the first byte after the integer is
1539 stored in *ENDPTR.
1540 Upon overflow, the return value is ULONG_MAX, and errno is set to ERANGE. */
1541 # if @REPLACE_STRTOUL@
1542 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1543 # define strtoul rpl_strtoul
1544 # endif
1545 # define GNULIB_defined_strtoul_function 1
1546 _GL_FUNCDECL_RPL (strtoul, unsigned long,
1547 (const char *restrict string, char **restrict endptr,
1548 int base)
1549 _GL_ARG_NONNULL ((1)));
1550 _GL_CXXALIAS_RPL (strtoul, unsigned long,
1551 (const char *restrict string, char **restrict endptr,
1552 int base));
1553 # else
1554 # if !@HAVE_STRTOUL@
1555 _GL_FUNCDECL_SYS (strtoul, unsigned long,
1556 (const char *restrict string, char **restrict endptr,
1557 int base)
1558 _GL_ARG_NONNULL ((1)));
1559 # endif
1560 _GL_CXXALIAS_SYS (strtoul, unsigned long,
1561 (const char *restrict string, char **restrict endptr,
1562 int base));
1563 # endif
1564 # if __GLIBC__ >= 2
1565 _GL_CXXALIASWARN (strtoul);
1566 # endif
1567 #elif defined GNULIB_POSIXCHECK
1568 # undef strtoul
1569 # if HAVE_RAW_DECL_STRTOUL
1570 _GL_WARN_ON_USE (strtoul, "strtoul is unportable - "
1571 "use gnulib module strtoul for portability");
1572 # endif
1573 #endif
1574
1575 #if @GNULIB_STRTOULL@
1576 /* Parse an unsigned integer whose textual representation starts at STRING.
1577 The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0,
1578 it may be decimal or octal (with prefix "0") or hexadecimal (with prefix
1579 "0x").
1580 If ENDPTR is not NULL, the address of the first byte after the integer is
1581 stored in *ENDPTR.
1582 Upon overflow, the return value is ULLONG_MAX, and errno is set to
1583 ERANGE. */
1584 # if @REPLACE_STRTOULL@
1585 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1586 # define strtoull rpl_strtoull
1587 # endif
1588 # define GNULIB_defined_strtoull_function 1
1589 _GL_FUNCDECL_RPL (strtoull, unsigned long long,
1590 (const char *restrict string, char **restrict endptr,
1591 int base)
1592 _GL_ARG_NONNULL ((1)));
1593 _GL_CXXALIAS_RPL (strtoull, unsigned long long,
1594 (const char *restrict string, char **restrict endptr,
1595 int base));
1596 # else
1597 # if !@HAVE_STRTOULL@
1598 _GL_FUNCDECL_SYS (strtoull, unsigned long long,
1599 (const char *restrict string, char **restrict endptr,
1600 int base)
1601 _GL_ARG_NONNULL ((1)));
1602 # endif
1603 _GL_CXXALIAS_SYS (strtoull, unsigned long long,
1604 (const char *restrict string, char **restrict endptr,
1605 int base));
1606 # endif
1607 _GL_CXXALIASWARN (strtoull);
1608 #elif defined GNULIB_POSIXCHECK
1609 # undef strtoull
1610 # if HAVE_RAW_DECL_STRTOULL
1611 _GL_WARN_ON_USE (strtoull, "strtoull is unportable - "
1612 "use gnulib module strtoull for portability");
1613 # endif
1614 #endif
1615
1616 #if @GNULIB_UNLOCKPT@
1617 /* Unlock the slave side of the pseudo-terminal whose master side is specified
1618 by FD, so that it can be opened. */
1619 # if !@HAVE_UNLOCKPT@
1620 _GL_FUNCDECL_SYS (unlockpt, int, (int fd));
1621 # endif
1622 _GL_CXXALIAS_SYS (unlockpt, int, (int fd));
1623 _GL_CXXALIASWARN (unlockpt);
1624 #elif defined GNULIB_POSIXCHECK
1625 # undef unlockpt
1626 # if HAVE_RAW_DECL_UNLOCKPT
1627 _GL_WARN_ON_USE (unlockpt, "unlockpt is not portable - "
1628 "use gnulib module unlockpt for portability");
1629 # endif
1630 #endif
1631
1632 #if @GNULIB_UNSETENV@
1633 /* Remove the variable NAME from the environment. */
1634 # if @REPLACE_UNSETENV@
1635 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1636 # undef unsetenv
1637 # define unsetenv rpl_unsetenv
1638 # endif
1639 _GL_FUNCDECL_RPL (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1)));
1640 _GL_CXXALIAS_RPL (unsetenv, int, (const char *name));
1641 # else
1642 # if !@HAVE_DECL_UNSETENV@
1643 _GL_FUNCDECL_SYS (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1)));
1644 # endif
1645 _GL_CXXALIAS_SYS (unsetenv, int, (const char *name));
1646 # endif
1647 # if !(@REPLACE_UNSETENV@ && !@HAVE_DECL_UNSETENV@)
1648 _GL_CXXALIASWARN (unsetenv);
1649 # endif
1650 #elif defined GNULIB_POSIXCHECK
1651 # undef unsetenv
1652 # if HAVE_RAW_DECL_UNSETENV
1653 _GL_WARN_ON_USE (unsetenv, "unsetenv is unportable - "
1654 "use gnulib module unsetenv for portability");
1655 # endif
1656 #endif
1657
1658 /* Convert a wide character to a multibyte character. */
1659 #if @GNULIB_WCTOMB@
1660 # if @REPLACE_WCTOMB@
1661 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1662 # undef wctomb
1663 # define wctomb rpl_wctomb
1664 # endif
1665 _GL_FUNCDECL_RPL (wctomb, int, (char *s, wchar_t wc));
1666 _GL_CXXALIAS_RPL (wctomb, int, (char *s, wchar_t wc));
1667 # else
1668 _GL_CXXALIAS_SYS (wctomb, int, (char *s, wchar_t wc));
1669 # endif
1670 # if __GLIBC__ >= 2
1671 _GL_CXXALIASWARN (wctomb);
1672 # endif
1673 #endif
1674
1675
1676 #endif /* _@GUARD_PREFIX@_STDLIB_H */
1677 #endif /* _@GUARD_PREFIX@_STDLIB_H */
1678 #endif