1 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
2 /* A GNU-like <stdlib.h>.
3 
4    Copyright (C) 1995, 2001-2004, 2006-2015 Free Software Foundation, Inc.
5 
6    This program is free software: you can redistribute it and/or modify
7    it under the terms of the GNU General Public License as published by
8    the Free Software Foundation; either version 3 of the License, or
9    (at your option) any later version.
10 
11    This program is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15 
16    You should have received a copy of the GNU General Public License
17    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
18 
19 #if __GNUC__ >= 3
20 #pragma GCC system_header
21 #endif
22 
23 
24 #if defined __need_system_stdlib_h || defined __need_malloc_and_calloc
25 /* Special invocation conventions inside some gnulib header files,
26    and inside some glibc header files, respectively.  */
27 
28 #include_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 <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 0 && !defined WEXITSTATUS
46 # include <sys/wait.h>
47 #endif
48 
49 /* Solaris declares getloadavg() in <sys/loadavg.h>.  */
50 #if (0 || defined GNULIB_POSIXCHECK) && 0
51 # include <sys/loadavg.h>
52 #endif
53 
54 /* Native Windows platforms declare mktemp() in <io.h>.  */
55 #if 0 && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
56 # include <io.h>
57 #endif
58 
59 #if 0
60 
61 /* OSF/1 5.1 declares 'struct random_data' in <random.h>, which is included
62    from <stdlib.h> if _REENTRANT is defined.  Include it whenever we need
63    'struct random_data'.  */
64 # if 1
65 #  include <random.h>
66 # endif
67 
68 # if !1 || 0 || !1
69 #  include <stdint.h>
70 # endif
71 
72 # if !1
73 /* Define 'struct random_data'.
74    But allow multiple gnulib generated <stdlib.h> replacements to coexist.  */
75 #  if !GNULIB_defined_struct_random_data
76 struct random_data
77 {
78   int32_t *fptr;                /* Front pointer.  */
79   int32_t *rptr;                /* Rear pointer.  */
80   int32_t *state;               /* Array of state values.  */
81   int rand_type;                /* Type of random number generator.  */
82   int rand_deg;                 /* Degree of random number generator.  */
83   int rand_sep;                 /* Distance between front and rear.  */
84   int32_t *end_ptr;             /* Pointer behind state table.  */
85 };
86 #   define GNULIB_defined_struct_random_data 1
87 #  endif
88 # endif
89 #endif
90 
91 #if (0 || 0 || 0 || defined GNULIB_POSIXCHECK) && ! defined __GLIBC__ && !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
92 /* On Mac OS X 10.3, only <unistd.h> declares mkstemp.  */
93 /* On Mac OS X 10.5, only <unistd.h> declares mkstemps.  */
94 /* On Cygwin 1.7.1, only <unistd.h> declares getsubopt.  */
95 /* But avoid namespace pollution on glibc systems and native Windows.  */
96 # include <unistd.h>
97 #endif
98 
99 /* The __attribute__ feature is available in gcc versions 2.5 and later.
100    The attribute __pure__ was added in gcc 2.96.  */
101 #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
102 # define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
103 #else
104 # define _GL_ATTRIBUTE_PURE /* empty */
105 #endif
106 
107 /* The definition of _Noreturn is copied here.  */
108 #if !defined _Noreturn && __STDC_VERSION__ < 201112
109 # if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \
110       || 0x5110 <= __SUNPRO_C)
111 #  define _Noreturn __attribute__ ((__noreturn__))
112 # elif 1200 <= _MSC_VER
113 #  define _Noreturn __declspec (noreturn)
114 # else
115 #  define _Noreturn
116 # endif
117 #endif
118 
119 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
120 #ifndef _GL_CXXDEFS_H
121 #define _GL_CXXDEFS_H
122 
123 /* The three most frequent use cases of these macros are:
124 
125    * For providing a substitute for a function that is missing on some
126      platforms, but is declared and works fine on the platforms on which
127      it exists:
128 
129        #if @GNULIB_FOO@
130        # if !@HAVE_FOO@
131        _GL_FUNCDECL_SYS (foo, ...);
132        # endif
133        _GL_CXXALIAS_SYS (foo, ...);
134        _GL_CXXALIASWARN (foo);
135        #elif defined GNULIB_POSIXCHECK
136        ...
137        #endif
138 
139    * For providing a replacement for a function that exists on all platforms,
140      but is broken/insufficient and needs to be replaced on some platforms:
141 
142        #if @GNULIB_FOO@
143        # if @REPLACE_FOO@
144        #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
145        #   undef foo
146        #   define foo rpl_foo
147        #  endif
148        _GL_FUNCDECL_RPL (foo, ...);
149        _GL_CXXALIAS_RPL (foo, ...);
150        # else
151        _GL_CXXALIAS_SYS (foo, ...);
152        # endif
153        _GL_CXXALIASWARN (foo);
154        #elif defined GNULIB_POSIXCHECK
155        ...
156        #endif
157 
158    * For providing a replacement for a function that exists on some platforms
159      but is broken/insufficient and needs to be replaced on some of them and
160      is additionally either missing or undeclared on some other platforms:
161 
162        #if @GNULIB_FOO@
163        # if @REPLACE_FOO@
164        #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
165        #   undef foo
166        #   define foo rpl_foo
167        #  endif
168        _GL_FUNCDECL_RPL (foo, ...);
169        _GL_CXXALIAS_RPL (foo, ...);
170        # else
171        #  if !@HAVE_FOO@   or   if !@HAVE_DECL_FOO@
172        _GL_FUNCDECL_SYS (foo, ...);
173        #  endif
174        _GL_CXXALIAS_SYS (foo, ...);
175        # endif
176        _GL_CXXALIASWARN (foo);
177        #elif defined GNULIB_POSIXCHECK
178        ...
179        #endif
180 */
181 
182 /* _GL_EXTERN_C declaration;
183    performs the declaration with C linkage.  */
184 #if defined __cplusplus
185 # define _GL_EXTERN_C extern "C"
186 #else
187 # define _GL_EXTERN_C extern
188 #endif
189 
190 /* _GL_FUNCDECL_RPL (func, rettype, parameters_and_attributes);
191    declares a replacement function, named rpl_func, with the given prototype,
192    consisting of return type, parameters, and attributes.
193    Example:
194      _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...)
195                                   _GL_ARG_NONNULL ((1)));
196  */
197 #define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \
198   _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes)
199 #define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \
200   _GL_EXTERN_C rettype rpl_func parameters_and_attributes
201 
202 /* _GL_FUNCDECL_SYS (func, rettype, parameters_and_attributes);
203    declares the system function, named func, with the given prototype,
204    consisting of return type, parameters, and attributes.
205    Example:
206      _GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...)
207                                   _GL_ARG_NONNULL ((1)));
208  */
209 #define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \
210   _GL_EXTERN_C rettype func parameters_and_attributes
211 
212 /* _GL_CXXALIAS_RPL (func, rettype, parameters);
213    declares a C++ alias called GNULIB_NAMESPACE::func
214    that redirects to rpl_func, if GNULIB_NAMESPACE is defined.
215    Example:
216      _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...));
217  */
218 #define _GL_CXXALIAS_RPL(func,rettype,parameters) \
219   _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters)
220 #if defined __cplusplus && defined GNULIB_NAMESPACE
221 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
222     namespace GNULIB_NAMESPACE                                \
223     {                                                         \
224       rettype (*const func) parameters = ::rpl_func;          \
225     }                                                         \
226     _GL_EXTERN_C int _gl_cxxalias_dummy
227 #else
228 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
229     _GL_EXTERN_C int _gl_cxxalias_dummy
230 #endif
231 
232 /* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters);
233    is like  _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters);
234    except that the C function rpl_func may have a slightly different
235    declaration.  A cast is used to silence the "invalid conversion" error
236    that would otherwise occur.  */
237 #if defined __cplusplus && defined GNULIB_NAMESPACE
238 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
239     namespace GNULIB_NAMESPACE                                     \
240     {                                                              \
241       rettype (*const func) parameters =                           \
242         reinterpret_cast<rettype(*)parameters>(::rpl_func);        \
243     }                                                              \
244     _GL_EXTERN_C int _gl_cxxalias_dummy
245 #else
246 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
247     _GL_EXTERN_C int _gl_cxxalias_dummy
248 #endif
249 
250 /* _GL_CXXALIAS_SYS (func, rettype, parameters);
251    declares a C++ alias called GNULIB_NAMESPACE::func
252    that redirects to the system provided function func, if GNULIB_NAMESPACE
253    is defined.
254    Example:
255      _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...));
256  */
257 #if defined __cplusplus && defined GNULIB_NAMESPACE
258   /* If we were to write
259        rettype (*const func) parameters = ::func;
260      like above in _GL_CXXALIAS_RPL_1, the compiler could optimize calls
261      better (remove an indirection through a 'static' pointer variable),
262      but then the _GL_CXXALIASWARN macro below would cause a warning not only
263      for uses of ::func but also for uses of GNULIB_NAMESPACE::func.  */
264 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
265     namespace GNULIB_NAMESPACE                     \
266     {                                              \
267       static rettype (*func) parameters = ::func;  \
268     }                                              \
269     _GL_EXTERN_C int _gl_cxxalias_dummy
270 #else
271 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
272     _GL_EXTERN_C int _gl_cxxalias_dummy
273 #endif
274 
275 /* _GL_CXXALIAS_SYS_CAST (func, rettype, parameters);
276    is like  _GL_CXXALIAS_SYS (func, rettype, parameters);
277    except that the C function func may have a slightly different declaration.
278    A cast is used to silence the "invalid conversion" error that would
279    otherwise occur.  */
280 #if defined __cplusplus && defined GNULIB_NAMESPACE
281 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
282     namespace GNULIB_NAMESPACE                          \
283     {                                                   \
284       static rettype (*func) parameters =               \
285         reinterpret_cast<rettype(*)parameters>(::func); \
286     }                                                   \
287     _GL_EXTERN_C int _gl_cxxalias_dummy
288 #else
289 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
290     _GL_EXTERN_C int _gl_cxxalias_dummy
291 #endif
292 
293 /* _GL_CXXALIAS_SYS_CAST2 (func, rettype, parameters, rettype2, parameters2);
294    is like  _GL_CXXALIAS_SYS (func, rettype, parameters);
295    except that the C function is picked among a set of overloaded functions,
296    namely the one with rettype2 and parameters2.  Two consecutive casts
297    are used to silence the "cannot find a match" and "invalid conversion"
298    errors that would otherwise occur.  */
299 #if defined __cplusplus && defined GNULIB_NAMESPACE
300   /* The outer cast must be a reinterpret_cast.
301      The inner cast: When the function is defined as a set of overloaded
302      functions, it works as a static_cast<>, choosing the designated variant.
303      When the function is defined as a single variant, it works as a
304      reinterpret_cast<>. The parenthesized cast syntax works both ways.  */
305 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
306     namespace GNULIB_NAMESPACE                                                \
307     {                                                                         \
308       static rettype (*func) parameters =                                     \
309         reinterpret_cast<rettype(*)parameters>(                               \
310           (rettype2(*)parameters2)(::func));                                  \
311     }                                                                         \
312     _GL_EXTERN_C int _gl_cxxalias_dummy
313 #else
314 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
315     _GL_EXTERN_C int _gl_cxxalias_dummy
316 #endif
317 
318 /* _GL_CXXALIASWARN (func);
319    causes a warning to be emitted when ::func is used but not when
320    GNULIB_NAMESPACE::func is used.  func must be defined without overloaded
321    variants.  */
322 #if defined __cplusplus && defined GNULIB_NAMESPACE
323 # define _GL_CXXALIASWARN(func) \
324    _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE)
325 # define _GL_CXXALIASWARN_1(func,namespace) \
326    _GL_CXXALIASWARN_2 (func, namespace)
327 /* To work around GCC bug <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
328    we enable the warning only when not optimizing.  */
329 # if !__OPTIMIZE__
330 #  define _GL_CXXALIASWARN_2(func,namespace) \
331     _GL_WARN_ON_USE (func, \
332                      "The symbol ::" #func " refers to the system function. " \
333                      "Use " #namespace "::" #func " instead.")
334 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
335 #  define _GL_CXXALIASWARN_2(func,namespace) \
336      extern __typeof__ (func) func
337 # else
338 #  define _GL_CXXALIASWARN_2(func,namespace) \
339      _GL_EXTERN_C int _gl_cxxalias_dummy
340 # endif
341 #else
342 # define _GL_CXXALIASWARN(func) \
343     _GL_EXTERN_C int _gl_cxxalias_dummy
344 #endif
345 
346 /* _GL_CXXALIASWARN1 (func, rettype, parameters_and_attributes);
347    causes a warning to be emitted when the given overloaded variant of ::func
348    is used but not when GNULIB_NAMESPACE::func is used.  */
349 #if defined __cplusplus && defined GNULIB_NAMESPACE
350 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
351    _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \
352                         GNULIB_NAMESPACE)
353 # define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \
354    _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace)
355 /* To work around GCC bug <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
356    we enable the warning only when not optimizing.  */
357 # if !__OPTIMIZE__
358 #  define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
359     _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \
360                          "The symbol ::" #func " refers to the system function. " \
361                          "Use " #namespace "::" #func " instead.")
362 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
363 #  define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
364      extern __typeof__ (func) func
365 # else
366 #  define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
367      _GL_EXTERN_C int _gl_cxxalias_dummy
368 # endif
369 #else
370 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
371     _GL_EXTERN_C int _gl_cxxalias_dummy
372 #endif
373 
374 #endif /* _GL_CXXDEFS_H */
375 
376 /* The definition of _GL_ARG_NONNULL is copied here.  */
377 /* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools
378    that the values passed as arguments n, ..., m must be non-NULL pointers.
379    n = 1 stands for the first argument, n = 2 for the second argument etc.  */
380 #ifndef _GL_ARG_NONNULL
381 # if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3
382 #  define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params))
383 # else
384 #  define _GL_ARG_NONNULL(params)
385 # endif
386 #endif
387 
388 /* The definition of _GL_WARN_ON_USE is copied here.  */
389 #ifndef _GL_WARN_ON_USE
390 
391 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
392 /* A compiler attribute is available in gcc versions 4.3.0 and later.  */
393 #  define _GL_WARN_ON_USE(function, message) \
394 extern __typeof__ (function) function __attribute__ ((__warning__ (message)))
395 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
396 /* Verify the existence of the function.  */
397 #  define _GL_WARN_ON_USE(function, message) \
398 extern __typeof__ (function) function
399 # else /* Unsupported.  */
400 #  define _GL_WARN_ON_USE(function, message) \
401 _GL_WARN_EXTERN_C int _gl_warn_on_use
402 # endif
403 #endif
404 
405 /* _GL_WARN_ON_USE_CXX (function, rettype, parameters_and_attributes, "string")
406    is like _GL_WARN_ON_USE (function, "string"), except that the function is
407    declared with the given prototype, consisting of return type, parameters,
408    and attributes.
409    This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does
410    not work in this case.  */
411 #ifndef _GL_WARN_ON_USE_CXX
412 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
413 #  define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
414 extern rettype function parameters_and_attributes \
415      __attribute__ ((__warning__ (msg)))
416 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
417 /* Verify the existence of the function.  */
418 #  define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
419 extern rettype function parameters_and_attributes
420 # else /* Unsupported.  */
421 #  define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
422 _GL_WARN_EXTERN_C int _gl_warn_on_use
423 # endif
424 #endif
425 
426 /* _GL_WARN_EXTERN_C declaration;
427    performs the declaration with C linkage.  */
428 #ifndef _GL_WARN_EXTERN_C
429 # if defined __cplusplus
430 #  define _GL_WARN_EXTERN_C extern "C"
431 # else
432 #  define _GL_WARN_EXTERN_C extern
433 # endif
434 #endif
435 
436 
437 /* Some systems do not define EXIT_*, despite otherwise supporting C89.  */
438 #ifndef EXIT_SUCCESS
439 # define EXIT_SUCCESS 0
440 #endif
441 /* Tandem/NSK and other platforms that define EXIT_FAILURE as -1 interfere
442    with proper operation of xargs.  */
443 #ifndef EXIT_FAILURE
444 # define EXIT_FAILURE 1
445 #elif EXIT_FAILURE != 1
446 # undef EXIT_FAILURE
447 # define EXIT_FAILURE 1
448 #endif
449 
450 
451 #if 0
452 /* Terminate the current process with the given return code, without running
453    the 'atexit' handlers.  */
454 # if !1
455 _GL_FUNCDECL_SYS (_Exit, _Noreturn void, (int status));
456 # endif
457 _GL_CXXALIAS_SYS (_Exit, void, (int status));
458 _GL_CXXALIASWARN (_Exit);
459 #elif defined GNULIB_POSIXCHECK
460 # undef _Exit
461 # if HAVE_RAW_DECL__EXIT
462 _GL_WARN_ON_USE (_Exit, "_Exit is unportable - "
463                  "use gnulib module _Exit for portability");
464 # endif
465 #endif
466 
467 
468 #if 0
469 /* Parse a signed decimal integer.
470    Returns the value of the integer.  Errors are not detected.  */
471 # if !1
472 _GL_FUNCDECL_SYS (atoll, long long, (const char *string)
473                                     _GL_ATTRIBUTE_PURE
474                                     _GL_ARG_NONNULL ((1)));
475 # endif
476 _GL_CXXALIAS_SYS (atoll, long long, (const char *string));
477 _GL_CXXALIASWARN (atoll);
478 #elif defined GNULIB_POSIXCHECK
479 # undef atoll
480 # if HAVE_RAW_DECL_ATOLL
481 _GL_WARN_ON_USE (atoll, "atoll is unportable - "
482                  "use gnulib module atoll for portability");
483 # endif
484 #endif
485 
486 #if 0
487 # if 0
488 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
489 #   undef calloc
490 #   define calloc rpl_calloc
491 #  endif
492 _GL_FUNCDECL_RPL (calloc, void *, (size_t nmemb, size_t size));
493 _GL_CXXALIAS_RPL (calloc, void *, (size_t nmemb, size_t size));
494 # else
495 _GL_CXXALIAS_SYS (calloc, void *, (size_t nmemb, size_t size));
496 # endif
497 _GL_CXXALIASWARN (calloc);
498 #elif defined GNULIB_POSIXCHECK
499 # undef calloc
500 /* Assume calloc is always declared.  */
501 _GL_WARN_ON_USE (calloc, "calloc is not POSIX compliant everywhere - "
502                  "use gnulib module calloc-posix for portability");
503 #endif
504 
505 #if 0
506 # if 0
507 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
508 #   define canonicalize_file_name rpl_canonicalize_file_name
509 #  endif
510 _GL_FUNCDECL_RPL (canonicalize_file_name, char *, (const char *name)
511                                                   _GL_ARG_NONNULL ((1)));
512 _GL_CXXALIAS_RPL (canonicalize_file_name, char *, (const char *name));
513 # else
514 #  if !1
515 _GL_FUNCDECL_SYS (canonicalize_file_name, char *, (const char *name)
516                                                   _GL_ARG_NONNULL ((1)));
517 #  endif
518 _GL_CXXALIAS_SYS (canonicalize_file_name, char *, (const char *name));
519 # endif
520 _GL_CXXALIASWARN (canonicalize_file_name);
521 #elif defined GNULIB_POSIXCHECK
522 # undef canonicalize_file_name
523 # if HAVE_RAW_DECL_CANONICALIZE_FILE_NAME
524 _GL_WARN_ON_USE (canonicalize_file_name,
525                  "canonicalize_file_name is unportable - "
526                  "use gnulib module canonicalize-lgpl for portability");
527 # endif
528 #endif
529 
530 #if 0
531 /* Store max(NELEM,3) load average numbers in LOADAVG[].
532    The three numbers are the load average of the last 1 minute, the last 5
533    minutes, and the last 15 minutes, respectively.
534    LOADAVG is an array of NELEM numbers.  */
535 # if !1
536 _GL_FUNCDECL_SYS (getloadavg, int, (double loadavg[], int nelem)
537                                    _GL_ARG_NONNULL ((1)));
538 # endif
539 _GL_CXXALIAS_SYS (getloadavg, int, (double loadavg[], int nelem));
540 _GL_CXXALIASWARN (getloadavg);
541 #elif defined GNULIB_POSIXCHECK
542 # undef getloadavg
543 # if HAVE_RAW_DECL_GETLOADAVG
544 _GL_WARN_ON_USE (getloadavg, "getloadavg is not portable - "
545                  "use gnulib module getloadavg for portability");
546 # endif
547 #endif
548 
549 #if 0
550 /* Assuming *OPTIONP is a comma separated list of elements of the form
551    "token" or "token=value", getsubopt parses the first of these elements.
552    If the first element refers to a "token" that is member of the given
553    NULL-terminated array of tokens:
554      - It replaces the comma with a NUL byte, updates *OPTIONP to point past
555        the first option and the comma, sets *VALUEP to the value of the
556        element (or NULL if it doesn't contain an "=" sign),
557      - It returns the index of the "token" in the given array of tokens.
558    Otherwise it returns -1, and *OPTIONP and *VALUEP are undefined.
559    For more details see the POSIX:2001 specification.
560    http://www.opengroup.org/susv3xsh/getsubopt.html */
561 # if !1
562 _GL_FUNCDECL_SYS (getsubopt, int,
563                   (char **optionp, char *const *tokens, char **valuep)
564                   _GL_ARG_NONNULL ((1, 2, 3)));
565 # endif
566 _GL_CXXALIAS_SYS (getsubopt, int,
567                   (char **optionp, char *const *tokens, char **valuep));
568 _GL_CXXALIASWARN (getsubopt);
569 #elif defined GNULIB_POSIXCHECK
570 # undef getsubopt
571 # if HAVE_RAW_DECL_GETSUBOPT
572 _GL_WARN_ON_USE (getsubopt, "getsubopt is unportable - "
573                  "use gnulib module getsubopt for portability");
574 # endif
575 #endif
576 
577 #if 0
578 /* Change the ownership and access permission of the slave side of the
579    pseudo-terminal whose master side is specified by FD.  */
580 # if !1
581 _GL_FUNCDECL_SYS (grantpt, int, (int fd));
582 # endif
583 _GL_CXXALIAS_SYS (grantpt, int, (int fd));
584 _GL_CXXALIASWARN (grantpt);
585 #elif defined GNULIB_POSIXCHECK
586 # undef grantpt
587 # if HAVE_RAW_DECL_GRANTPT
588 _GL_WARN_ON_USE (grantpt, "grantpt is not portable - "
589                  "use gnulib module grantpt for portability");
590 # endif
591 #endif
592 
593 /* If _GL_USE_STDLIB_ALLOC is nonzero, the including module does not
594    rely on GNU or POSIX semantics for malloc and realloc (for example,
595    by never specifying a zero size), so it does not need malloc or
596    realloc to be redefined.  */
597 #if 1
598 # if 0
599 #  if !((defined __cplusplus && defined GNULIB_NAMESPACE) \
600         || _GL_USE_STDLIB_ALLOC)
601 #   undef malloc
602 #   define malloc rpl_malloc
603 #  endif
604 _GL_FUNCDECL_RPL (malloc, void *, (size_t size));
605 _GL_CXXALIAS_RPL (malloc, void *, (size_t size));
606 # else
607 _GL_CXXALIAS_SYS (malloc, void *, (size_t size));
608 # endif
609 _GL_CXXALIASWARN (malloc);
610 #elif defined GNULIB_POSIXCHECK && !_GL_USE_STDLIB_ALLOC
611 # undef malloc
612 /* Assume malloc is always declared.  */
613 _GL_WARN_ON_USE (malloc, "malloc is not POSIX compliant everywhere - "
614                  "use gnulib module malloc-posix for portability");
615 #endif
616 
617 /* Convert a multibyte character to a wide character.  */
618 #if 1
619 # if 0
620 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
621 #   undef mbtowc
622 #   define mbtowc rpl_mbtowc
623 #  endif
624 _GL_FUNCDECL_RPL (mbtowc, int, (wchar_t *pwc, const char *s, size_t n));
625 _GL_CXXALIAS_RPL (mbtowc, int, (wchar_t *pwc, const char *s, size_t n));
626 # else
627 _GL_CXXALIAS_SYS (mbtowc, int, (wchar_t *pwc, const char *s, size_t n));
628 # endif
629 _GL_CXXALIASWARN (mbtowc);
630 #endif
631 
632 #if 0
633 /* Create a unique temporary directory from TEMPLATE.
634    The last six characters of TEMPLATE must be "XXXXXX";
635    they are replaced with a string that makes the directory name unique.
636    Returns TEMPLATE, or a null pointer if it cannot get a unique name.
637    The directory is created mode 700.  */
638 # if !1
639 _GL_FUNCDECL_SYS (mkdtemp, char *, (char * /*template*/) _GL_ARG_NONNULL ((1)));
640 # endif
641 _GL_CXXALIAS_SYS (mkdtemp, char *, (char * /*template*/));
642 _GL_CXXALIASWARN (mkdtemp);
643 #elif defined GNULIB_POSIXCHECK
644 # undef mkdtemp
645 # if HAVE_RAW_DECL_MKDTEMP
646 _GL_WARN_ON_USE (mkdtemp, "mkdtemp is unportable - "
647                  "use gnulib module mkdtemp for portability");
648 # endif
649 #endif
650 
651 #if 0
652 /* Create a unique temporary file from TEMPLATE.
653    The last six characters of TEMPLATE must be "XXXXXX";
654    they are replaced with a string that makes the file name unique.
655    The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
656    and O_TEXT, O_BINARY (defined in "binary-io.h").
657    The file is then created, with the specified flags, ensuring it didn't exist
658    before.
659    The file is created read-write (mask at least 0600 & ~umask), but it may be
660    world-readable and world-writable (mask 0666 & ~umask), depending on the
661    implementation.
662    Returns the open file descriptor if successful, otherwise -1 and errno
663    set.  */
664 # if !1
665 _GL_FUNCDECL_SYS (mkostemp, int, (char * /*template*/, int /*flags*/)
666                                  _GL_ARG_NONNULL ((1)));
667 # endif
668 _GL_CXXALIAS_SYS (mkostemp, int, (char * /*template*/, int /*flags*/));
669 _GL_CXXALIASWARN (mkostemp);
670 #elif defined GNULIB_POSIXCHECK
671 # undef mkostemp
672 # if HAVE_RAW_DECL_MKOSTEMP
673 _GL_WARN_ON_USE (mkostemp, "mkostemp is unportable - "
674                  "use gnulib module mkostemp for portability");
675 # endif
676 #endif
677 
678 #if 0
679 /* Create a unique temporary file from TEMPLATE.
680    The last six characters of TEMPLATE before a suffix of length
681    SUFFIXLEN must be "XXXXXX";
682    they are replaced with a string that makes the file name unique.
683    The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
684    and O_TEXT, O_BINARY (defined in "binary-io.h").
685    The file is then created, with the specified flags, ensuring it didn't exist
686    before.
687    The file is created read-write (mask at least 0600 & ~umask), but it may be
688    world-readable and world-writable (mask 0666 & ~umask), depending on the
689    implementation.
690    Returns the open file descriptor if successful, otherwise -1 and errno
691    set.  */
692 # if !1
693 _GL_FUNCDECL_SYS (mkostemps, int,
694                   (char * /*template*/, int /*suffixlen*/, int /*flags*/)
695                   _GL_ARG_NONNULL ((1)));
696 # endif
697 _GL_CXXALIAS_SYS (mkostemps, int,
698                   (char * /*template*/, int /*suffixlen*/, int /*flags*/));
699 _GL_CXXALIASWARN (mkostemps);
700 #elif defined GNULIB_POSIXCHECK
701 # undef mkostemps
702 # if HAVE_RAW_DECL_MKOSTEMPS
703 _GL_WARN_ON_USE (mkostemps, "mkostemps is unportable - "
704                  "use gnulib module mkostemps for portability");
705 # endif
706 #endif
707 
708 #if 0
709 /* Create a unique temporary file from TEMPLATE.
710    The last six characters of TEMPLATE must be "XXXXXX";
711    they are replaced with a string that makes the file name unique.
712    The file is then created, ensuring it didn't exist before.
713    The file is created read-write (mask at least 0600 & ~umask), but it may be
714    world-readable and world-writable (mask 0666 & ~umask), depending on the
715    implementation.
716    Returns the open file descriptor if successful, otherwise -1 and errno
717    set.  */
718 # if 0
719 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
720 #   define mkstemp rpl_mkstemp
721 #  endif
722 _GL_FUNCDECL_RPL (mkstemp, int, (char * /*template*/) _GL_ARG_NONNULL ((1)));
723 _GL_CXXALIAS_RPL (mkstemp, int, (char * /*template*/));
724 # else
725 #  if ! 1
726 _GL_FUNCDECL_SYS (mkstemp, int, (char * /*template*/) _GL_ARG_NONNULL ((1)));
727 #  endif
728 _GL_CXXALIAS_SYS (mkstemp, int, (char * /*template*/));
729 # endif
730 _GL_CXXALIASWARN (mkstemp);
731 #elif defined GNULIB_POSIXCHECK
732 # undef mkstemp
733 # if HAVE_RAW_DECL_MKSTEMP
734 _GL_WARN_ON_USE (mkstemp, "mkstemp is unportable - "
735                  "use gnulib module mkstemp for portability");
736 # endif
737 #endif
738 
739 #if 0
740 /* Create a unique temporary file from TEMPLATE.
741    The last six characters of TEMPLATE prior to a suffix of length
742    SUFFIXLEN must be "XXXXXX";
743    they are replaced with a string that makes the file name unique.
744    The file is then created, ensuring it didn't exist before.
745    The file is created read-write (mask at least 0600 & ~umask), but it may be
746    world-readable and world-writable (mask 0666 & ~umask), depending on the
747    implementation.
748    Returns the open file descriptor if successful, otherwise -1 and errno
749    set.  */
750 # if !1
751 _GL_FUNCDECL_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/)
752                                  _GL_ARG_NONNULL ((1)));
753 # endif
754 _GL_CXXALIAS_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/));
755 _GL_CXXALIASWARN (mkstemps);
756 #elif defined GNULIB_POSIXCHECK
757 # undef mkstemps
758 # if HAVE_RAW_DECL_MKSTEMPS
759 _GL_WARN_ON_USE (mkstemps, "mkstemps is unportable - "
760                  "use gnulib module mkstemps for portability");
761 # endif
762 #endif
763 
764 #if 0
765 /* Return an FD open to the master side of a pseudo-terminal.  Flags should
766    include O_RDWR, and may also include O_NOCTTY.  */
767 # if !1
768 _GL_FUNCDECL_SYS (posix_openpt, int, (int flags));
769 # endif
770 _GL_CXXALIAS_SYS (posix_openpt, int, (int flags));
771 _GL_CXXALIASWARN (posix_openpt);
772 #elif defined GNULIB_POSIXCHECK
773 # undef posix_openpt
774 # if HAVE_RAW_DECL_POSIX_OPENPT
775 _GL_WARN_ON_USE (posix_openpt, "posix_openpt is not portable - "
776                  "use gnulib module posix_openpt for portability");
777 # endif
778 #endif
779 
780 #if 0
781 /* Return the pathname of the pseudo-terminal slave associated with
782    the master FD is open on, or NULL on errors.  */
783 # if 0
784 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
785 #   undef ptsname
786 #   define ptsname rpl_ptsname
787 #  endif
788 _GL_FUNCDECL_RPL (ptsname, char *, (int fd));
789 _GL_CXXALIAS_RPL (ptsname, char *, (int fd));
790 # else
791 #  if !1
792 _GL_FUNCDECL_SYS (ptsname, char *, (int fd));
793 #  endif
794 _GL_CXXALIAS_SYS (ptsname, char *, (int fd));
795 # endif
796 _GL_CXXALIASWARN (ptsname);
797 #elif defined GNULIB_POSIXCHECK
798 # undef ptsname
799 # if HAVE_RAW_DECL_PTSNAME
800 _GL_WARN_ON_USE (ptsname, "ptsname is not portable - "
801                  "use gnulib module ptsname for portability");
802 # endif
803 #endif
804 
805 #if 0
806 /* Set the pathname of the pseudo-terminal slave associated with
807    the master FD is open on and return 0, or set errno and return
808    non-zero on errors.  */
809 # if 0
810 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
811 #   undef ptsname_r
812 #   define ptsname_r rpl_ptsname_r
813 #  endif
814 _GL_FUNCDECL_RPL (ptsname_r, int, (int fd, char *buf, size_t len));
815 _GL_CXXALIAS_RPL (ptsname_r, int, (int fd, char *buf, size_t len));
816 # else
817 #  if !1
818 _GL_FUNCDECL_SYS (ptsname_r, int, (int fd, char *buf, size_t len));
819 #  endif
820 _GL_CXXALIAS_SYS (ptsname_r, int, (int fd, char *buf, size_t len));
821 # endif
822 _GL_CXXALIASWARN (ptsname_r);
823 #elif defined GNULIB_POSIXCHECK
824 # undef ptsname_r
825 # if HAVE_RAW_DECL_PTSNAME_R
826 _GL_WARN_ON_USE (ptsname_r, "ptsname_r is not portable - "
827                  "use gnulib module ptsname_r for portability");
828 # endif
829 #endif
830 
831 #if IN_GREP_GNULIB_TESTS
832 # if 1
833 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
834 #   undef putenv
835 #   define putenv rpl_putenv
836 #  endif
837 _GL_FUNCDECL_RPL (putenv, int, (char *string) _GL_ARG_NONNULL ((1)));
838 _GL_CXXALIAS_RPL (putenv, int, (char *string));
839 # else
840 _GL_CXXALIAS_SYS (putenv, int, (char *string));
841 # endif
842 _GL_CXXALIASWARN (putenv);
843 #endif
844 
845 #if 0
846 # if 0
847 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
848 #   undef qsort_r
849 #   define qsort_r rpl_qsort_r
850 #  endif
851 _GL_FUNCDECL_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size,
852                                   int (*compare) (void const *, void const *,
853                                                   void *),
854                                   void *arg) _GL_ARG_NONNULL ((1, 4)));
855 _GL_CXXALIAS_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size,
856                                   int (*compare) (void const *, void const *,
857                                                   void *),
858                                   void *arg));
859 # else
860 _GL_CXXALIAS_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size,
861                                   int (*compare) (void const *, void const *,
862                                                   void *),
863                                   void *arg));
864 # endif
865 _GL_CXXALIASWARN (qsort_r);
866 #endif
867 
868 
869 #if 0
870 # if !1
871 #  ifndef RAND_MAX
872 #   define RAND_MAX 2147483647
873 #  endif
874 # endif
875 #endif
876 
877 
878 #if 0
879 # if !1
880 _GL_FUNCDECL_SYS (random, long, (void));
881 # endif
882 _GL_CXXALIAS_SYS (random, long, (void));
883 _GL_CXXALIASWARN (random);
884 #elif defined GNULIB_POSIXCHECK
885 # undef random
886 # if HAVE_RAW_DECL_RANDOM
887 _GL_WARN_ON_USE (random, "random is unportable - "
888                  "use gnulib module random for portability");
889 # endif
890 #endif
891 
892 #if 0
893 # if !1
894 _GL_FUNCDECL_SYS (srandom, void, (unsigned int seed));
895 # endif
896 _GL_CXXALIAS_SYS (srandom, void, (unsigned int seed));
897 _GL_CXXALIASWARN (srandom);
898 #elif defined GNULIB_POSIXCHECK
899 # undef srandom
900 # if HAVE_RAW_DECL_SRANDOM
901 _GL_WARN_ON_USE (srandom, "srandom is unportable - "
902                  "use gnulib module random for portability");
903 # endif
904 #endif
905 
906 #if 0
907 # if !1
908 _GL_FUNCDECL_SYS (initstate, char *,
909                   (unsigned int seed, char *buf, size_t buf_size)
910                   _GL_ARG_NONNULL ((2)));
911 # endif
912 _GL_CXXALIAS_SYS (initstate, char *,
913                   (unsigned int seed, char *buf, size_t buf_size));
914 _GL_CXXALIASWARN (initstate);
915 #elif defined GNULIB_POSIXCHECK
916 # undef initstate
917 # if HAVE_RAW_DECL_INITSTATE_R
918 _GL_WARN_ON_USE (initstate, "initstate is unportable - "
919                  "use gnulib module random for portability");
920 # endif
921 #endif
922 
923 #if 0
924 # if !1
925 _GL_FUNCDECL_SYS (setstate, char *, (char *arg_state) _GL_ARG_NONNULL ((1)));
926 # endif
927 _GL_CXXALIAS_SYS (setstate, char *, (char *arg_state));
928 _GL_CXXALIASWARN (setstate);
929 #elif defined GNULIB_POSIXCHECK
930 # undef setstate
931 # if HAVE_RAW_DECL_SETSTATE_R
932 _GL_WARN_ON_USE (setstate, "setstate is unportable - "
933                  "use gnulib module random for portability");
934 # endif
935 #endif
936 
937 
938 #if 0
939 # if 0
940 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
941 #   undef random_r
942 #   define random_r rpl_random_r
943 #  endif
944 _GL_FUNCDECL_RPL (random_r, int, (struct random_data *buf, int32_t *result)
945                                  _GL_ARG_NONNULL ((1, 2)));
946 _GL_CXXALIAS_RPL (random_r, int, (struct random_data *buf, int32_t *result));
947 # else
948 #  if !1
949 _GL_FUNCDECL_SYS (random_r, int, (struct random_data *buf, int32_t *result)
950                                  _GL_ARG_NONNULL ((1, 2)));
951 #  endif
952 _GL_CXXALIAS_SYS (random_r, int, (struct random_data *buf, int32_t *result));
953 # endif
954 _GL_CXXALIASWARN (random_r);
955 #elif defined GNULIB_POSIXCHECK
956 # undef random_r
957 # if HAVE_RAW_DECL_RANDOM_R
958 _GL_WARN_ON_USE (random_r, "random_r is unportable - "
959                  "use gnulib module random_r for portability");
960 # endif
961 #endif
962 
963 #if 0
964 # if 0
965 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
966 #   undef srandom_r
967 #   define srandom_r rpl_srandom_r
968 #  endif
969 _GL_FUNCDECL_RPL (srandom_r, int,
970                   (unsigned int seed, struct random_data *rand_state)
971                   _GL_ARG_NONNULL ((2)));
972 _GL_CXXALIAS_RPL (srandom_r, int,
973                   (unsigned int seed, struct random_data *rand_state));
974 # else
975 #  if !1
976 _GL_FUNCDECL_SYS (srandom_r, int,
977                   (unsigned int seed, struct random_data *rand_state)
978                   _GL_ARG_NONNULL ((2)));
979 #  endif
980 _GL_CXXALIAS_SYS (srandom_r, int,
981                   (unsigned int seed, struct random_data *rand_state));
982 # endif
983 _GL_CXXALIASWARN (srandom_r);
984 #elif defined GNULIB_POSIXCHECK
985 # undef srandom_r
986 # if HAVE_RAW_DECL_SRANDOM_R
987 _GL_WARN_ON_USE (srandom_r, "srandom_r is unportable - "
988                  "use gnulib module random_r for portability");
989 # endif
990 #endif
991 
992 #if 0
993 # if 0
994 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
995 #   undef initstate_r
996 #   define initstate_r rpl_initstate_r
997 #  endif
998 _GL_FUNCDECL_RPL (initstate_r, int,
999                   (unsigned int seed, char *buf, size_t buf_size,
1000                    struct random_data *rand_state)
1001                   _GL_ARG_NONNULL ((2, 4)));
1002 _GL_CXXALIAS_RPL (initstate_r, int,
1003                   (unsigned int seed, char *buf, size_t buf_size,
1004                    struct random_data *rand_state));
1005 # else
1006 #  if !1
1007 _GL_FUNCDECL_SYS (initstate_r, int,
1008                   (unsigned int seed, char *buf, size_t buf_size,
1009                    struct random_data *rand_state)
1010                   _GL_ARG_NONNULL ((2, 4)));
1011 #  endif
1012 _GL_CXXALIAS_SYS (initstate_r, int,
1013                   (unsigned int seed, char *buf, size_t buf_size,
1014                    struct random_data *rand_state));
1015 # endif
1016 _GL_CXXALIASWARN (initstate_r);
1017 #elif defined GNULIB_POSIXCHECK
1018 # undef initstate_r
1019 # if HAVE_RAW_DECL_INITSTATE_R
1020 _GL_WARN_ON_USE (initstate_r, "initstate_r is unportable - "
1021                  "use gnulib module random_r for portability");
1022 # endif
1023 #endif
1024 
1025 #if 0
1026 # if 0
1027 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1028 #   undef setstate_r
1029 #   define setstate_r rpl_setstate_r
1030 #  endif
1031 _GL_FUNCDECL_RPL (setstate_r, int,
1032                   (char *arg_state, struct random_data *rand_state)
1033                   _GL_ARG_NONNULL ((1, 2)));
1034 _GL_CXXALIAS_RPL (setstate_r, int,
1035                   (char *arg_state, struct random_data *rand_state));
1036 # else
1037 #  if !1
1038 _GL_FUNCDECL_SYS (setstate_r, int,
1039                   (char *arg_state, struct random_data *rand_state)
1040                   _GL_ARG_NONNULL ((1, 2)));
1041 #  endif
1042 _GL_CXXALIAS_SYS (setstate_r, int,
1043                   (char *arg_state, struct random_data *rand_state));
1044 # endif
1045 _GL_CXXALIASWARN (setstate_r);
1046 #elif defined GNULIB_POSIXCHECK
1047 # undef setstate_r
1048 # if HAVE_RAW_DECL_SETSTATE_R
1049 _GL_WARN_ON_USE (setstate_r, "setstate_r is unportable - "
1050                  "use gnulib module random_r for portability");
1051 # endif
1052 #endif
1053 
1054 
1055 #if 1
1056 # if 0
1057 #  if !((defined __cplusplus && defined GNULIB_NAMESPACE) \
1058         || _GL_USE_STDLIB_ALLOC)
1059 #   undef realloc
1060 #   define realloc rpl_realloc
1061 #  endif
1062 _GL_FUNCDECL_RPL (realloc, void *, (void *ptr, size_t size));
1063 _GL_CXXALIAS_RPL (realloc, void *, (void *ptr, size_t size));
1064 # else
1065 _GL_CXXALIAS_SYS (realloc, void *, (void *ptr, size_t size));
1066 # endif
1067 _GL_CXXALIASWARN (realloc);
1068 #elif defined GNULIB_POSIXCHECK && !_GL_USE_STDLIB_ALLOC
1069 # undef realloc
1070 /* Assume realloc is always declared.  */
1071 _GL_WARN_ON_USE (realloc, "realloc is not POSIX compliant everywhere - "
1072                  "use gnulib module realloc-posix for portability");
1073 #endif
1074 
1075 #if 0
1076 # if 0
1077 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1078 #   define realpath rpl_realpath
1079 #  endif
1080 _GL_FUNCDECL_RPL (realpath, char *, (const char *name, char *resolved)
1081                                     _GL_ARG_NONNULL ((1)));
1082 _GL_CXXALIAS_RPL (realpath, char *, (const char *name, char *resolved));
1083 # else
1084 #  if !1
1085 _GL_FUNCDECL_SYS (realpath, char *, (const char *name, char *resolved)
1086                                     _GL_ARG_NONNULL ((1)));
1087 #  endif
1088 _GL_CXXALIAS_SYS (realpath, char *, (const char *name, char *resolved));
1089 # endif
1090 _GL_CXXALIASWARN (realpath);
1091 #elif defined GNULIB_POSIXCHECK
1092 # undef realpath
1093 # if HAVE_RAW_DECL_REALPATH
1094 _GL_WARN_ON_USE (realpath, "realpath is unportable - use gnulib module "
1095                  "canonicalize or canonicalize-lgpl for portability");
1096 # endif
1097 #endif
1098 
1099 #if 0
1100 /* Test a user response to a question.
1101    Return 1 if it is affirmative, 0 if it is negative, or -1 if not clear.  */
1102 # if !1
1103 _GL_FUNCDECL_SYS (rpmatch, int, (const char *response) _GL_ARG_NONNULL ((1)));
1104 # endif
1105 _GL_CXXALIAS_SYS (rpmatch, int, (const char *response));
1106 _GL_CXXALIASWARN (rpmatch);
1107 #elif defined GNULIB_POSIXCHECK
1108 # undef rpmatch
1109 # if HAVE_RAW_DECL_RPMATCH
1110 _GL_WARN_ON_USE (rpmatch, "rpmatch is unportable - "
1111                  "use gnulib module rpmatch for portability");
1112 # endif
1113 #endif
1114 
1115 #if 0
1116 /* Look up NAME in the environment, returning 0 in insecure situations.  */
1117 # if !1
1118 _GL_FUNCDECL_SYS (secure_getenv, char *,
1119                   (char const *name) _GL_ARG_NONNULL ((1)));
1120 # endif
1121 _GL_CXXALIAS_SYS (secure_getenv, char *, (char const *name));
1122 _GL_CXXALIASWARN (secure_getenv);
1123 #elif defined GNULIB_POSIXCHECK
1124 # undef secure_getenv
1125 # if HAVE_RAW_DECL_SECURE_GETENV
1126 _GL_WARN_ON_USE (secure_getenv, "secure_getenv is unportable - "
1127                  "use gnulib module secure_getenv for portability");
1128 # endif
1129 #endif
1130 
1131 #if IN_GREP_GNULIB_TESTS
1132 /* Set NAME to VALUE in the environment.
1133    If REPLACE is nonzero, overwrite an existing value.  */
1134 # if 0
1135 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1136 #   undef setenv
1137 #   define setenv rpl_setenv
1138 #  endif
1139 _GL_FUNCDECL_RPL (setenv, int,
1140                   (const char *name, const char *value, int replace)
1141                   _GL_ARG_NONNULL ((1)));
1142 _GL_CXXALIAS_RPL (setenv, int,
1143                   (const char *name, const char *value, int replace));
1144 # else
1145 #  if !1
1146 _GL_FUNCDECL_SYS (setenv, int,
1147                   (const char *name, const char *value, int replace)
1148                   _GL_ARG_NONNULL ((1)));
1149 #  endif
1150 _GL_CXXALIAS_SYS (setenv, int,
1151                   (const char *name, const char *value, int replace));
1152 # endif
1153 # if !(0 && !1)
1154 _GL_CXXALIASWARN (setenv);
1155 # endif
1156 #elif defined GNULIB_POSIXCHECK
1157 # undef setenv
1158 # if HAVE_RAW_DECL_SETENV
1159 _GL_WARN_ON_USE (setenv, "setenv is unportable - "
1160                  "use gnulib module setenv for portability");
1161 # endif
1162 #endif
1163 
1164 #if 0
1165  /* Parse a double from STRING, updating ENDP if appropriate.  */
1166 # if 0
1167 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1168 #   define strtod rpl_strtod
1169 #  endif
1170 _GL_FUNCDECL_RPL (strtod, double, (const char *str, char **endp)
1171                                   _GL_ARG_NONNULL ((1)));
1172 _GL_CXXALIAS_RPL (strtod, double, (const char *str, char **endp));
1173 # else
1174 #  if !1
1175 _GL_FUNCDECL_SYS (strtod, double, (const char *str, char **endp)
1176                                   _GL_ARG_NONNULL ((1)));
1177 #  endif
1178 _GL_CXXALIAS_SYS (strtod, double, (const char *str, char **endp));
1179 # endif
1180 _GL_CXXALIASWARN (strtod);
1181 #elif defined GNULIB_POSIXCHECK
1182 # undef strtod
1183 # if HAVE_RAW_DECL_STRTOD
1184 _GL_WARN_ON_USE (strtod, "strtod is unportable - "
1185                  "use gnulib module strtod for portability");
1186 # endif
1187 #endif
1188 
1189 #if 1
1190 /* Parse a signed integer whose textual representation starts at STRING.
1191    The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0,
1192    it may be decimal or octal (with prefix "0") or hexadecimal (with prefix
1193    "0x").
1194    If ENDPTR is not NULL, the address of the first byte after the integer is
1195    stored in *ENDPTR.
1196    Upon overflow, the return value is LLONG_MAX or LLONG_MIN, and errno is set
1197    to ERANGE.  */
1198 # if !1
1199 _GL_FUNCDECL_SYS (strtoll, long long,
1200                   (const char *string, char **endptr, int base)
1201                   _GL_ARG_NONNULL ((1)));
1202 # endif
1203 _GL_CXXALIAS_SYS (strtoll, long long,
1204                   (const char *string, char **endptr, int base));
1205 _GL_CXXALIASWARN (strtoll);
1206 #elif defined GNULIB_POSIXCHECK
1207 # undef strtoll
1208 # if HAVE_RAW_DECL_STRTOLL
1209 _GL_WARN_ON_USE (strtoll, "strtoll is unportable - "
1210                  "use gnulib module strtoll for portability");
1211 # endif
1212 #endif
1213 
1214 #if 1
1215 /* Parse an unsigned integer whose textual representation starts at STRING.
1216    The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0,
1217    it may be decimal or octal (with prefix "0") or hexadecimal (with prefix
1218    "0x").
1219    If ENDPTR is not NULL, the address of the first byte after the integer is
1220    stored in *ENDPTR.
1221    Upon overflow, the return value is ULLONG_MAX, and errno is set to
1222    ERANGE.  */
1223 # if !1
1224 _GL_FUNCDECL_SYS (strtoull, unsigned long long,
1225                   (const char *string, char **endptr, int base)
1226                   _GL_ARG_NONNULL ((1)));
1227 # endif
1228 _GL_CXXALIAS_SYS (strtoull, unsigned long long,
1229                   (const char *string, char **endptr, int base));
1230 _GL_CXXALIASWARN (strtoull);
1231 #elif defined GNULIB_POSIXCHECK
1232 # undef strtoull
1233 # if HAVE_RAW_DECL_STRTOULL
1234 _GL_WARN_ON_USE (strtoull, "strtoull is unportable - "
1235                  "use gnulib module strtoull for portability");
1236 # endif
1237 #endif
1238 
1239 #if 0
1240 /* Unlock the slave side of the pseudo-terminal whose master side is specified
1241    by FD, so that it can be opened.  */
1242 # if !1
1243 _GL_FUNCDECL_SYS (unlockpt, int, (int fd));
1244 # endif
1245 _GL_CXXALIAS_SYS (unlockpt, int, (int fd));
1246 _GL_CXXALIASWARN (unlockpt);
1247 #elif defined GNULIB_POSIXCHECK
1248 # undef unlockpt
1249 # if HAVE_RAW_DECL_UNLOCKPT
1250 _GL_WARN_ON_USE (unlockpt, "unlockpt is not portable - "
1251                  "use gnulib module unlockpt for portability");
1252 # endif
1253 #endif
1254 
1255 #if IN_GREP_GNULIB_TESTS
1256 /* Remove the variable NAME from the environment.  */
1257 # if 0
1258 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1259 #   undef unsetenv
1260 #   define unsetenv rpl_unsetenv
1261 #  endif
1262 _GL_FUNCDECL_RPL (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1)));
1263 _GL_CXXALIAS_RPL (unsetenv, int, (const char *name));
1264 # else
1265 #  if !1
1266 _GL_FUNCDECL_SYS (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1)));
1267 #  endif
1268 _GL_CXXALIAS_SYS (unsetenv, int, (const char *name));
1269 # endif
1270 # if !(0 && !1)
1271 _GL_CXXALIASWARN (unsetenv);
1272 # endif
1273 #elif defined GNULIB_POSIXCHECK
1274 # undef unsetenv
1275 # if HAVE_RAW_DECL_UNSETENV
1276 _GL_WARN_ON_USE (unsetenv, "unsetenv is unportable - "
1277                  "use gnulib module unsetenv for portability");
1278 # endif
1279 #endif
1280 
1281 /* Convert a wide character to a multibyte character.  */
1282 #if 1
1283 # if 0
1284 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1285 #   undef wctomb
1286 #   define wctomb rpl_wctomb
1287 #  endif
1288 _GL_FUNCDECL_RPL (wctomb, int, (char *s, wchar_t wc));
1289 _GL_CXXALIAS_RPL (wctomb, int, (char *s, wchar_t wc));
1290 # else
1291 _GL_CXXALIAS_SYS (wctomb, int, (char *s, wchar_t wc));
1292 # endif
1293 _GL_CXXALIASWARN (wctomb);
1294 #endif
1295 
1296 
1297 #endif /* _GL_STDLIB_H */
1298 #endif /* _GL_STDLIB_H */
1299 #endif
1300