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