Import upstream version 1.26
[debian/tar] / gnu / stdlib.in.h
1 /* -*- buffer-read-only: t -*- vi: set ro: */
2 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
3 /* A GNU-like <stdlib.h>.
4
5    Copyright (C) 1995, 2001-2004, 2006-2011 Free Software Foundation, Inc.
6
7    This program is free software: you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 3 of the License, or
10    (at your option) any later version.
11
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16
17    You should have received a copy of the GNU General Public License
18    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
19
20 #if __GNUC__ >= 3
21 @PRAGMA_SYSTEM_HEADER@
22 #endif
23 @PRAGMA_COLUMNS@
24
25 #if defined __need_malloc_and_calloc
26 /* Special invocation convention inside glibc header files.  */
27
28 #@INCLUDE_NEXT@ @NEXT_STDLIB_H@
29
30 #else
31 /* Normal invocation convention.  */
32
33 #ifndef _GL_STDLIB_H
34
35 /* The include_next requires a split double-inclusion guard.  */
36 #@INCLUDE_NEXT@ @NEXT_STDLIB_H@
37
38 #ifndef _GL_STDLIB_H
39 #define _GL_STDLIB_H
40
41 /* NetBSD 5.0 mis-defines NULL.  */
42 #include <stddef.h>
43
44 /* MirBSD 10 defines WEXITSTATUS in <sys/wait.h>, not in <stdlib.h>.  */
45 #if @GNULIB_SYSTEM_POSIX@ && !defined WEXITSTATUS
46 # include <sys/wait.h>
47 #endif
48
49 /* Solaris declares getloadavg() in <sys/loadavg.h>.  */
50 #if (@GNULIB_GETLOADAVG@ || defined GNULIB_POSIXCHECK) && @HAVE_SYS_LOADAVG_H@
51 # include <sys/loadavg.h>
52 #endif
53
54 #if @GNULIB_RANDOM_R@
55
56 /* OSF/1 5.1 declares 'struct random_data' in <random.h>, which is included
57    from <stdlib.h> if _REENTRANT is defined.  Include it whenever we need
58    'struct random_data'.  */
59 # if @HAVE_RANDOM_H@
60 #  include <random.h>
61 # endif
62
63 # if !@HAVE_STRUCT_RANDOM_DATA@ || !@HAVE_RANDOM_R@
64 #  include <stdint.h>
65 # endif
66
67 # if !@HAVE_STRUCT_RANDOM_DATA@
68 /* Define 'struct random_data'.
69    But allow multiple gnulib generated <stdlib.h> replacements to coexist.  */
70 #  if !GNULIB_defined_struct_random_data
71 struct random_data
72 {
73   int32_t *fptr;                /* Front pointer.  */
74   int32_t *rptr;                /* Rear pointer.  */
75   int32_t *state;               /* Array of state values.  */
76   int rand_type;                /* Type of random number generator.  */
77   int rand_deg;                 /* Degree of random number generator.  */
78   int rand_sep;                 /* Distance between front and rear.  */
79   int32_t *end_ptr;             /* Pointer behind state table.  */
80 };
81 #   define GNULIB_defined_struct_random_data 1
82 #  endif
83 # endif
84 #endif
85
86 #if (@GNULIB_MKSTEMP@ || @GNULIB_GETSUBOPT@ || defined GNULIB_POSIXCHECK) && ! defined __GLIBC__ && !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
87 /* On MacOS X 10.3, only <unistd.h> declares mkstemp.  */
88 /* On Cygwin 1.7.1, only <unistd.h> declares getsubopt.  */
89 /* But avoid namespace pollution on glibc systems and native Windows.  */
90 # include <unistd.h>
91 #endif
92
93 #if 3 <= __GNUC__ || __GNUC__ == 2 && 8 <= __GNUC_MINOR__
94 # define _GL_ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
95 #else
96 # define _GL_ATTRIBUTE_NORETURN
97 #endif
98
99 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
100
101 /* The definition of _GL_ARG_NONNULL is copied here.  */
102
103 /* The definition of _GL_WARN_ON_USE is copied here.  */
104
105
106 /* Some systems do not define EXIT_*, despite otherwise supporting C89.  */
107 #ifndef EXIT_SUCCESS
108 # define EXIT_SUCCESS 0
109 #endif
110 /* Tandem/NSK and other platforms that define EXIT_FAILURE as -1 interfere
111    with proper operation of xargs.  */
112 #ifndef EXIT_FAILURE
113 # define EXIT_FAILURE 1
114 #elif EXIT_FAILURE != 1
115 # undef EXIT_FAILURE
116 # define EXIT_FAILURE 1
117 #endif
118
119
120 #if @GNULIB__EXIT@
121 /* Terminate the current process with the given return code, without running
122    the 'atexit' handlers.  */
123 # if !@HAVE__EXIT@
124 _GL_FUNCDECL_SYS (_Exit, void, (int status) _GL_ATTRIBUTE_NORETURN);
125 # endif
126 _GL_CXXALIAS_SYS (_Exit, void, (int status));
127 _GL_CXXALIASWARN (_Exit);
128 #elif defined GNULIB_POSIXCHECK
129 # undef _Exit
130 # if HAVE_RAW_DECL__EXIT
131 _GL_WARN_ON_USE (_Exit, "_Exit is unportable - "
132                  "use gnulib module _Exit for portability");
133 # endif
134 #endif
135
136
137 #if @GNULIB_ATOLL@
138 /* Parse a signed decimal integer.
139    Returns the value of the integer.  Errors are not detected.  */
140 # if !@HAVE_ATOLL@
141 _GL_FUNCDECL_SYS (atoll, long long, (const char *string) _GL_ARG_NONNULL ((1)));
142 # endif
143 _GL_CXXALIAS_SYS (atoll, long long, (const char *string));
144 _GL_CXXALIASWARN (atoll);
145 #elif defined GNULIB_POSIXCHECK
146 # undef atoll
147 # if HAVE_RAW_DECL_ATOLL
148 _GL_WARN_ON_USE (atoll, "atoll is unportable - "
149                  "use gnulib module atoll for portability");
150 # endif
151 #endif
152
153 #if @GNULIB_CALLOC_POSIX@
154 # if @REPLACE_CALLOC@
155 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
156 #   undef calloc
157 #   define calloc rpl_calloc
158 #  endif
159 _GL_FUNCDECL_RPL (calloc, void *, (size_t nmemb, size_t size));
160 _GL_CXXALIAS_RPL (calloc, void *, (size_t nmemb, size_t size));
161 # else
162 _GL_CXXALIAS_SYS (calloc, void *, (size_t nmemb, size_t size));
163 # endif
164 _GL_CXXALIASWARN (calloc);
165 #elif defined GNULIB_POSIXCHECK
166 # undef calloc
167 /* Assume calloc is always declared.  */
168 _GL_WARN_ON_USE (calloc, "calloc is not POSIX compliant everywhere - "
169                  "use gnulib module calloc-posix for portability");
170 #endif
171
172 #if @GNULIB_CANONICALIZE_FILE_NAME@
173 # if @REPLACE_CANONICALIZE_FILE_NAME@
174 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
175 #   define canonicalize_file_name rpl_canonicalize_file_name
176 #  endif
177 _GL_FUNCDECL_RPL (canonicalize_file_name, char *, (const char *name)
178                                                   _GL_ARG_NONNULL ((1)));
179 _GL_CXXALIAS_RPL (canonicalize_file_name, char *, (const char *name));
180 # else
181 #  if !@HAVE_CANONICALIZE_FILE_NAME@
182 _GL_FUNCDECL_SYS (canonicalize_file_name, char *, (const char *name)
183                                                   _GL_ARG_NONNULL ((1)));
184 #  endif
185 _GL_CXXALIAS_SYS (canonicalize_file_name, char *, (const char *name));
186 # endif
187 _GL_CXXALIASWARN (canonicalize_file_name);
188 #elif defined GNULIB_POSIXCHECK
189 # undef canonicalize_file_name
190 # if HAVE_RAW_DECL_CANONICALIZE_FILE_NAME
191 _GL_WARN_ON_USE (canonicalize_file_name,
192                  "canonicalize_file_name is unportable - "
193                  "use gnulib module canonicalize-lgpl for portability");
194 # endif
195 #endif
196
197 #if @GNULIB_GETLOADAVG@
198 /* Store max(NELEM,3) load average numbers in LOADAVG[].
199    The three numbers are the load average of the last 1 minute, the last 5
200    minutes, and the last 15 minutes, respectively.
201    LOADAVG is an array of NELEM numbers.  */
202 # if !@HAVE_DECL_GETLOADAVG@
203 _GL_FUNCDECL_SYS (getloadavg, int, (double loadavg[], int nelem)
204                                    _GL_ARG_NONNULL ((1)));
205 # endif
206 _GL_CXXALIAS_SYS (getloadavg, int, (double loadavg[], int nelem));
207 _GL_CXXALIASWARN (getloadavg);
208 #elif defined GNULIB_POSIXCHECK
209 # undef getloadavg
210 # if HAVE_RAW_DECL_GETLOADAVG
211 _GL_WARN_ON_USE (getloadavg, "getloadavg is not portable - "
212                  "use gnulib module getloadavg for portability");
213 # endif
214 #endif
215
216 #if @GNULIB_GETSUBOPT@
217 /* Assuming *OPTIONP is a comma separated list of elements of the form
218    "token" or "token=value", getsubopt parses the first of these elements.
219    If the first element refers to a "token" that is member of the given
220    NULL-terminated array of tokens:
221      - It replaces the comma with a NUL byte, updates *OPTIONP to point past
222        the first option and the comma, sets *VALUEP to the value of the
223        element (or NULL if it doesn't contain an "=" sign),
224      - It returns the index of the "token" in the given array of tokens.
225    Otherwise it returns -1, and *OPTIONP and *VALUEP are undefined.
226    For more details see the POSIX:2001 specification.
227    http://www.opengroup.org/susv3xsh/getsubopt.html */
228 # if !@HAVE_GETSUBOPT@
229 _GL_FUNCDECL_SYS (getsubopt, int,
230                   (char **optionp, char *const *tokens, char **valuep)
231                   _GL_ARG_NONNULL ((1, 2, 3)));
232 # endif
233 _GL_CXXALIAS_SYS (getsubopt, int,
234                   (char **optionp, char *const *tokens, char **valuep));
235 _GL_CXXALIASWARN (getsubopt);
236 #elif defined GNULIB_POSIXCHECK
237 # undef getsubopt
238 # if HAVE_RAW_DECL_GETSUBOPT
239 _GL_WARN_ON_USE (getsubopt, "getsubopt is unportable - "
240                  "use gnulib module getsubopt for portability");
241 # endif
242 #endif
243
244 #if @GNULIB_GRANTPT@
245 /* Change the ownership and access permission of the slave side of the
246    pseudo-terminal whose master side is specified by FD.  */
247 # if !@HAVE_GRANTPT@
248 _GL_FUNCDECL_SYS (grantpt, int, (int fd));
249 # endif
250 _GL_CXXALIAS_SYS (grantpt, int, (int fd));
251 _GL_CXXALIASWARN (grantpt);
252 #elif defined GNULIB_POSIXCHECK
253 # undef grantpt
254 # if HAVE_RAW_DECL_GRANTPT
255 _GL_WARN_ON_USE (ptsname, "grantpt is not portable - "
256                  "use gnulib module grantpt for portability");
257 # endif
258 #endif
259
260 #if @GNULIB_MALLOC_POSIX@
261 # if @REPLACE_MALLOC@
262 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
263 #   undef malloc
264 #   define malloc rpl_malloc
265 #  endif
266 _GL_FUNCDECL_RPL (malloc, void *, (size_t size));
267 _GL_CXXALIAS_RPL (malloc, void *, (size_t size));
268 # else
269 _GL_CXXALIAS_SYS (malloc, void *, (size_t size));
270 # endif
271 _GL_CXXALIASWARN (malloc);
272 #elif defined GNULIB_POSIXCHECK
273 # undef malloc
274 /* Assume malloc is always declared.  */
275 _GL_WARN_ON_USE (malloc, "malloc is not POSIX compliant everywhere - "
276                  "use gnulib module malloc-posix for portability");
277 #endif
278
279 /* Convert a multibyte character to a wide character.  */
280 #if @GNULIB_MBTOWC@
281 # if @REPLACE_MBTOWC@
282 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
283 #   undef mbtowc
284 #   define mbtowc rpl_mbtowc
285 #  endif
286 _GL_FUNCDECL_RPL (mbtowc, int, (wchar_t *pwc, const char *s, size_t n));
287 _GL_CXXALIAS_RPL (mbtowc, int, (wchar_t *pwc, const char *s, size_t n));
288 # else
289 _GL_CXXALIAS_SYS (mbtowc, int, (wchar_t *pwc, const char *s, size_t n));
290 # endif
291 _GL_CXXALIASWARN (mbtowc);
292 #endif
293
294 #if @GNULIB_MKDTEMP@
295 /* Create a unique temporary directory from TEMPLATE.
296    The last six characters of TEMPLATE must be "XXXXXX";
297    they are replaced with a string that makes the directory name unique.
298    Returns TEMPLATE, or a null pointer if it cannot get a unique name.
299    The directory is created mode 700.  */
300 # if !@HAVE_MKDTEMP@
301 _GL_FUNCDECL_SYS (mkdtemp, char *, (char * /*template*/) _GL_ARG_NONNULL ((1)));
302 # endif
303 _GL_CXXALIAS_SYS (mkdtemp, char *, (char * /*template*/));
304 _GL_CXXALIASWARN (mkdtemp);
305 #elif defined GNULIB_POSIXCHECK
306 # undef mkdtemp
307 # if HAVE_RAW_DECL_MKDTEMP
308 _GL_WARN_ON_USE (mkdtemp, "mkdtemp is unportable - "
309                  "use gnulib module mkdtemp for portability");
310 # endif
311 #endif
312
313 #if @GNULIB_MKOSTEMP@
314 /* Create a unique temporary file from TEMPLATE.
315    The last six characters of TEMPLATE must be "XXXXXX";
316    they are replaced with a string that makes the file name unique.
317    The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
318    and O_TEXT, O_BINARY (defined in "binary-io.h").
319    The file is then created, with the specified flags, ensuring it didn't exist
320    before.
321    The file is created read-write (mask at least 0600 & ~umask), but it may be
322    world-readable and world-writable (mask 0666 & ~umask), depending on the
323    implementation.
324    Returns the open file descriptor if successful, otherwise -1 and errno
325    set.  */
326 # if !@HAVE_MKOSTEMP@
327 _GL_FUNCDECL_SYS (mkostemp, int, (char * /*template*/, int /*flags*/)
328                                  _GL_ARG_NONNULL ((1)));
329 # endif
330 _GL_CXXALIAS_SYS (mkostemp, int, (char * /*template*/, int /*flags*/));
331 _GL_CXXALIASWARN (mkostemp);
332 #elif defined GNULIB_POSIXCHECK
333 # undef mkostemp
334 # if HAVE_RAW_DECL_MKOSTEMP
335 _GL_WARN_ON_USE (mkostemp, "mkostemp is unportable - "
336                  "use gnulib module mkostemp for portability");
337 # endif
338 #endif
339
340 #if @GNULIB_MKOSTEMPS@
341 /* Create a unique temporary file from TEMPLATE.
342    The last six characters of TEMPLATE before a suffix of length
343    SUFFIXLEN must be "XXXXXX";
344    they are replaced with a string that makes the file name unique.
345    The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
346    and O_TEXT, O_BINARY (defined in "binary-io.h").
347    The file is then created, with the specified flags, ensuring it didn't exist
348    before.
349    The file is created read-write (mask at least 0600 & ~umask), but it may be
350    world-readable and world-writable (mask 0666 & ~umask), depending on the
351    implementation.
352    Returns the open file descriptor if successful, otherwise -1 and errno
353    set.  */
354 # if !@HAVE_MKOSTEMPS@
355 _GL_FUNCDECL_SYS (mkostemps, int,
356                   (char * /*template*/, int /*suffixlen*/, int /*flags*/)
357                   _GL_ARG_NONNULL ((1)));
358 # endif
359 _GL_CXXALIAS_SYS (mkostemps, int,
360                   (char * /*template*/, int /*suffixlen*/, int /*flags*/));
361 _GL_CXXALIASWARN (mkostemps);
362 #elif defined GNULIB_POSIXCHECK
363 # undef mkostemps
364 # if HAVE_RAW_DECL_MKOSTEMPS
365 _GL_WARN_ON_USE (mkostemps, "mkostemps is unportable - "
366                  "use gnulib module mkostemps for portability");
367 # endif
368 #endif
369
370 #if @GNULIB_MKSTEMP@
371 /* Create a unique temporary file from TEMPLATE.
372    The last six characters of TEMPLATE must be "XXXXXX";
373    they are replaced with a string that makes the file name unique.
374    The file is then created, ensuring it didn't exist before.
375    The file is created read-write (mask at least 0600 & ~umask), but it may be
376    world-readable and world-writable (mask 0666 & ~umask), depending on the
377    implementation.
378    Returns the open file descriptor if successful, otherwise -1 and errno
379    set.  */
380 # if @REPLACE_MKSTEMP@
381 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
382 #   define mkstemp rpl_mkstemp
383 #  endif
384 _GL_FUNCDECL_RPL (mkstemp, int, (char * /*template*/) _GL_ARG_NONNULL ((1)));
385 _GL_CXXALIAS_RPL (mkstemp, int, (char * /*template*/));
386 # else
387 #  if ! @HAVE_MKSTEMP@
388 _GL_FUNCDECL_SYS (mkstemp, int, (char * /*template*/) _GL_ARG_NONNULL ((1)));
389 #  endif
390 _GL_CXXALIAS_SYS (mkstemp, int, (char * /*template*/));
391 # endif
392 _GL_CXXALIASWARN (mkstemp);
393 #elif defined GNULIB_POSIXCHECK
394 # undef mkstemp
395 # if HAVE_RAW_DECL_MKSTEMP
396 _GL_WARN_ON_USE (mkstemp, "mkstemp is unportable - "
397                  "use gnulib module mkstemp for portability");
398 # endif
399 #endif
400
401 #if @GNULIB_MKSTEMPS@
402 /* Create a unique temporary file from TEMPLATE.
403    The last six characters of TEMPLATE prior to a suffix of length
404    SUFFIXLEN must be "XXXXXX";
405    they are replaced with a string that makes the file name unique.
406    The file is then created, ensuring it didn't exist before.
407    The file is created read-write (mask at least 0600 & ~umask), but it may be
408    world-readable and world-writable (mask 0666 & ~umask), depending on the
409    implementation.
410    Returns the open file descriptor if successful, otherwise -1 and errno
411    set.  */
412 # if !@HAVE_MKSTEMPS@
413 _GL_FUNCDECL_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/)
414                                  _GL_ARG_NONNULL ((1)));
415 # endif
416 _GL_CXXALIAS_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/));
417 _GL_CXXALIASWARN (mkstemps);
418 #elif defined GNULIB_POSIXCHECK
419 # undef mkstemps
420 # if HAVE_RAW_DECL_MKSTEMPS
421 _GL_WARN_ON_USE (mkstemps, "mkstemps is unportable - "
422                  "use gnulib module mkstemps for portability");
423 # endif
424 #endif
425
426 #if @GNULIB_PTSNAME@
427 /* Return the pathname of the pseudo-terminal slave associated with
428    the master FD is open on, or NULL on errors.  */
429 # if !@HAVE_PTSNAME@
430 _GL_FUNCDECL_SYS (ptsname, char *, (int fd));
431 # endif
432 _GL_CXXALIAS_SYS (ptsname, char *, (int fd));
433 _GL_CXXALIASWARN (ptsname);
434 #elif defined GNULIB_POSIXCHECK
435 # undef ptsname
436 # if HAVE_RAW_DECL_PTSNAME
437 _GL_WARN_ON_USE (ptsname, "ptsname is not portable - "
438                  "use gnulib module ptsname for portability");
439 # endif
440 #endif
441
442 #if @GNULIB_PUTENV@
443 # if @REPLACE_PUTENV@
444 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
445 #   undef putenv
446 #   define putenv rpl_putenv
447 #  endif
448 _GL_FUNCDECL_RPL (putenv, int, (char *string) _GL_ARG_NONNULL ((1)));
449 _GL_CXXALIAS_RPL (putenv, int, (char *string));
450 # else
451 _GL_CXXALIAS_SYS (putenv, int, (char *string));
452 # endif
453 _GL_CXXALIASWARN (putenv);
454 #endif
455
456
457 #if @GNULIB_RANDOM_R@
458 # if !@HAVE_RANDOM_R@
459 #  ifndef RAND_MAX
460 #   define RAND_MAX 2147483647
461 #  endif
462 # endif
463 #endif
464
465 #if @GNULIB_RANDOM_R@
466 # if !@HAVE_RANDOM_R@
467 _GL_FUNCDECL_SYS (random_r, int, (struct random_data *buf, int32_t *result)
468                                  _GL_ARG_NONNULL ((1, 2)));
469 # endif
470 _GL_CXXALIAS_SYS (random_r, int, (struct random_data *buf, int32_t *result));
471 _GL_CXXALIASWARN (random_r);
472 #elif defined GNULIB_POSIXCHECK
473 # undef random_r
474 # if HAVE_RAW_DECL_RANDOM_R
475 _GL_WARN_ON_USE (random_r, "random_r is unportable - "
476                  "use gnulib module random_r for portability");
477 # endif
478 #endif
479
480 #if @GNULIB_RANDOM_R@
481 # if !@HAVE_RANDOM_R@
482 _GL_FUNCDECL_SYS (srandom_r, int,
483                   (unsigned int seed, struct random_data *rand_state)
484                   _GL_ARG_NONNULL ((2)));
485 # endif
486 _GL_CXXALIAS_SYS (srandom_r, int,
487                   (unsigned int seed, struct random_data *rand_state));
488 _GL_CXXALIASWARN (srandom_r);
489 #elif defined GNULIB_POSIXCHECK
490 # undef srandom_r
491 # if HAVE_RAW_DECL_SRANDOM_R
492 _GL_WARN_ON_USE (srandom_r, "srandom_r is unportable - "
493                  "use gnulib module random_r for portability");
494 # endif
495 #endif
496
497 #if @GNULIB_RANDOM_R@
498 # if !@HAVE_RANDOM_R@
499 _GL_FUNCDECL_SYS (initstate_r, int,
500                   (unsigned int seed, char *buf, size_t buf_size,
501                    struct random_data *rand_state)
502                   _GL_ARG_NONNULL ((2, 4)));
503 # endif
504 _GL_CXXALIAS_SYS (initstate_r, int,
505                   (unsigned int seed, char *buf, size_t buf_size,
506                    struct random_data *rand_state));
507 _GL_CXXALIASWARN (initstate_r);
508 #elif defined GNULIB_POSIXCHECK
509 # undef initstate_r
510 # if HAVE_RAW_DECL_INITSTATE_R
511 _GL_WARN_ON_USE (initstate_r, "initstate_r is unportable - "
512                  "use gnulib module random_r for portability");
513 # endif
514 #endif
515
516 #if @GNULIB_RANDOM_R@
517 # if !@HAVE_RANDOM_R@
518 _GL_FUNCDECL_SYS (setstate_r, int,
519                   (char *arg_state, struct random_data *rand_state)
520                   _GL_ARG_NONNULL ((1, 2)));
521 # endif
522 _GL_CXXALIAS_SYS (setstate_r, int,
523                   (char *arg_state, struct random_data *rand_state));
524 _GL_CXXALIASWARN (setstate_r);
525 #elif defined GNULIB_POSIXCHECK
526 # undef setstate_r
527 # if HAVE_RAW_DECL_SETSTATE_R
528 _GL_WARN_ON_USE (setstate_r, "setstate_r is unportable - "
529                  "use gnulib module random_r for portability");
530 # endif
531 #endif
532
533
534 #if @GNULIB_REALLOC_POSIX@
535 # if @REPLACE_REALLOC@
536 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
537 #   undef realloc
538 #   define realloc rpl_realloc
539 #  endif
540 _GL_FUNCDECL_RPL (realloc, void *, (void *ptr, size_t size));
541 _GL_CXXALIAS_RPL (realloc, void *, (void *ptr, size_t size));
542 # else
543 _GL_CXXALIAS_SYS (realloc, void *, (void *ptr, size_t size));
544 # endif
545 _GL_CXXALIASWARN (realloc);
546 #elif defined GNULIB_POSIXCHECK
547 # undef realloc
548 /* Assume realloc is always declared.  */
549 _GL_WARN_ON_USE (realloc, "realloc is not POSIX compliant everywhere - "
550                  "use gnulib module realloc-posix for portability");
551 #endif
552
553 #if @GNULIB_REALPATH@
554 # if @REPLACE_REALPATH@
555 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
556 #   define realpath rpl_realpath
557 #  endif
558 _GL_FUNCDECL_RPL (realpath, char *, (const char *name, char *resolved)
559                                     _GL_ARG_NONNULL ((1)));
560 _GL_CXXALIAS_RPL (realpath, char *, (const char *name, char *resolved));
561 # else
562 #  if !@HAVE_REALPATH@
563 _GL_FUNCDECL_SYS (realpath, char *, (const char *name, char *resolved)
564                                     _GL_ARG_NONNULL ((1)));
565 #  endif
566 _GL_CXXALIAS_SYS (realpath, char *, (const char *name, char *resolved));
567 # endif
568 _GL_CXXALIASWARN (realpath);
569 #elif defined GNULIB_POSIXCHECK
570 # undef realpath
571 # if HAVE_RAW_DECL_REALPATH
572 _GL_WARN_ON_USE (realpath, "realpath is unportable - use gnulib module "
573                  "canonicalize or canonicalize-lgpl for portability");
574 # endif
575 #endif
576
577 #if @GNULIB_RPMATCH@
578 /* Test a user response to a question.
579    Return 1 if it is affirmative, 0 if it is negative, or -1 if not clear.  */
580 # if !@HAVE_RPMATCH@
581 _GL_FUNCDECL_SYS (rpmatch, int, (const char *response) _GL_ARG_NONNULL ((1)));
582 # endif
583 _GL_CXXALIAS_SYS (rpmatch, int, (const char *response));
584 _GL_CXXALIASWARN (rpmatch);
585 #elif defined GNULIB_POSIXCHECK
586 # undef rpmatch
587 # if HAVE_RAW_DECL_RPMATCH
588 _GL_WARN_ON_USE (rpmatch, "rpmatch is unportable - "
589                  "use gnulib module rpmatch for portability");
590 # endif
591 #endif
592
593 #if @GNULIB_SETENV@
594 /* Set NAME to VALUE in the environment.
595    If REPLACE is nonzero, overwrite an existing value.  */
596 # if @REPLACE_SETENV@
597 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
598 #   undef setenv
599 #   define setenv rpl_setenv
600 #  endif
601 _GL_FUNCDECL_RPL (setenv, int,
602                   (const char *name, const char *value, int replace)
603                   _GL_ARG_NONNULL ((1)));
604 _GL_CXXALIAS_RPL (setenv, int,
605                   (const char *name, const char *value, int replace));
606 # else
607 #  if !@HAVE_DECL_SETENV@
608 _GL_FUNCDECL_SYS (setenv, int,
609                   (const char *name, const char *value, int replace)
610                   _GL_ARG_NONNULL ((1)));
611 #  endif
612 _GL_CXXALIAS_SYS (setenv, int,
613                   (const char *name, const char *value, int replace));
614 # endif
615 # if !(@REPLACE_SETENV@ && !@HAVE_DECL_SETENV@)
616 _GL_CXXALIASWARN (setenv);
617 # endif
618 #elif defined GNULIB_POSIXCHECK
619 # undef setenv
620 # if HAVE_RAW_DECL_SETENV
621 _GL_WARN_ON_USE (setenv, "setenv is unportable - "
622                  "use gnulib module setenv for portability");
623 # endif
624 #endif
625
626 #if @GNULIB_STRTOD@
627  /* Parse a double from STRING, updating ENDP if appropriate.  */
628 # if @REPLACE_STRTOD@
629 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
630 #   define strtod rpl_strtod
631 #  endif
632 _GL_FUNCDECL_RPL (strtod, double, (const char *str, char **endp)
633                                   _GL_ARG_NONNULL ((1)));
634 _GL_CXXALIAS_RPL (strtod, double, (const char *str, char **endp));
635 # else
636 #  if !@HAVE_STRTOD@
637 _GL_FUNCDECL_SYS (strtod, double, (const char *str, char **endp)
638                                   _GL_ARG_NONNULL ((1)));
639 #  endif
640 _GL_CXXALIAS_SYS (strtod, double, (const char *str, char **endp));
641 # endif
642 _GL_CXXALIASWARN (strtod);
643 #elif defined GNULIB_POSIXCHECK
644 # undef strtod
645 # if HAVE_RAW_DECL_STRTOD
646 _GL_WARN_ON_USE (strtod, "strtod is unportable - "
647                  "use gnulib module strtod for portability");
648 # endif
649 #endif
650
651 #if @GNULIB_STRTOLL@
652 /* Parse a signed integer whose textual representation starts at STRING.
653    The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0,
654    it may be decimal or octal (with prefix "0") or hexadecimal (with prefix
655    "0x").
656    If ENDPTR is not NULL, the address of the first byte after the integer is
657    stored in *ENDPTR.
658    Upon overflow, the return value is LLONG_MAX or LLONG_MIN, and errno is set
659    to ERANGE.  */
660 # if !@HAVE_STRTOLL@
661 _GL_FUNCDECL_SYS (strtoll, long long,
662                   (const char *string, char **endptr, int base)
663                   _GL_ARG_NONNULL ((1)));
664 # endif
665 _GL_CXXALIAS_SYS (strtoll, long long,
666                   (const char *string, char **endptr, int base));
667 _GL_CXXALIASWARN (strtoll);
668 #elif defined GNULIB_POSIXCHECK
669 # undef strtoll
670 # if HAVE_RAW_DECL_STRTOLL
671 _GL_WARN_ON_USE (strtoll, "strtoll is unportable - "
672                  "use gnulib module strtoll for portability");
673 # endif
674 #endif
675
676 #if @GNULIB_STRTOULL@
677 /* Parse an unsigned integer whose textual representation starts at STRING.
678    The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0,
679    it may be decimal or octal (with prefix "0") or hexadecimal (with prefix
680    "0x").
681    If ENDPTR is not NULL, the address of the first byte after the integer is
682    stored in *ENDPTR.
683    Upon overflow, the return value is ULLONG_MAX, and errno is set to
684    ERANGE.  */
685 # if !@HAVE_STRTOULL@
686 _GL_FUNCDECL_SYS (strtoull, unsigned long long,
687                   (const char *string, char **endptr, int base)
688                   _GL_ARG_NONNULL ((1)));
689 # endif
690 _GL_CXXALIAS_SYS (strtoull, unsigned long long,
691                   (const char *string, char **endptr, int base));
692 _GL_CXXALIASWARN (strtoull);
693 #elif defined GNULIB_POSIXCHECK
694 # undef strtoull
695 # if HAVE_RAW_DECL_STRTOULL
696 _GL_WARN_ON_USE (strtoull, "strtoull is unportable - "
697                  "use gnulib module strtoull for portability");
698 # endif
699 #endif
700
701 #if @GNULIB_UNLOCKPT@
702 /* Unlock the slave side of the pseudo-terminal whose master side is specified
703    by FD, so that it can be opened.  */
704 # if !@HAVE_UNLOCKPT@
705 _GL_FUNCDECL_SYS (unlockpt, int, (int fd));
706 # endif
707 _GL_CXXALIAS_SYS (unlockpt, int, (int fd));
708 _GL_CXXALIASWARN (unlockpt);
709 #elif defined GNULIB_POSIXCHECK
710 # undef unlockpt
711 # if HAVE_RAW_DECL_UNLOCKPT
712 _GL_WARN_ON_USE (unlockpt, "unlockpt is not portable - "
713                  "use gnulib module unlockpt for portability");
714 # endif
715 #endif
716
717 #if @GNULIB_UNSETENV@
718 /* Remove the variable NAME from the environment.  */
719 # if @REPLACE_UNSETENV@
720 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
721 #   undef unsetenv
722 #   define unsetenv rpl_unsetenv
723 #  endif
724 _GL_FUNCDECL_RPL (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1)));
725 _GL_CXXALIAS_RPL (unsetenv, int, (const char *name));
726 # else
727 #  if !@HAVE_DECL_UNSETENV@
728 _GL_FUNCDECL_SYS (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1)));
729 #  endif
730 _GL_CXXALIAS_SYS (unsetenv, int, (const char *name));
731 # endif
732 # if !(@REPLACE_UNSETENV@ && !@HAVE_DECL_UNSETENV@)
733 _GL_CXXALIASWARN (unsetenv);
734 # endif
735 #elif defined GNULIB_POSIXCHECK
736 # undef unsetenv
737 # if HAVE_RAW_DECL_UNSETENV
738 _GL_WARN_ON_USE (unsetenv, "unsetenv is unportable - "
739                  "use gnulib module unsetenv for portability");
740 # endif
741 #endif
742
743 /* Convert a wide character to a multibyte character.  */
744 #if @GNULIB_WCTOMB@
745 # if @REPLACE_WCTOMB@
746 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
747 #   undef wctomb
748 #   define wctomb rpl_wctomb
749 #  endif
750 _GL_FUNCDECL_RPL (wctomb, int, (char *s, wchar_t wc));
751 _GL_CXXALIAS_RPL (wctomb, int, (char *s, wchar_t wc));
752 # else
753 _GL_CXXALIAS_SYS (wctomb, int, (char *s, wchar_t wc));
754 # endif
755 _GL_CXXALIASWARN (wctomb);
756 #endif
757
758
759 #endif /* _GL_STDLIB_H */
760 #endif /* _GL_STDLIB_H */
761 #endif