Line data Source code
1 : /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
2 : /* A GNU-like <stdlib.h>.
3 :
4 : Copyright (C) 1995, 2001-2004, 2006-2025 Free Software Foundation, Inc.
5 :
6 : This file is free software: you can redistribute it and/or modify
7 : it under the terms of the GNU Lesser General Public License as
8 : published by the Free Software Foundation; either version 2.1 of the
9 : License, or (at your option) any later version.
10 :
11 : This file 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 Lesser General Public License for more details.
15 :
16 : You should have received a copy of the GNU Lesser General Public License
17 : along with this program. If not, see <https://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 _GLIBCXX_STDLIB_H) \
25 : || defined __need_malloc_and_calloc) \
26 : && !defined __SUNPRO_CC
27 : /* Special invocation conventions inside some gnulib header files,
28 : and inside some glibc header files, respectively.
29 : Do not recognize this special invocation convention when GCC's
30 : c++/11/stdlib.h is being included or has been included. This is needed
31 : to support the use of clang+llvm binaries on Ubuntu 22.04 with
32 : CXX="$clangdir/bin/clang++ -I/usr/include/c++/11 \
33 : -I/usr/include/x86_64-linux-gnu/c++/11
34 : -L/usr/lib/gcc/x86_64-linux-gnu/11
35 : -Wl,-rpath,$clangdir/lib"
36 : because in this case /usr/include/c++/11/stdlib.h (which does not support
37 : the convention) is seen before the gnulib-generated stdlib.h. */
38 :
39 : #include_next <stdlib.h>
40 :
41 : /* Make sure that the macros that indicate the special invocation convention
42 : get undefined. This is needed at least on CentOS 7. */
43 : #undef __need_malloc_and_calloc
44 :
45 : #else
46 : /* Normal invocation convention. */
47 :
48 : #ifndef _GL_STDLIB_H
49 :
50 : /* The include_next requires a split double-inclusion guard. */
51 : #include_next <stdlib.h>
52 :
53 : #ifndef _GL_STDLIB_H
54 : #define _GL_STDLIB_H
55 :
56 : /* This file uses _Noreturn, _GL_ATTRIBUTE_DEALLOC, _GL_ATTRIBUTE_MALLOC,
57 : _GL_ATTRIBUTE_NODISCARD, _GL_ATTRIBUTE_NOTHROW, _GL_ATTRIBUTE_PURE,
58 : _GL_INLINE_HEADER_BEGIN, GNULIB_POSIXCHECK, HAVE_RAW_DECL_*. */
59 : #if !_GL_CONFIG_H_INCLUDED
60 : #error "Please include config.h first."
61 : #endif
62 :
63 : /* NetBSD 5.0 mis-defines NULL. */
64 : #include <stddef.h>
65 :
66 : /* MirBSD 10 defines WEXITSTATUS in <sys/wait.h>, not in <stdlib.h>.
67 : glibc 2.41 defines WCOREDUMP in <sys/wait.h>, not in <stdlib.h>. */
68 : #if 0 && !(defined WEXITSTATUS && defined WCOREDUMP)
69 : # include <sys/wait.h>
70 : #endif
71 :
72 : /* Solaris declares getloadavg() in <sys/loadavg.h>. */
73 : #if (0 || defined GNULIB_POSIXCHECK) && 0
74 : /* OpenIndiana has a bug: <sys/time.h> must be included before
75 : <sys/loadavg.h>. */
76 : # include <sys/time.h>
77 : # include <sys/loadavg.h>
78 : #endif
79 :
80 : /* Native Windows platforms declare _mktemp() in <io.h>. */
81 : #if defined _WIN32 && !defined __CYGWIN__
82 : # include <io.h>
83 : #endif
84 :
85 : #if 0
86 :
87 : /* OSF/1 5.1 declares 'struct random_data' in <random.h>, which is included
88 : from <stdlib.h> if _REENTRANT is defined. Include it whenever we need
89 : 'struct random_data'. */
90 : # if 1
91 : # include <random.h>
92 : # endif
93 :
94 : # include <stdint.h>
95 :
96 : # if !1
97 : /* Define 'struct random_data'.
98 : But allow multiple gnulib generated <stdlib.h> replacements to coexist. */
99 : # if !GNULIB_defined_struct_random_data
100 : struct random_data
101 : {
102 : int32_t *fptr; /* Front pointer. */
103 : int32_t *rptr; /* Rear pointer. */
104 : int32_t *state; /* Array of state values. */
105 : int rand_type; /* Type of random number generator. */
106 : int rand_deg; /* Degree of random number generator. */
107 : int rand_sep; /* Distance between front and rear. */
108 : int32_t *end_ptr; /* Pointer behind state table. */
109 : };
110 : # define GNULIB_defined_struct_random_data 1
111 : # endif
112 : # endif
113 : #endif
114 :
115 : #if (0 || 0 || 0 || 0 || 0 || defined GNULIB_POSIXCHECK) && ! defined __GLIBC__ && !(defined _WIN32 && ! defined __CYGWIN__)
116 : /* On Mac OS X 10.3, only <unistd.h> declares mkstemp. */
117 : /* On Mac OS X 10.5, only <unistd.h> declares mkstemps. */
118 : /* On Mac OS X 10.13, only <unistd.h> declares mkostemp and mkostemps. */
119 : /* On Cygwin 1.7.1, only <unistd.h> declares getsubopt. */
120 : /* But avoid namespace pollution on glibc systems and native Windows. */
121 : # include <unistd.h>
122 : #endif
123 :
124 : #if ((0 && 0) || (0 && 0) || (0 && 0) || (0 && 0)) && defined __cplusplus && !defined GNULIB_NAMESPACE && defined __GNUG__ && !defined __clang__ && (defined __sun || defined _AIX)
125 : /* When strtol, strtoll, strtoul, or strtoull is going to be defined as a macro
126 : below, this may cause compilation errors later in the libstdc++ header files
127 : (that are part of GCC), such as:
128 : error: 'rpl_strtol' is not a member of 'std'
129 : To avoid this, include the relevant header files here, before these symbols
130 : get defined as macros. But do so only on Solaris 11 and AIX (where it is
131 : needed), not on mingw (where it would cause other compilation errors). */
132 : # include <string>
133 : #endif
134 :
135 : _GL_INLINE_HEADER_BEGIN
136 : #ifndef _GL_STDLIB_INLINE
137 : # define _GL_STDLIB_INLINE _GL_INLINE
138 : #endif
139 : #ifndef _GL_REALLOC_INLINE
140 : # define _GL_REALLOC_INLINE _GL_INLINE
141 : #endif
142 :
143 : /* _GL_ATTRIBUTE_DEALLOC (F, I) declares that the function returns pointers
144 : that can be freed by passing them as the Ith argument to the
145 : function F. */
146 : #ifndef _GL_ATTRIBUTE_DEALLOC
147 : # if __GNUC__ >= 11 && !defined __clang__
148 : # define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
149 : # else
150 : # define _GL_ATTRIBUTE_DEALLOC(f, i)
151 : # endif
152 : #endif
153 :
154 : /* _GL_ATTRIBUTE_DEALLOC_FREE declares that the function returns pointers that
155 : can be freed via 'free'; it can be used only after declaring 'free'. */
156 : /* Applies to: functions. Cannot be used on inline functions. */
157 : #ifndef _GL_ATTRIBUTE_DEALLOC_FREE
158 : # define _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_DEALLOC (free, 1)
159 : #endif
160 :
161 : /* _GL_ATTRIBUTE_MALLOC declares that the function returns a pointer to freshly
162 : allocated memory. */
163 : /* Applies to: functions. */
164 : #ifndef _GL_ATTRIBUTE_MALLOC
165 : # if __GNUC__ >= 3 || defined __clang__
166 : # define _GL_ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
167 : # else
168 : # define _GL_ATTRIBUTE_MALLOC
169 : # endif
170 : #endif
171 :
172 : /* _GL_ATTRIBUTE_NONNULL_IF_NONZERO (NP, NI) declares that the argument NP
173 : (a pointer) must not be NULL if the argument NI (an integer) is != 0. */
174 : /* Applies to: functions. */
175 : #ifndef _GL_ATTRIBUTE_NONNULL_IF_NONZERO
176 : # if __GNUC__ >= 15 && !defined __clang__
177 : # define _GL_ATTRIBUTE_NONNULL_IF_NONZERO(np, ni) \
178 : __attribute__ ((__nonnull_if_nonzero__ (np, ni)))
179 : # else
180 : # define _GL_ATTRIBUTE_NONNULL_IF_NONZERO(np, ni)
181 : # endif
182 : #endif
183 :
184 : /* _GL_ATTRIBUTE_NOTHROW declares that the function does not throw exceptions.
185 : */
186 : #ifndef _GL_ATTRIBUTE_NOTHROW
187 : # if defined __cplusplus
188 : # if (__GNUC__ + (__GNUC_MINOR__ >= 8) > 2) || __clang_major__ >= 4
189 : # if __cplusplus >= 201103L
190 : # define _GL_ATTRIBUTE_NOTHROW noexcept (true)
191 : # else
192 : # define _GL_ATTRIBUTE_NOTHROW throw ()
193 : # endif
194 : # else
195 : # define _GL_ATTRIBUTE_NOTHROW
196 : # endif
197 : # else
198 : # if (__GNUC__ + (__GNUC_MINOR__ >= 3) > 3) || defined __clang__
199 : # define _GL_ATTRIBUTE_NOTHROW __attribute__ ((__nothrow__))
200 : # else
201 : # define _GL_ATTRIBUTE_NOTHROW
202 : # endif
203 : # endif
204 : #endif
205 :
206 : /* The __attribute__ feature is available in gcc versions 2.5 and later.
207 : The attribute __pure__ was added in gcc 2.96. */
208 : #ifndef _GL_ATTRIBUTE_PURE
209 : # if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || defined __clang__
210 : # define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
211 : # else
212 : # define _GL_ATTRIBUTE_PURE /* empty */
213 : # endif
214 : #endif
215 :
216 : /* The definition of _Noreturn is copied here. */
217 : /* A C macro for declaring that a function does not return.
218 : Copyright (C) 2011-2025 Free Software Foundation, Inc.
219 :
220 : This program is free software: you can redistribute it and/or modify it
221 : under the terms of the GNU Lesser General Public License as published
222 : by the Free Software Foundation; either version 2 of the License, or
223 : (at your option) any later version.
224 :
225 : This program is distributed in the hope that it will be useful,
226 : but WITHOUT ANY WARRANTY; without even the implied warranty of
227 : MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
228 : Lesser General Public License for more details.
229 :
230 : You should have received a copy of the GNU Lesser General Public License
231 : along with this program. If not, see <https://www.gnu.org/licenses/>. */
232 :
233 : /* The _Noreturn keyword of C11.
234 : Do not use [[noreturn]], because with it the syntax
235 : extern _Noreturn void func (...);
236 : would not be valid; such a declaration would be valid only with 'extern'
237 : and '_Noreturn' swapped, or without the 'extern' keyword. However, some
238 : AIX system header files and several gnulib header files use precisely
239 : this syntax with 'extern'. So even though C23 deprecates _Noreturn,
240 : it is currently more portable to prefer it to [[noreturn]].
241 :
242 : Also, do not try to work around LLVM bug 59792 (clang 15 or earlier).
243 : This rare bug can be worked around by compiling with 'clang -D_Noreturn=',
244 : though the workaround may generate many false-alarm warnings. */
245 : #ifndef _Noreturn
246 : # if ((!defined __cplusplus || defined __clang__) \
247 : && (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0)))
248 : /* _Noreturn works as-is. */
249 : # elif (2 < __GNUC__ + (8 <= __GNUC_MINOR__) || defined __clang__ \
250 : || 0x5110 <= __SUNPRO_C)
251 : /* Prefer __attribute__ ((__noreturn__)) to plain _Noreturn even if the
252 : latter works, as 'gcc -std=gnu99 -Wpedantic' warns about _Noreturn. */
253 : # define _Noreturn __attribute__ ((__noreturn__))
254 : # elif 1200 <= (defined _MSC_VER ? _MSC_VER : 0)
255 : # define _Noreturn __declspec (noreturn)
256 : # else
257 : # define _Noreturn
258 : # endif
259 : #endif
260 :
261 : /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
262 : /* C++ compatible function declaration macros.
263 : Copyright (C) 2010-2025 Free Software Foundation, Inc.
264 :
265 : This program is free software: you can redistribute it and/or modify it
266 : under the terms of the GNU Lesser General Public License as published
267 : by the Free Software Foundation; either version 2 of the License, or
268 : (at your option) any later version.
269 :
270 : This program is distributed in the hope that it will be useful,
271 : but WITHOUT ANY WARRANTY; without even the implied warranty of
272 : MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
273 : Lesser General Public License for more details.
274 :
275 : You should have received a copy of the GNU Lesser General Public License
276 : along with this program. If not, see <https://www.gnu.org/licenses/>. */
277 :
278 : #ifndef _GL_CXXDEFS_H
279 : #define _GL_CXXDEFS_H
280 :
281 : /* Begin/end the GNULIB_NAMESPACE namespace. */
282 : #if defined __cplusplus && defined GNULIB_NAMESPACE
283 : # define _GL_BEGIN_NAMESPACE namespace GNULIB_NAMESPACE {
284 : # define _GL_END_NAMESPACE }
285 : #else
286 : # define _GL_BEGIN_NAMESPACE
287 : # define _GL_END_NAMESPACE
288 : #endif
289 :
290 : /* The three most frequent use cases of these macros are:
291 :
292 : * For providing a substitute for a function that is missing on some
293 : platforms, but is declared and works fine on the platforms on which
294 : it exists:
295 :
296 : #if @GNULIB_FOO@
297 : # if !@HAVE_FOO@
298 : _GL_FUNCDECL_SYS (foo, ...);
299 : # endif
300 : _GL_CXXALIAS_SYS (foo, ...);
301 : _GL_CXXALIASWARN (foo);
302 : #elif defined GNULIB_POSIXCHECK
303 : ...
304 : #endif
305 :
306 : * For providing a replacement for a function that exists on all platforms,
307 : but is broken/insufficient and needs to be replaced on some platforms:
308 :
309 : #if @GNULIB_FOO@
310 : # if @REPLACE_FOO@
311 : # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
312 : # undef foo
313 : # define foo rpl_foo
314 : # endif
315 : _GL_FUNCDECL_RPL (foo, ...);
316 : _GL_CXXALIAS_RPL (foo, ...);
317 : # else
318 : _GL_CXXALIAS_SYS (foo, ...);
319 : # endif
320 : _GL_CXXALIASWARN (foo);
321 : #elif defined GNULIB_POSIXCHECK
322 : ...
323 : #endif
324 :
325 : * For providing a replacement for a function that exists on some platforms
326 : but is broken/insufficient and needs to be replaced on some of them and
327 : is additionally either missing or undeclared on some other platforms:
328 :
329 : #if @GNULIB_FOO@
330 : # if @REPLACE_FOO@
331 : # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
332 : # undef foo
333 : # define foo rpl_foo
334 : # endif
335 : _GL_FUNCDECL_RPL (foo, ...);
336 : _GL_CXXALIAS_RPL (foo, ...);
337 : # else
338 : # if !@HAVE_FOO@ or if !@HAVE_DECL_FOO@
339 : _GL_FUNCDECL_SYS (foo, ...);
340 : # endif
341 : _GL_CXXALIAS_SYS (foo, ...);
342 : # endif
343 : _GL_CXXALIASWARN (foo);
344 : #elif defined GNULIB_POSIXCHECK
345 : ...
346 : #endif
347 : */
348 :
349 : /* _GL_EXTERN_C declaration;
350 : performs the declaration with C linkage. */
351 : #if defined __cplusplus
352 : # define _GL_EXTERN_C extern "C"
353 : #else
354 : # define _GL_EXTERN_C extern
355 : #endif
356 :
357 : /* _GL_EXTERN_C_FUNC declaration;
358 : performs the declaration of a function with C linkage. */
359 : #if defined __cplusplus
360 : # define _GL_EXTERN_C_FUNC extern "C"
361 : #else
362 : /* In C mode, omit the 'extern' keyword, because attributes in bracket syntax
363 : are not allowed between 'extern' and the return type (see gnulib-common.m4).
364 : */
365 : # define _GL_EXTERN_C_FUNC
366 : #endif
367 :
368 : /* _GL_FUNCDECL_RPL (func, rettype, parameters, [attributes]);
369 : declares a replacement function, named rpl_func, with the given prototype,
370 : consisting of return type, parameters, and attributes.
371 : Although attributes are optional, the comma before them is required
372 : for portability to C17 and earlier. The attribute _GL_ATTRIBUTE_NOTHROW,
373 : if needed, must be placed after the _GL_FUNCDECL_RPL invocation,
374 : at the end of the declaration.
375 : Examples:
376 : _GL_FUNCDECL_RPL (free, void, (void *ptr), ) _GL_ATTRIBUTE_NOTHROW;
377 : _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...),
378 : _GL_ARG_NONNULL ((1)));
379 :
380 : Note: Attributes, such as _GL_ATTRIBUTE_DEPRECATED, are supported in front
381 : of a _GL_FUNCDECL_RPL invocation only in C mode, not in C++ mode. (That's
382 : because
383 : [[...]] extern "C" <declaration>;
384 : is invalid syntax in C++.)
385 : */
386 : #define _GL_FUNCDECL_RPL(func,rettype,parameters,...) \
387 : _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters, __VA_ARGS__)
388 : #define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters,...) \
389 : _GL_EXTERN_C_FUNC __VA_ARGS__ rettype rpl_func parameters
390 :
391 : /* _GL_FUNCDECL_SYS (func, rettype, parameters, [attributes]);
392 : declares the system function, named func, with the given prototype,
393 : consisting of return type, parameters, and attributes.
394 : Although attributes are optional, the comma before them is required
395 : for portability to C17 and earlier. The attribute _GL_ATTRIBUTE_NOTHROW,
396 : if needed, must be placed after the _GL_FUNCDECL_RPL invocation,
397 : at the end of the declaration.
398 : Examples:
399 : _GL_FUNCDECL_SYS (getumask, mode_t, (void), ) _GL_ATTRIBUTE_NOTHROW;
400 : _GL_FUNCDECL_SYS (posix_openpt, int, (int flags), _GL_ATTRIBUTE_NODISCARD);
401 : */
402 : #define _GL_FUNCDECL_SYS(func,rettype,parameters,...) \
403 : _GL_EXTERN_C_FUNC __VA_ARGS__ rettype func parameters
404 :
405 : /* _GL_CXXALIAS_RPL (func, rettype, parameters);
406 : declares a C++ alias called GNULIB_NAMESPACE::func
407 : that redirects to rpl_func, if GNULIB_NAMESPACE is defined.
408 : Example:
409 : _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...));
410 :
411 : Wrapping rpl_func in an object with an inline conversion operator
412 : avoids a reference to rpl_func unless GNULIB_NAMESPACE::func is
413 : actually used in the program. */
414 : #define _GL_CXXALIAS_RPL(func,rettype,parameters) \
415 : _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters)
416 : #if defined __cplusplus && defined GNULIB_NAMESPACE
417 : # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
418 : namespace GNULIB_NAMESPACE \
419 : { \
420 : static const struct _gl_ ## func ## _wrapper \
421 : { \
422 : typedef rettype (*type) parameters; \
423 : \
424 : inline operator type () const \
425 : { \
426 : return ::rpl_func; \
427 : } \
428 : } func = {}; \
429 : } \
430 : _GL_EXTERN_C int _gl_cxxalias_dummy
431 : #else
432 : # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
433 : _GL_EXTERN_C int _gl_cxxalias_dummy
434 : #endif
435 :
436 : /* _GL_CXXALIAS_MDA (func, rettype, parameters);
437 : is to be used when func is a Microsoft deprecated alias, on native Windows.
438 : It declares a C++ alias called GNULIB_NAMESPACE::func
439 : that redirects to _func, if GNULIB_NAMESPACE is defined.
440 : Example:
441 : _GL_CXXALIAS_MDA (open, int, (const char *filename, int flags, ...));
442 : */
443 : #define _GL_CXXALIAS_MDA(func,rettype,parameters) \
444 : _GL_CXXALIAS_RPL_1 (func, _##func, rettype, parameters)
445 :
446 : /* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters);
447 : is like _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters);
448 : except that the C function rpl_func may have a slightly different
449 : declaration. A cast is used to silence the "invalid conversion" error
450 : that would otherwise occur. */
451 : #if defined __cplusplus && defined GNULIB_NAMESPACE
452 : # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
453 : namespace GNULIB_NAMESPACE \
454 : { \
455 : static const struct _gl_ ## func ## _wrapper \
456 : { \
457 : typedef rettype (*type) parameters; \
458 : \
459 : inline operator type () const \
460 : { \
461 : return reinterpret_cast<type>(::rpl_func); \
462 : } \
463 : } func = {}; \
464 : } \
465 : _GL_EXTERN_C int _gl_cxxalias_dummy
466 : #else
467 : # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
468 : _GL_EXTERN_C int _gl_cxxalias_dummy
469 : #endif
470 :
471 : /* _GL_CXXALIAS_MDA_CAST (func, rettype, parameters);
472 : is like _GL_CXXALIAS_MDA (func, rettype, parameters);
473 : except that the C function func may have a slightly different declaration.
474 : A cast is used to silence the "invalid conversion" error that would
475 : otherwise occur. */
476 : #define _GL_CXXALIAS_MDA_CAST(func,rettype,parameters) \
477 : _GL_CXXALIAS_RPL_CAST_1 (func, _##func, rettype, parameters)
478 :
479 : /* _GL_CXXALIAS_SYS (func, rettype, parameters);
480 : declares a C++ alias called GNULIB_NAMESPACE::func
481 : that redirects to the system provided function func, if GNULIB_NAMESPACE
482 : is defined.
483 : Example:
484 : _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...));
485 :
486 : Wrapping func in an object with an inline conversion operator
487 : avoids a reference to func unless GNULIB_NAMESPACE::func is
488 : actually used in the program. */
489 : #if defined __cplusplus && defined GNULIB_NAMESPACE
490 : # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
491 : namespace GNULIB_NAMESPACE \
492 : { \
493 : static const struct _gl_ ## func ## _wrapper \
494 : { \
495 : typedef rettype (*type) parameters; \
496 : \
497 : inline operator type () const \
498 : { \
499 : return ::func; \
500 : } \
501 : } func = {}; \
502 : } \
503 : _GL_EXTERN_C int _gl_cxxalias_dummy
504 : #else
505 : # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
506 : _GL_EXTERN_C int _gl_cxxalias_dummy
507 : #endif
508 :
509 : /* _GL_CXXALIAS_SYS_CAST (func, rettype, parameters);
510 : is like _GL_CXXALIAS_SYS (func, rettype, parameters);
511 : except that the C function func may have a slightly different declaration.
512 : A cast is used to silence the "invalid conversion" error that would
513 : otherwise occur. */
514 : #if defined __cplusplus && defined GNULIB_NAMESPACE
515 : # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
516 : namespace GNULIB_NAMESPACE \
517 : { \
518 : static const struct _gl_ ## func ## _wrapper \
519 : { \
520 : typedef rettype (*type) parameters; \
521 : \
522 : inline operator type () const \
523 : { \
524 : return reinterpret_cast<type>(::func); \
525 : } \
526 : } func = {}; \
527 : } \
528 : _GL_EXTERN_C int _gl_cxxalias_dummy
529 : #else
530 : # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
531 : _GL_EXTERN_C int _gl_cxxalias_dummy
532 : #endif
533 :
534 : /* _GL_CXXALIAS_SYS_CAST2 (func, rettype, parameters, rettype2, parameters2);
535 : is like _GL_CXXALIAS_SYS (func, rettype, parameters);
536 : except that the C function is picked among a set of overloaded functions,
537 : namely the one with rettype2 and parameters2. Two consecutive casts
538 : are used to silence the "cannot find a match" and "invalid conversion"
539 : errors that would otherwise occur. */
540 : #if defined __cplusplus && defined GNULIB_NAMESPACE
541 : /* The outer cast must be a reinterpret_cast.
542 : The inner cast: When the function is defined as a set of overloaded
543 : functions, it works as a static_cast<>, choosing the designated variant.
544 : When the function is defined as a single variant, it works as a
545 : reinterpret_cast<>. The parenthesized cast syntax works both ways. */
546 : # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
547 : namespace GNULIB_NAMESPACE \
548 : { \
549 : static const struct _gl_ ## func ## _wrapper \
550 : { \
551 : typedef rettype (*type) parameters; \
552 : \
553 : inline operator type () const \
554 : { \
555 : return reinterpret_cast<type>((rettype2 (*) parameters2)(::func)); \
556 : } \
557 : } func = {}; \
558 : } \
559 : _GL_EXTERN_C int _gl_cxxalias_dummy
560 : #else
561 : # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
562 : _GL_EXTERN_C int _gl_cxxalias_dummy
563 : #endif
564 :
565 : /* _GL_CXXALIASWARN (func);
566 : causes a warning to be emitted when ::func is used but not when
567 : GNULIB_NAMESPACE::func is used. func must be defined without overloaded
568 : variants. */
569 : #if defined __cplusplus && defined GNULIB_NAMESPACE
570 : # define _GL_CXXALIASWARN(func) \
571 : _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE)
572 : # define _GL_CXXALIASWARN_1(func,namespace) \
573 : _GL_CXXALIASWARN_2 (func, namespace)
574 : /* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
575 : we enable the warning only when not optimizing. */
576 : # if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__)
577 : # define _GL_CXXALIASWARN_2(func,namespace) \
578 : _GL_WARN_ON_USE (func, \
579 : "The symbol ::" #func " refers to the system function. " \
580 : "Use " #namespace "::" #func " instead.")
581 : # elif (__GNUC__ >= 3 || defined __clang__) && GNULIB_STRICT_CHECKING
582 : # define _GL_CXXALIASWARN_2(func,namespace) \
583 : extern __typeof__ (func) func
584 : # else
585 : # define _GL_CXXALIASWARN_2(func,namespace) \
586 : _GL_EXTERN_C int _gl_cxxalias_dummy
587 : # endif
588 : #else
589 : # define _GL_CXXALIASWARN(func) \
590 : _GL_EXTERN_C int _gl_cxxalias_dummy
591 : #endif
592 :
593 : /* _GL_CXXALIASWARN1 (func, rettype, parameters_and_attributes);
594 : causes a warning to be emitted when the given overloaded variant of ::func
595 : is used but not when GNULIB_NAMESPACE::func is used. */
596 : #if defined __cplusplus && defined GNULIB_NAMESPACE
597 : # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
598 : _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \
599 : GNULIB_NAMESPACE)
600 : # define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \
601 : _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace)
602 : /* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
603 : we enable the warning only when not optimizing. */
604 : # if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__)
605 : # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
606 : _GL_WARN_ON_USE_CXX (func, rettype, rettype, parameters_and_attributes, \
607 : "The symbol ::" #func " refers to the system function. " \
608 : "Use " #namespace "::" #func " instead.")
609 : # else
610 : # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
611 : _GL_EXTERN_C int _gl_cxxalias_dummy
612 : # endif
613 : #else
614 : # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
615 : _GL_EXTERN_C int _gl_cxxalias_dummy
616 : #endif
617 :
618 : #endif /* _GL_CXXDEFS_H */
619 :
620 : /* The definition of _GL_ARG_NONNULL is copied here. */
621 : /* A C macro for declaring that specific arguments must not be NULL.
622 : Copyright (C) 2009-2025 Free Software Foundation, Inc.
623 :
624 : This program is free software: you can redistribute it and/or modify it
625 : under the terms of the GNU Lesser General Public License as published
626 : by the Free Software Foundation; either version 2 of the License, or
627 : (at your option) any later version.
628 :
629 : This program is distributed in the hope that it will be useful,
630 : but WITHOUT ANY WARRANTY; without even the implied warranty of
631 : MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
632 : Lesser General Public License for more details.
633 :
634 : You should have received a copy of the GNU Lesser General Public License
635 : along with this program. If not, see <https://www.gnu.org/licenses/>. */
636 :
637 : /* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools
638 : that the values passed as arguments n, ..., m must be non-NULL pointers.
639 : n = 1 stands for the first argument, n = 2 for the second argument etc. */
640 : #ifndef _GL_ARG_NONNULL
641 : # if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || defined __clang__
642 : # define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params))
643 : # else
644 : # define _GL_ARG_NONNULL(params)
645 : # endif
646 : #endif
647 :
648 : /* The definition of _GL_WARN_ON_USE is copied here. */
649 : /* A C macro for emitting warnings if a function is used.
650 : Copyright (C) 2010-2025 Free Software Foundation, Inc.
651 :
652 : This program is free software: you can redistribute it and/or modify it
653 : under the terms of the GNU Lesser General Public License as published
654 : by the Free Software Foundation; either version 2 of the License, or
655 : (at your option) any later version.
656 :
657 : This program is distributed in the hope that it will be useful,
658 : but WITHOUT ANY WARRANTY; without even the implied warranty of
659 : MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
660 : Lesser General Public License for more details.
661 :
662 : You should have received a copy of the GNU Lesser General Public License
663 : along with this program. If not, see <https://www.gnu.org/licenses/>. */
664 :
665 : /* _GL_WARN_ON_USE (function, "literal string") issues a declaration
666 : for FUNCTION which will then trigger a compiler warning containing
667 : the text of "literal string" anywhere that function is called, if
668 : supported by the compiler. If the compiler does not support this
669 : feature, the macro expands to an unused extern declaration.
670 :
671 : _GL_WARN_ON_USE_ATTRIBUTE ("literal string") expands to the
672 : attribute used in _GL_WARN_ON_USE. If the compiler does not support
673 : this feature, it expands to empty.
674 :
675 : These macros are useful for marking a function as a potential
676 : portability trap, with the intent that "literal string" include
677 : instructions on the replacement function that should be used
678 : instead.
679 : _GL_WARN_ON_USE is for functions with 'extern' linkage.
680 : _GL_WARN_ON_USE_ATTRIBUTE is for functions with 'static' or 'inline'
681 : linkage.
682 :
683 : _GL_WARN_ON_USE should not be used more than once for a given function
684 : in a given compilation unit (because this may generate a warning even
685 : if the function is never called).
686 :
687 : However, one of the reasons that a function is a portability trap is
688 : if it has the wrong signature. Declaring FUNCTION with a different
689 : signature in C is a compilation error, so this macro must use the
690 : same type as any existing declaration so that programs that avoid
691 : the problematic FUNCTION do not fail to compile merely because they
692 : included a header that poisoned the function. But this implies that
693 : _GL_WARN_ON_USE is only safe to use if FUNCTION is known to already
694 : have a declaration. Use of this macro implies that there must not
695 : be any other macro hiding the declaration of FUNCTION; but
696 : undefining FUNCTION first is part of the poisoning process anyway
697 : (although for symbols that are provided only via a macro, the result
698 : is a compilation error rather than a warning containing
699 : "literal string"). Also note that in C++, it is only safe to use if
700 : FUNCTION has no overloads.
701 :
702 : For an example, it is possible to poison 'getline' by:
703 : - adding a call to gl_WARN_ON_USE_PREPARE([[#include <stdio.h>]],
704 : [getline]) in configure.ac, which potentially defines
705 : HAVE_RAW_DECL_GETLINE
706 : - adding this code to a header that wraps the system <stdio.h>:
707 : #undef getline
708 : #if HAVE_RAW_DECL_GETLINE
709 : _GL_WARN_ON_USE (getline, "getline is required by POSIX 2008, but"
710 : "not universally present; use the gnulib module getline");
711 : #endif
712 :
713 : It is not possible to directly poison global variables. But it is
714 : possible to write a wrapper accessor function, and poison that
715 : (less common usage, like &environ, will cause a compilation error
716 : rather than issue the nice warning, but the end result of informing
717 : the developer about their portability problem is still achieved):
718 : #if HAVE_RAW_DECL_ENVIRON
719 : static char ***
720 : rpl_environ (void) { return &environ; }
721 : _GL_WARN_ON_USE (rpl_environ, "environ is not always properly declared");
722 : # undef environ
723 : # define environ (*rpl_environ ())
724 : #endif
725 : or better (avoiding contradictory use of 'static' and 'extern'):
726 : #if HAVE_RAW_DECL_ENVIRON
727 : static char ***
728 : _GL_WARN_ON_USE_ATTRIBUTE ("environ is not always properly declared")
729 : rpl_environ (void) { return &environ; }
730 : # undef environ
731 : # define environ (*rpl_environ ())
732 : #endif
733 : */
734 : #ifndef _GL_WARN_ON_USE
735 :
736 : # if (4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)) && !defined __clang__
737 : /* A compiler attribute is available in gcc versions 4.3.0 and later. */
738 : # define _GL_WARN_ON_USE(function, message) \
739 : _GL_WARN_EXTERN_C __typeof__ (function) function __attribute__ ((__warning__ (message)))
740 : # define _GL_WARN_ON_USE_ATTRIBUTE(message) \
741 : __attribute__ ((__warning__ (message)))
742 : # elif __clang_major__ >= 4
743 : /* Another compiler attribute is available in clang. */
744 : # define _GL_WARN_ON_USE(function, message) \
745 : _GL_WARN_EXTERN_C __typeof__ (function) function \
746 : __attribute__ ((__diagnose_if__ (1, message, "warning")))
747 : # define _GL_WARN_ON_USE_ATTRIBUTE(message) \
748 : __attribute__ ((__diagnose_if__ (1, message, "warning")))
749 : # elif (__GNUC__ >= 3 || defined __clang__) && GNULIB_STRICT_CHECKING
750 : /* Verify the existence of the function. */
751 : # define _GL_WARN_ON_USE(function, message) \
752 : _GL_WARN_EXTERN_C __typeof__ (function) function
753 : # define _GL_WARN_ON_USE_ATTRIBUTE(message)
754 : # else /* Unsupported. */
755 : # define _GL_WARN_ON_USE(function, message) \
756 : _GL_WARN_EXTERN_C int _gl_warn_on_use
757 : # define _GL_WARN_ON_USE_ATTRIBUTE(message)
758 : # endif
759 : #endif
760 :
761 : /* _GL_WARN_ON_USE_CXX (function, rettype_gcc, rettype_clang, parameters_and_attributes, "message")
762 : is like _GL_WARN_ON_USE (function, "message"), except that in C++ mode the
763 : function is declared with the given prototype, consisting of return type,
764 : parameters, and attributes.
765 : This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does
766 : not work in this case. */
767 : #ifndef _GL_WARN_ON_USE_CXX
768 : # if !defined __cplusplus
769 : # define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
770 : _GL_WARN_ON_USE (function, msg)
771 : # else
772 : # if (4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)) && !defined __clang__
773 : /* A compiler attribute is available in gcc versions 4.3.0 and later. */
774 : # define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
775 : extern rettype_gcc function parameters_and_attributes \
776 : __attribute__ ((__warning__ (msg)))
777 : # elif __clang_major__ >= 4
778 : /* Another compiler attribute is available in clang. */
779 : # define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
780 : extern rettype_clang function parameters_and_attributes \
781 : __attribute__ ((__diagnose_if__ (1, msg, "warning")))
782 : # elif (__GNUC__ >= 3 || defined __clang__) && GNULIB_STRICT_CHECKING
783 : /* Verify the existence of the function. */
784 : # define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
785 : extern rettype_gcc function parameters_and_attributes
786 : # else /* Unsupported. */
787 : # define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
788 : _GL_WARN_EXTERN_C int _gl_warn_on_use
789 : # endif
790 : # endif
791 : #endif
792 :
793 : /* _GL_WARN_EXTERN_C declaration;
794 : performs the declaration with C linkage. */
795 : #ifndef _GL_WARN_EXTERN_C
796 : # if defined __cplusplus
797 : # define _GL_WARN_EXTERN_C extern "C"
798 : # else
799 : # define _GL_WARN_EXTERN_C extern
800 : # endif
801 : #endif
802 :
803 :
804 : /* Some systems do not define EXIT_*, despite otherwise supporting C89. */
805 : #ifndef EXIT_SUCCESS
806 : # define EXIT_SUCCESS 0
807 : #endif
808 : /* Tandem/NSK and other platforms that define EXIT_FAILURE as -1 interfere
809 : with proper operation of xargs. */
810 : #ifndef EXIT_FAILURE
811 : # define EXIT_FAILURE 1
812 : #elif EXIT_FAILURE != 1
813 : # undef EXIT_FAILURE
814 : # define EXIT_FAILURE 1
815 : #endif
816 :
817 :
818 : /* Declarations for ISO C N3322. */
819 : #if defined __GNUC__ && __GNUC__ >= 15 && !defined __clang__
820 : _GL_EXTERN_C void *bsearch (const void *__key,
821 : const void *__base, size_t __nmemb, size_t __size,
822 : int (*__compare) (const void *, const void *))
823 : _GL_ATTRIBUTE_NONNULL_IF_NONZERO (2, 3) _GL_ARG_NONNULL ((5));
824 : _GL_EXTERN_C void qsort (void *__base, size_t __nmemb, size_t __size,
825 : int (*__compare) (const void *, const void *))
826 : _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 2) _GL_ARG_NONNULL ((4));
827 : #endif
828 :
829 :
830 : #if 0
831 : /* Terminate the current process with the given return code, without running
832 : the 'atexit' handlers. */
833 : # if 0
834 : # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
835 : # undef _Exit
836 : # define _Exit rpl__Exit
837 : # endif
838 : _GL_FUNCDECL_RPL (_Exit, _Noreturn void, (int status), );
839 : _GL_CXXALIAS_RPL (_Exit, void, (int status));
840 : # else
841 : # if !1
842 : _GL_FUNCDECL_SYS (_Exit, _Noreturn void, (int status), );
843 : # endif
844 : _GL_CXXALIAS_SYS (_Exit, void, (int status));
845 : # endif
846 : # if __GLIBC__ >= 2
847 : _GL_CXXALIASWARN (_Exit);
848 : # endif
849 : #elif defined GNULIB_POSIXCHECK
850 : # undef _Exit
851 : # if HAVE_RAW_DECL__EXIT
852 : _GL_WARN_ON_USE (_Exit, "_Exit is unportable - "
853 : "use gnulib module _Exit for portability");
854 : # endif
855 : #endif
856 :
857 :
858 : #if 0
859 : /* Terminates the current process with signal SIGABRT.
860 : Note: While the original abort() function is safe to call in signal handlers,
861 : the overridden abort() function is not. */
862 : # if 0
863 : # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
864 : # undef abort
865 : # define abort rpl_abort
866 : # endif
867 : _GL_FUNCDECL_RPL (abort, _Noreturn void, (void), );
868 : _GL_CXXALIAS_RPL (abort, void, (void));
869 : # else
870 : _GL_CXXALIAS_SYS (abort, void, (void));
871 : # endif
872 : # if __GLIBC__ >= 2
873 : _GL_CXXALIASWARN (abort);
874 : # endif
875 : #endif
876 :
877 :
878 : #if 1
879 : # if 1
880 : # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
881 : # undef free
882 : # define free rpl_free
883 : # endif
884 : # if defined __cplusplus && (__GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2)
885 : _GL_FUNCDECL_RPL (free, void, (void *ptr), ) _GL_ATTRIBUTE_NOTHROW;
886 : # else
887 27069826 : _GL_FUNCDECL_RPL (free, void, (void *ptr), );
888 : # endif
889 : _GL_CXXALIAS_RPL (free, void, (void *ptr));
890 : # else
891 : _GL_CXXALIAS_SYS (free, void, (void *ptr));
892 : # endif
893 : # if __GLIBC__ >= 2
894 : _GL_CXXALIASWARN (free);
895 : # endif
896 : #elif defined GNULIB_POSIXCHECK
897 : # undef free
898 : /* Assume free is always declared. */
899 : _GL_WARN_ON_USE (free, "free is not POSIX:2024 compliant everywhere - "
900 : "use gnulib module free-posix for portability");
901 : #endif
902 :
903 :
904 : /* Allocate memory with indefinite extent and specified alignment. */
905 : #if 0
906 : # if 0
907 : # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
908 : # undef aligned_alloc
909 : # define aligned_alloc rpl_aligned_alloc
910 : # endif
911 : _GL_FUNCDECL_RPL (aligned_alloc, void *,
912 : (size_t alignment, size_t size),
913 : _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
914 : _GL_ATTRIBUTE_NODISCARD);
915 : _GL_CXXALIAS_RPL (aligned_alloc, void *, (size_t alignment, size_t size));
916 : # else
917 : # if 1
918 : # if __GNUC__ >= 11 && !defined __clang__
919 : /* For -Wmismatched-dealloc: Associate aligned_alloc with free or rpl_free. */
920 : # if __GLIBC__ + (__GLIBC_MINOR__ >= 16) > 2
921 : _GL_FUNCDECL_SYS (aligned_alloc, void *,
922 : (size_t alignment, size_t size),
923 : _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
924 : _GL_ATTRIBUTE_NODISCARD)
925 : _GL_ATTRIBUTE_NOTHROW;
926 : # else
927 : _GL_FUNCDECL_SYS (aligned_alloc, void *,
928 : (size_t alignment, size_t size),
929 : _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
930 : _GL_ATTRIBUTE_NODISCARD);
931 : # endif
932 : # endif
933 : _GL_CXXALIAS_SYS (aligned_alloc, void *, (size_t alignment, size_t size));
934 : # endif
935 : # endif
936 : # if (__GLIBC__ >= 2) && 1
937 : _GL_CXXALIASWARN (aligned_alloc);
938 : # endif
939 : #else
940 : # if 1 \
941 : && (__GNUC__ >= 11 && !defined __clang__) && !defined aligned_alloc
942 : /* For -Wmismatched-dealloc: Associate aligned_alloc with free or rpl_free. */
943 : # if __GLIBC__ + (__GLIBC_MINOR__ >= 16) > 2
944 : _GL_FUNCDECL_SYS (aligned_alloc, void *,
945 : (size_t alignment, size_t size),
946 : _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE)
947 : _GL_ATTRIBUTE_NOTHROW;
948 : # else
949 : _GL_FUNCDECL_SYS (aligned_alloc, void *,
950 : (size_t alignment, size_t size),
951 : _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
952 : # endif
953 : # endif
954 : # if defined GNULIB_POSIXCHECK
955 : # undef aligned_alloc
956 : # if HAVE_RAW_DECL_ALIGNED_ALLOC
957 : _GL_WARN_ON_USE (aligned_alloc, "aligned_alloc is not portable - "
958 : "use gnulib module aligned_alloc for portability");
959 : # endif
960 : # endif
961 : #endif
962 :
963 : #if 0
964 : /* Parse a signed decimal integer.
965 : Returns the value of the integer. Errors are not detected. */
966 : # if !1
967 : _GL_FUNCDECL_SYS (atoll, long long,
968 : (const char *string),
969 : _GL_ATTRIBUTE_PURE
970 : _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
971 : # endif
972 : _GL_CXXALIAS_SYS (atoll, long long, (const char *string));
973 : _GL_CXXALIASWARN (atoll);
974 : #elif defined GNULIB_POSIXCHECK
975 : # undef atoll
976 : # if HAVE_RAW_DECL_ATOLL
977 : _GL_WARN_ON_USE (atoll, "atoll is unportable - "
978 : "use gnulib module atoll for portability");
979 : # endif
980 : #endif
981 :
982 : #if 0
983 : # if 0 \
984 : || (0 && 0)
985 : # if !((defined __cplusplus && defined GNULIB_NAMESPACE) \
986 : || _GL_USE_STDLIB_ALLOC)
987 : # undef calloc
988 : # define calloc rpl_calloc
989 : # endif
990 : _GL_FUNCDECL_RPL (calloc, void *,
991 : (size_t nmemb, size_t size),
992 : _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
993 : _GL_ATTRIBUTE_NODISCARD);
994 : _GL_CXXALIAS_RPL (calloc, void *, (size_t nmemb, size_t size));
995 : # else
996 : # if __GNUC__ >= 11 && !defined __clang__
997 : /* For -Wmismatched-dealloc: Associate calloc with free or rpl_free. */
998 : # if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2
999 : _GL_FUNCDECL_SYS (calloc, void *,
1000 : (size_t nmemb, size_t size),
1001 : _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
1002 : _GL_ATTRIBUTE_NODISCARD)
1003 : _GL_ATTRIBUTE_NOTHROW;
1004 : # else
1005 : _GL_FUNCDECL_SYS (calloc, void *,
1006 : (size_t nmemb, size_t size),
1007 : _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
1008 : _GL_ATTRIBUTE_NODISCARD);
1009 : # endif
1010 : # endif
1011 : _GL_CXXALIAS_SYS (calloc, void *, (size_t nmemb, size_t size));
1012 : # endif
1013 : # if __GLIBC__ >= 2
1014 : _GL_CXXALIASWARN (calloc);
1015 : # endif
1016 : #else
1017 : # if 1 \
1018 : && (__GNUC__ >= 11 && !defined __clang__) && !defined calloc
1019 : /* For -Wmismatched-dealloc: Associate calloc with free or rpl_free. */
1020 : # if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2
1021 : _GL_FUNCDECL_SYS (calloc, void *,
1022 : (size_t nmemb, size_t size),
1023 : _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE)
1024 : _GL_ATTRIBUTE_NOTHROW;
1025 : # else
1026 : _GL_FUNCDECL_SYS (calloc, void *,
1027 : (size_t nmemb, size_t size),
1028 : _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
1029 : # endif
1030 : # endif
1031 : # if defined GNULIB_POSIXCHECK
1032 : # undef calloc
1033 : /* Assume calloc is always declared. */
1034 : _GL_WARN_ON_USE (calloc, "calloc is not POSIX compliant everywhere - "
1035 : "use gnulib module calloc-posix for portability");
1036 : # endif
1037 : #endif
1038 :
1039 : #if 0
1040 : # if 0
1041 : # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1042 : # define canonicalize_file_name rpl_canonicalize_file_name
1043 : # endif
1044 : _GL_FUNCDECL_RPL (canonicalize_file_name, char *,
1045 : (const char *name),
1046 : _GL_ARG_NONNULL ((1))
1047 : _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
1048 : _GL_ATTRIBUTE_NODISCARD);
1049 : _GL_CXXALIAS_RPL (canonicalize_file_name, char *, (const char *name));
1050 : # else
1051 : # if !1 || (__GNUC__ >= 11 && !defined __clang__)
1052 : # if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
1053 : _GL_FUNCDECL_SYS (canonicalize_file_name, char *,
1054 : (const char *name),
1055 : _GL_ARG_NONNULL ((1))
1056 : _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
1057 : _GL_ATTRIBUTE_NODISCARD)
1058 : _GL_ATTRIBUTE_NOTHROW;
1059 : # else
1060 : _GL_FUNCDECL_SYS (canonicalize_file_name, char *,
1061 : (const char *name),
1062 : _GL_ARG_NONNULL ((1))
1063 : _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
1064 : _GL_ATTRIBUTE_NODISCARD);
1065 : # endif
1066 : # endif
1067 : _GL_CXXALIAS_SYS (canonicalize_file_name, char *, (const char *name));
1068 : # endif
1069 : # ifndef GNULIB_defined_canonicalize_file_name
1070 : # define GNULIB_defined_canonicalize_file_name \
1071 : (!1 || 0)
1072 : # endif
1073 : _GL_CXXALIASWARN (canonicalize_file_name);
1074 : #else
1075 : # if 1 \
1076 : && (__GNUC__ >= 11 && !defined __clang__) && !defined canonicalize_file_name
1077 : /* For -Wmismatched-dealloc: Associate canonicalize_file_name with free or
1078 : rpl_free. */
1079 : # if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
1080 : _GL_FUNCDECL_SYS (canonicalize_file_name, char *,
1081 : (const char *name),
1082 : _GL_ARG_NONNULL ((1))
1083 : _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE)
1084 : _GL_ATTRIBUTE_NOTHROW;
1085 : # else
1086 : _GL_FUNCDECL_SYS (canonicalize_file_name, char *,
1087 : (const char *name),
1088 : _GL_ARG_NONNULL ((1))
1089 : _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
1090 : # endif
1091 : # endif
1092 : # if defined GNULIB_POSIXCHECK
1093 : # undef canonicalize_file_name
1094 : # if HAVE_RAW_DECL_CANONICALIZE_FILE_NAME
1095 : _GL_WARN_ON_USE (canonicalize_file_name,
1096 : "canonicalize_file_name is unportable - "
1097 : "use gnulib module canonicalize-lgpl for portability");
1098 : # endif
1099 : # endif
1100 : #endif
1101 :
1102 : #if 1
1103 : /* On native Windows, map 'ecvt' to '_ecvt', so that -loldnames is not
1104 : required. In C++ with GNULIB_NAMESPACE, avoid differences between
1105 : platforms by defining GNULIB_NAMESPACE::ecvt on all platforms that have
1106 : it. */
1107 : # if defined _WIN32 && !defined __CYGWIN__
1108 : # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1109 : # undef ecvt
1110 : # define ecvt _ecvt
1111 : # endif
1112 : _GL_CXXALIAS_MDA (ecvt, char *,
1113 : (double number, int ndigits, int *decptp, int *signp));
1114 : # else
1115 : # if 1
1116 : _GL_CXXALIAS_SYS (ecvt, char *,
1117 : (double number, int ndigits, int *decptp, int *signp));
1118 : # endif
1119 : # endif
1120 : # if (defined _WIN32 && !defined __CYGWIN__) || 1
1121 : _GL_CXXALIASWARN (ecvt);
1122 : # endif
1123 : #endif
1124 :
1125 : #if 1
1126 : /* On native Windows, map 'fcvt' to '_fcvt', so that -loldnames is not
1127 : required. In C++ with GNULIB_NAMESPACE, avoid differences between
1128 : platforms by defining GNULIB_NAMESPACE::fcvt on all platforms that have
1129 : it. */
1130 : # if defined _WIN32 && !defined __CYGWIN__
1131 : # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1132 : # undef fcvt
1133 : # define fcvt _fcvt
1134 : # endif
1135 : _GL_CXXALIAS_MDA (fcvt, char *,
1136 : (double number, int ndigits, int *decptp, int *signp));
1137 : # else
1138 : # if 1
1139 : _GL_CXXALIAS_SYS (fcvt, char *,
1140 : (double number, int ndigits, int *decptp, int *signp));
1141 : # endif
1142 : # endif
1143 : # if (defined _WIN32 && !defined __CYGWIN__) || 1
1144 : _GL_CXXALIASWARN (fcvt);
1145 : # endif
1146 : #endif
1147 :
1148 : #if 1
1149 : /* On native Windows, map 'gcvt' to '_gcvt', so that -loldnames is not
1150 : required. In C++ with GNULIB_NAMESPACE, avoid differences between
1151 : platforms by defining GNULIB_NAMESPACE::gcvt on all platforms that have
1152 : it. */
1153 : # if defined _WIN32 && !defined __CYGWIN__
1154 : # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1155 : # undef gcvt
1156 : # define gcvt _gcvt
1157 : # endif
1158 : _GL_CXXALIAS_MDA (gcvt, char *, (double number, int ndigits, char *buf));
1159 : # else
1160 : # if 1
1161 : _GL_CXXALIAS_SYS (gcvt, char *, (double number, int ndigits, char *buf));
1162 : # endif
1163 : # endif
1164 : # if (defined _WIN32 && !defined __CYGWIN__) || 1
1165 : _GL_CXXALIASWARN (gcvt);
1166 : # endif
1167 : #endif
1168 :
1169 : #if 0
1170 : /* Store max(NELEM,3) load average numbers in LOADAVG[].
1171 : The three numbers are the load average of the last 1 minute, the last 5
1172 : minutes, and the last 15 minutes, respectively.
1173 : LOADAVG is an array of NELEM numbers. */
1174 : # if 0
1175 : # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1176 : # undef getloadavg
1177 : # define getloadavg rpl_getloadavg
1178 : # endif
1179 : _GL_FUNCDECL_RPL (getloadavg, int, (double loadavg[], int nelem),
1180 : _GL_ARG_NONNULL ((1)));
1181 : _GL_CXXALIAS_RPL (getloadavg, int, (double loadavg[], int nelem));
1182 : # else
1183 : # if !1
1184 : _GL_FUNCDECL_SYS (getloadavg, int, (double loadavg[], int nelem),
1185 : _GL_ARG_NONNULL ((1)));
1186 : # endif
1187 : _GL_CXXALIAS_SYS (getloadavg, int, (double loadavg[], int nelem));
1188 : # endif
1189 : # if __GLIBC__ >= 2
1190 : _GL_CXXALIASWARN (getloadavg);
1191 : # endif
1192 : #elif defined GNULIB_POSIXCHECK
1193 : # undef getloadavg
1194 : # if HAVE_RAW_DECL_GETLOADAVG
1195 : _GL_WARN_ON_USE (getloadavg, "getloadavg is not portable - "
1196 : "use gnulib module getloadavg for portability");
1197 : # endif
1198 : #endif
1199 :
1200 : #if 0
1201 : /* Return the base name of the executing program.
1202 : On native Windows this will usually end in ".exe" or ".EXE". */
1203 : # if 0
1204 : # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1205 : # undef getprogname
1206 : # define getprogname rpl_getprogname
1207 : # endif
1208 : # if 1
1209 : _GL_FUNCDECL_RPL (getprogname, const char *, (void), _GL_ATTRIBUTE_PURE);
1210 : # else
1211 : _GL_FUNCDECL_RPL (getprogname, const char *, (void), );
1212 : # endif
1213 : _GL_CXXALIAS_RPL (getprogname, const char *, (void));
1214 : # else
1215 : # if !1
1216 : # if 1
1217 : _GL_FUNCDECL_SYS (getprogname, const char *, (void), _GL_ATTRIBUTE_PURE);
1218 : # else
1219 : _GL_FUNCDECL_SYS (getprogname, const char *, (void), );
1220 : # endif
1221 : # endif
1222 : _GL_CXXALIAS_SYS (getprogname, const char *, (void));
1223 : # endif
1224 : # if __GLIBC__ >= 2
1225 : _GL_CXXALIASWARN (getprogname);
1226 : # endif
1227 : #elif defined GNULIB_POSIXCHECK
1228 : # undef getprogname
1229 : # if HAVE_RAW_DECL_GETPROGNAME
1230 : _GL_WARN_ON_USE (getprogname, "getprogname is unportable - "
1231 : "use gnulib module getprogname for portability");
1232 : # endif
1233 : #endif
1234 :
1235 : #if 0
1236 : /* Assuming *OPTIONP is a comma separated list of elements of the form
1237 : "token" or "token=value", getsubopt parses the first of these elements.
1238 : If the first element refers to a "token" that is member of the given
1239 : NULL-terminated array of tokens:
1240 : - It replaces the comma with a NUL byte, updates *OPTIONP to point past
1241 : the first option and the comma, sets *VALUEP to the value of the
1242 : element (or NULL if it doesn't contain an "=" sign),
1243 : - It returns the index of the "token" in the given array of tokens.
1244 : Otherwise it returns -1, and *OPTIONP and *VALUEP are undefined.
1245 : For more details see the POSIX specification.
1246 : https://pubs.opengroup.org/onlinepubs/9699919799/functions/getsubopt.html */
1247 : # if 0
1248 : # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1249 : # undef getsubopt
1250 : # define getsubopt rpl_getsubopt
1251 : # endif
1252 : _GL_FUNCDECL_RPL (getsubopt, int,
1253 : (char **optionp, char *const *tokens, char **valuep),
1254 : _GL_ARG_NONNULL ((1, 2, 3)) _GL_ATTRIBUTE_NODISCARD);
1255 : _GL_CXXALIAS_RPL (getsubopt, int,
1256 : (char **optionp, char *const *tokens, char **valuep));
1257 : # else
1258 : # if !1
1259 : _GL_FUNCDECL_SYS (getsubopt, int,
1260 : (char **optionp, char *const *tokens, char **valuep),
1261 : _GL_ARG_NONNULL ((1, 2, 3)) _GL_ATTRIBUTE_NODISCARD);
1262 : # endif
1263 : _GL_CXXALIAS_SYS (getsubopt, int,
1264 : (char **optionp, char *const *tokens, char **valuep));
1265 : # endif
1266 : # if __GLIBC__ >= 2
1267 : _GL_CXXALIASWARN (getsubopt);
1268 : # endif
1269 : #elif defined GNULIB_POSIXCHECK
1270 : # undef getsubopt
1271 : # if HAVE_RAW_DECL_GETSUBOPT
1272 : _GL_WARN_ON_USE (getsubopt, "getsubopt is unportable - "
1273 : "use gnulib module getsubopt for portability");
1274 : # endif
1275 : #endif
1276 :
1277 : #if 0
1278 : /* Change the ownership and access permission of the slave side of the
1279 : pseudo-terminal whose master side is specified by FD. */
1280 : # if !1
1281 : _GL_FUNCDECL_SYS (grantpt, int, (int fd), );
1282 : # endif
1283 : _GL_CXXALIAS_SYS (grantpt, int, (int fd));
1284 : _GL_CXXALIASWARN (grantpt);
1285 : #elif defined GNULIB_POSIXCHECK
1286 : # undef grantpt
1287 : # if HAVE_RAW_DECL_GRANTPT
1288 : _GL_WARN_ON_USE (grantpt, "grantpt is not portable - "
1289 : "use gnulib module grantpt for portability");
1290 : # endif
1291 : #endif
1292 :
1293 : /* If _GL_USE_STDLIB_ALLOC is nonzero, the including module does not
1294 : rely on GNU or POSIX semantics for malloc and realloc (for example,
1295 : by never specifying a zero size), so it does not need malloc or
1296 : realloc to be redefined. */
1297 : #if 1
1298 : # if 0 \
1299 : || (0 && 0)
1300 : # if !((defined __cplusplus && defined GNULIB_NAMESPACE) \
1301 : || _GL_USE_STDLIB_ALLOC)
1302 : # undef malloc
1303 : # define malloc rpl_malloc
1304 : # endif
1305 : _GL_FUNCDECL_RPL (malloc, void *,
1306 : (size_t size),
1307 : _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
1308 : _GL_ATTRIBUTE_NODISCARD);
1309 : _GL_CXXALIAS_RPL (malloc, void *, (size_t size));
1310 : # else
1311 : # if __GNUC__ >= 11 && !defined __clang__
1312 : /* For -Wmismatched-dealloc: Associate malloc with free or rpl_free. */
1313 : # if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2
1314 : _GL_FUNCDECL_SYS (malloc, void *,
1315 : (size_t size),
1316 : _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
1317 : _GL_ATTRIBUTE_NODISCARD)
1318 : _GL_ATTRIBUTE_NOTHROW;
1319 : # else
1320 : _GL_FUNCDECL_SYS (malloc, void *,
1321 : (size_t size),
1322 : _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
1323 : _GL_ATTRIBUTE_NODISCARD);
1324 : # endif
1325 : # endif
1326 : _GL_CXXALIAS_SYS (malloc, void *, (size_t size));
1327 : # endif
1328 : # if __GLIBC__ >= 2
1329 : _GL_CXXALIASWARN (malloc);
1330 : # endif
1331 : #else
1332 : # if 1 \
1333 : && (__GNUC__ >= 11 && !defined __clang__) && !defined malloc
1334 : /* For -Wmismatched-dealloc: Associate malloc with free or rpl_free. */
1335 : # if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2
1336 : _GL_FUNCDECL_SYS (malloc, void *,
1337 : (size_t size),
1338 : _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE)
1339 : _GL_ATTRIBUTE_NOTHROW;
1340 : # else
1341 : _GL_FUNCDECL_SYS (malloc, void *,
1342 : (size_t size),
1343 : _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
1344 : # endif
1345 : # endif
1346 : # if defined GNULIB_POSIXCHECK && !_GL_USE_STDLIB_ALLOC
1347 : # undef malloc
1348 : /* Assume malloc is always declared. */
1349 : _GL_WARN_ON_USE (malloc, "malloc is not POSIX compliant everywhere - "
1350 : "use gnulib module malloc-posix for portability");
1351 : # endif
1352 : #endif
1353 :
1354 : /* Return maximum number of bytes in a multibyte character in the
1355 : current locale. */
1356 : #if 0
1357 : # if !GNULIB_defined_MB_CUR_MAX
1358 : _GL_STDLIB_INLINE size_t
1359 : gl_MB_CUR_MAX (void)
1360 : {
1361 : # if 0 < 0
1362 : return 0;
1363 : # else
1364 : /* Turn the value 3 to the value 4, as needed for the UTF-8 encoding. */
1365 : int gl_mb_cur_max = MB_CUR_MAX;
1366 : return gl_mb_cur_max == 3 ? 4 : gl_mb_cur_max;
1367 : # endif
1368 : }
1369 : # undef MB_CUR_MAX
1370 : # define MB_CUR_MAX gl_MB_CUR_MAX ()
1371 : # define GNULIB_defined_MB_CUR_MAX 1
1372 : # endif
1373 : #endif
1374 :
1375 : /* Convert a string to a wide string. */
1376 : #if 0
1377 : # if 0
1378 : # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1379 : # undef mbstowcs
1380 : # define mbstowcs rpl_mbstowcs
1381 : # endif
1382 : _GL_FUNCDECL_RPL (mbstowcs, size_t,
1383 : (wchar_t *restrict dest, const char *restrict src,
1384 : size_t len),
1385 : _GL_ARG_NONNULL ((2)));
1386 : _GL_CXXALIAS_RPL (mbstowcs, size_t,
1387 : (wchar_t *restrict dest, const char *restrict src,
1388 : size_t len));
1389 : # else
1390 : _GL_CXXALIAS_SYS (mbstowcs, size_t,
1391 : (wchar_t *restrict dest, const char *restrict src,
1392 : size_t len));
1393 : # endif
1394 : # if __GLIBC__ >= 2
1395 : _GL_CXXALIASWARN (mbstowcs);
1396 : # endif
1397 : #elif defined GNULIB_POSIXCHECK
1398 : # undef mbstowcs
1399 : # if HAVE_RAW_DECL_MBSTOWCS
1400 : _GL_WARN_ON_USE (mbstowcs, "mbstowcs is unportable - "
1401 : "use gnulib module mbstowcs for portability");
1402 : # endif
1403 : #endif
1404 :
1405 : /* Convert a multibyte character to a wide character. */
1406 : #if 0
1407 : # if 0
1408 : # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1409 : # undef mbtowc
1410 : # define mbtowc rpl_mbtowc
1411 : # endif
1412 : _GL_FUNCDECL_RPL (mbtowc, int,
1413 : (wchar_t *restrict pwc, const char *restrict s, size_t n), );
1414 : _GL_CXXALIAS_RPL (mbtowc, int,
1415 : (wchar_t *restrict pwc, const char *restrict s, size_t n));
1416 : # else
1417 : # if !1
1418 : _GL_FUNCDECL_SYS (mbtowc, int,
1419 : (wchar_t *restrict pwc, const char *restrict s, size_t n), );
1420 : # endif
1421 : _GL_CXXALIAS_SYS (mbtowc, int,
1422 : (wchar_t *restrict pwc, const char *restrict s, size_t n));
1423 : # endif
1424 : # if __GLIBC__ >= 2
1425 : _GL_CXXALIASWARN (mbtowc);
1426 : # endif
1427 : #elif defined GNULIB_POSIXCHECK
1428 : # undef mbtowc
1429 : # if HAVE_RAW_DECL_MBTOWC
1430 : _GL_WARN_ON_USE (mbtowc, "mbtowc is not portable - "
1431 : "use gnulib module mbtowc for portability");
1432 : # endif
1433 : #endif
1434 :
1435 : #if 0
1436 : /* Create a unique temporary directory from TEMPLATE.
1437 : The last six characters of TEMPLATE must be "XXXXXX";
1438 : they are replaced with a string that makes the directory name unique.
1439 : Returns TEMPLATE, or a null pointer if it cannot get a unique name.
1440 : The directory is created mode 700. */
1441 : # if !1
1442 : _GL_FUNCDECL_SYS (mkdtemp, char *,
1443 : (char * /*template*/),
1444 : _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
1445 : # endif
1446 : _GL_CXXALIAS_SYS (mkdtemp, char *, (char * /*template*/));
1447 : _GL_CXXALIASWARN (mkdtemp);
1448 : #elif defined GNULIB_POSIXCHECK
1449 : # undef mkdtemp
1450 : # if HAVE_RAW_DECL_MKDTEMP
1451 : _GL_WARN_ON_USE (mkdtemp, "mkdtemp is unportable - "
1452 : "use gnulib module mkdtemp for portability");
1453 : # endif
1454 : #endif
1455 :
1456 : #if 0
1457 : /* Create a unique temporary file from TEMPLATE.
1458 : The last six characters of TEMPLATE must be "XXXXXX";
1459 : they are replaced with a string that makes the file name unique.
1460 : The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
1461 : and O_TEXT, O_BINARY (defined in "binary-io.h").
1462 : The file is then created, with the specified flags, ensuring it didn't exist
1463 : before.
1464 : The file is created read-write (mask at least 0600 & ~umask), but it may be
1465 : world-readable and world-writable (mask 0666 & ~umask), depending on the
1466 : implementation.
1467 : Returns the open file descriptor if successful, otherwise -1 and errno
1468 : set. */
1469 : # if 0
1470 : # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1471 : # undef mkostemp
1472 : # define mkostemp rpl_mkostemp
1473 : # endif
1474 : _GL_FUNCDECL_RPL (mkostemp, int, (char * /*template*/, int /*flags*/),
1475 : _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
1476 : _GL_CXXALIAS_RPL (mkostemp, int, (char * /*template*/, int /*flags*/));
1477 : # else
1478 : # if !1
1479 : _GL_FUNCDECL_SYS (mkostemp, int, (char * /*template*/, int /*flags*/),
1480 : _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
1481 : # endif
1482 : _GL_CXXALIAS_SYS (mkostemp, int, (char * /*template*/, int /*flags*/));
1483 : # endif
1484 : # if __GLIBC__ >= 2
1485 : _GL_CXXALIASWARN (mkostemp);
1486 : # endif
1487 : #elif defined GNULIB_POSIXCHECK
1488 : # undef mkostemp
1489 : # if HAVE_RAW_DECL_MKOSTEMP
1490 : _GL_WARN_ON_USE (mkostemp, "mkostemp is unportable - "
1491 : "use gnulib module mkostemp for portability");
1492 : # endif
1493 : #endif
1494 :
1495 : #if 0
1496 : /* Create a unique temporary file from TEMPLATE.
1497 : The last six characters of TEMPLATE before a suffix of length
1498 : SUFFIXLEN must be "XXXXXX";
1499 : they are replaced with a string that makes the file name unique.
1500 : The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
1501 : and O_TEXT, O_BINARY (defined in "binary-io.h").
1502 : The file is then created, with the specified flags, ensuring it didn't exist
1503 : before.
1504 : The file is created read-write (mask at least 0600 & ~umask), but it may be
1505 : world-readable and world-writable (mask 0666 & ~umask), depending on the
1506 : implementation.
1507 : Returns the open file descriptor if successful, otherwise -1 and errno
1508 : set. */
1509 : # if 0
1510 : # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1511 : # undef mkostemps
1512 : # define mkostemps rpl_mkostemps
1513 : # endif
1514 : _GL_FUNCDECL_RPL (mkostemps, int,
1515 : (char * /*template*/, int /*suffixlen*/, int /*flags*/),
1516 : _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
1517 : _GL_CXXALIAS_RPL (mkostemps, int,
1518 : (char * /*template*/, int /*suffixlen*/, int /*flags*/));
1519 : # else
1520 : # if !1
1521 : _GL_FUNCDECL_SYS (mkostemps, int,
1522 : (char * /*template*/, int /*suffixlen*/, int /*flags*/),
1523 : _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
1524 : # endif
1525 : _GL_CXXALIAS_SYS (mkostemps, int,
1526 : (char * /*template*/, int /*suffixlen*/, int /*flags*/));
1527 : # endif
1528 : # if __GLIBC__ >= 2
1529 : _GL_CXXALIASWARN (mkostemps);
1530 : # endif
1531 : #elif defined GNULIB_POSIXCHECK
1532 : # undef mkostemps
1533 : # if HAVE_RAW_DECL_MKOSTEMPS
1534 : _GL_WARN_ON_USE (mkostemps, "mkostemps is unportable - "
1535 : "use gnulib module mkostemps for portability");
1536 : # endif
1537 : #endif
1538 :
1539 : #if 0
1540 : /* Create a unique temporary file from TEMPLATE.
1541 : The last six characters of TEMPLATE must be "XXXXXX";
1542 : they are replaced with a string that makes the file name unique.
1543 : The file is then created, ensuring it didn't exist before.
1544 : The file is created read-write (mask at least 0600 & ~umask), but it may be
1545 : world-readable and world-writable (mask 0666 & ~umask), depending on the
1546 : implementation.
1547 : Returns the open file descriptor if successful, otherwise -1 and errno
1548 : set. */
1549 : # if 0
1550 : # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1551 : # define mkstemp rpl_mkstemp
1552 : # endif
1553 : _GL_FUNCDECL_RPL (mkstemp, int, (char * /*template*/),
1554 : _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
1555 : _GL_CXXALIAS_RPL (mkstemp, int, (char * /*template*/));
1556 : # else
1557 : # if ! 1
1558 : _GL_FUNCDECL_SYS (mkstemp, int, (char * /*template*/),
1559 : _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
1560 : # endif
1561 : _GL_CXXALIAS_SYS (mkstemp, int, (char * /*template*/));
1562 : # endif
1563 : _GL_CXXALIASWARN (mkstemp);
1564 : #elif defined GNULIB_POSIXCHECK
1565 : # undef mkstemp
1566 : # if HAVE_RAW_DECL_MKSTEMP
1567 : _GL_WARN_ON_USE (mkstemp, "mkstemp is unportable - "
1568 : "use gnulib module mkstemp for portability");
1569 : # endif
1570 : #endif
1571 :
1572 : #if 0
1573 : /* Create a unique temporary file from TEMPLATE.
1574 : The last six characters of TEMPLATE prior to a suffix of length
1575 : SUFFIXLEN must be "XXXXXX";
1576 : they are replaced with a string that makes the file name unique.
1577 : The file is then created, ensuring it didn't exist before.
1578 : The file is created read-write (mask at least 0600 & ~umask), but it may be
1579 : world-readable and world-writable (mask 0666 & ~umask), depending on the
1580 : implementation.
1581 : Returns the open file descriptor if successful, otherwise -1 and errno
1582 : set. */
1583 : # if !1
1584 : _GL_FUNCDECL_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/),
1585 : _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
1586 : # endif
1587 : _GL_CXXALIAS_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/));
1588 : _GL_CXXALIASWARN (mkstemps);
1589 : #elif defined GNULIB_POSIXCHECK
1590 : # undef mkstemps
1591 : # if HAVE_RAW_DECL_MKSTEMPS
1592 : _GL_WARN_ON_USE (mkstemps, "mkstemps is unportable - "
1593 : "use gnulib module mkstemps for portability");
1594 : # endif
1595 : #endif
1596 :
1597 : #if 1
1598 : /* On native Windows, map 'mktemp' to '_mktemp', so that -loldnames is not
1599 : required. In C++ with GNULIB_NAMESPACE, avoid differences between
1600 : platforms by defining GNULIB_NAMESPACE::mktemp always. */
1601 : # if defined _WIN32 && !defined __CYGWIN__
1602 : # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1603 : # undef mktemp
1604 : # define mktemp _mktemp
1605 : # endif
1606 : _GL_CXXALIAS_MDA (mktemp, char *, (char * /*template*/));
1607 : # else
1608 : _GL_CXXALIAS_SYS (mktemp, char *, (char * /*template*/));
1609 : # endif
1610 : _GL_CXXALIASWARN (mktemp);
1611 : #endif
1612 :
1613 : /* Allocate memory with indefinite extent and specified alignment. */
1614 : #if 0
1615 : # if 0
1616 : # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1617 : # undef posix_memalign
1618 : # define posix_memalign rpl_posix_memalign
1619 : # endif
1620 : _GL_FUNCDECL_RPL (posix_memalign, int,
1621 : (void **memptr, size_t alignment, size_t size),
1622 : _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
1623 : _GL_CXXALIAS_RPL (posix_memalign, int,
1624 : (void **memptr, size_t alignment, size_t size));
1625 : # else
1626 : # if 1
1627 : _GL_CXXALIAS_SYS (posix_memalign, int,
1628 : (void **memptr, size_t alignment, size_t size));
1629 : # endif
1630 : # endif
1631 : # if __GLIBC__ >= 2 && 1
1632 : _GL_CXXALIASWARN (posix_memalign);
1633 : # endif
1634 : #elif defined GNULIB_POSIXCHECK
1635 : # undef posix_memalign
1636 : # if HAVE_RAW_DECL_POSIX_MEMALIGN
1637 : _GL_WARN_ON_USE (posix_memalign, "posix_memalign is not portable - "
1638 : "use gnulib module posix_memalign for portability");
1639 : # endif
1640 : #endif
1641 :
1642 : #if 0
1643 : /* Return an FD open to the master side of a pseudo-terminal. Flags should
1644 : include O_RDWR, and may also include O_NOCTTY. */
1645 : # if 0
1646 : # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1647 : # undef posix_openpt
1648 : # define posix_openpt rpl_posix_openpt
1649 : # endif
1650 : _GL_FUNCDECL_RPL (posix_openpt, int, (int flags), _GL_ATTRIBUTE_NODISCARD);
1651 : _GL_CXXALIAS_RPL (posix_openpt, int, (int flags));
1652 : # else
1653 : # if !1
1654 : _GL_FUNCDECL_SYS (posix_openpt, int, (int flags), _GL_ATTRIBUTE_NODISCARD);
1655 : # endif
1656 : _GL_CXXALIAS_SYS (posix_openpt, int, (int flags));
1657 : # endif
1658 : # if __GLIBC__ >= 2
1659 : _GL_CXXALIASWARN (posix_openpt);
1660 : # endif
1661 : #elif defined GNULIB_POSIXCHECK
1662 : # undef posix_openpt
1663 : # if HAVE_RAW_DECL_POSIX_OPENPT
1664 : _GL_WARN_ON_USE (posix_openpt, "posix_openpt is not portable - "
1665 : "use gnulib module posix_openpt for portability");
1666 : # endif
1667 : #endif
1668 :
1669 : #if 0
1670 : /* Return the pathname of the pseudo-terminal slave associated with
1671 : the master FD is open on, or NULL on errors. */
1672 : # if 0
1673 : # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1674 : # undef ptsname
1675 : # define ptsname rpl_ptsname
1676 : # endif
1677 : _GL_FUNCDECL_RPL (ptsname, char *, (int fd), _GL_ATTRIBUTE_NODISCARD);
1678 : _GL_CXXALIAS_RPL (ptsname, char *, (int fd));
1679 : # else
1680 : # if !1
1681 : _GL_FUNCDECL_SYS (ptsname, char *, (int fd), _GL_ATTRIBUTE_NODISCARD);
1682 : # endif
1683 : _GL_CXXALIAS_SYS (ptsname, char *, (int fd));
1684 : # endif
1685 : _GL_CXXALIASWARN (ptsname);
1686 : #elif defined GNULIB_POSIXCHECK
1687 : # undef ptsname
1688 : # if HAVE_RAW_DECL_PTSNAME
1689 : _GL_WARN_ON_USE (ptsname, "ptsname is not portable - "
1690 : "use gnulib module ptsname for portability");
1691 : # endif
1692 : #endif
1693 :
1694 : #if 0
1695 : /* Set the pathname of the pseudo-terminal slave associated with
1696 : the master FD is open on and return 0, or set errno and return
1697 : non-zero on errors. */
1698 : # if 0
1699 : # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1700 : # undef ptsname_r
1701 : # define ptsname_r rpl_ptsname_r
1702 : # endif
1703 : _GL_FUNCDECL_RPL (ptsname_r, int, (int fd, char *buf, size_t len), );
1704 : _GL_CXXALIAS_RPL (ptsname_r, int, (int fd, char *buf, size_t len));
1705 : # else
1706 : # if !1
1707 : _GL_FUNCDECL_SYS (ptsname_r, int, (int fd, char *buf, size_t len), );
1708 : # endif
1709 : _GL_CXXALIAS_SYS (ptsname_r, int, (int fd, char *buf, size_t len));
1710 : # endif
1711 : # ifndef GNULIB_defined_ptsname_r
1712 : # define GNULIB_defined_ptsname_r (!1 || 0)
1713 : # endif
1714 : _GL_CXXALIASWARN (ptsname_r);
1715 : #elif defined GNULIB_POSIXCHECK
1716 : # undef ptsname_r
1717 : # if HAVE_RAW_DECL_PTSNAME_R
1718 : _GL_WARN_ON_USE (ptsname_r, "ptsname_r is not portable - "
1719 : "use gnulib module ptsname_r for portability");
1720 : # endif
1721 : #endif
1722 :
1723 : #if 1
1724 : # if 0
1725 : # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1726 : # undef putenv
1727 : # define putenv rpl_putenv
1728 : # endif
1729 : _GL_FUNCDECL_RPL (putenv, int, (char *string), _GL_ARG_NONNULL ((1)));
1730 : _GL_CXXALIAS_RPL (putenv, int, (char *string));
1731 : # elif defined _WIN32 && !defined __CYGWIN__
1732 : # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1733 : # undef putenv
1734 : # define putenv _putenv
1735 : # endif
1736 : _GL_CXXALIAS_MDA (putenv, int, (char *string));
1737 : # elif defined __KLIBC__
1738 : /* Need to cast, because on OS/2 kLIBC, the first parameter is
1739 : const char *string. */
1740 : _GL_CXXALIAS_SYS_CAST (putenv, int, (char *string));
1741 : # else
1742 : _GL_CXXALIAS_SYS (putenv, int, (char *string));
1743 : # endif
1744 : _GL_CXXALIASWARN (putenv);
1745 : #elif 1
1746 : /* On native Windows, map 'putenv' to '_putenv', so that -loldnames is not
1747 : required. In C++ with GNULIB_NAMESPACE, avoid differences between
1748 : platforms by defining GNULIB_NAMESPACE::putenv always. */
1749 : # if defined _WIN32 && !defined __CYGWIN__
1750 : # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1751 : # undef putenv
1752 : # define putenv _putenv
1753 : # endif
1754 : /* Need to cast, because on mingw, the parameter is either
1755 : 'const char *string' or 'char *string'. */
1756 : _GL_CXXALIAS_MDA_CAST (putenv, int, (char *string));
1757 : # elif defined __KLIBC__
1758 : /* Need to cast, because on OS/2 kLIBC, the first parameter is
1759 : const char *string. */
1760 : _GL_CXXALIAS_SYS_CAST (putenv, int, (char *string));
1761 : # else
1762 : _GL_CXXALIAS_SYS (putenv, int, (char *string));
1763 : # endif
1764 : _GL_CXXALIASWARN (putenv);
1765 : #endif
1766 :
1767 : #if 0
1768 : /* Sort an array of NMEMB elements, starting at address BASE, each element
1769 : occupying SIZE bytes, in ascending order according to the comparison
1770 : function COMPARE. */
1771 : # ifdef __cplusplus
1772 : extern "C" {
1773 : # endif
1774 : # if !GNULIB_defined_qsort_r_fn_types
1775 : typedef int (*_gl_qsort_r_compar_fn) (void const *, void const *, void *);
1776 : # define GNULIB_defined_qsort_r_fn_types 1
1777 : # endif
1778 : # ifdef __cplusplus
1779 : }
1780 : # endif
1781 : # if 0
1782 : # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1783 : # undef qsort_r
1784 : # define qsort_r rpl_qsort_r
1785 : # endif
1786 : _GL_FUNCDECL_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size,
1787 : _gl_qsort_r_compar_fn compare,
1788 : void *arg),
1789 : _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 2)
1790 : _GL_ARG_NONNULL ((4)));
1791 : _GL_CXXALIAS_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size,
1792 : _gl_qsort_r_compar_fn compare,
1793 : void *arg));
1794 : # else
1795 : # if !1
1796 : _GL_FUNCDECL_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size,
1797 : _gl_qsort_r_compar_fn compare,
1798 : void *arg),
1799 : _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 2)
1800 : _GL_ARG_NONNULL ((4)));
1801 : # endif
1802 : _GL_CXXALIAS_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size,
1803 : _gl_qsort_r_compar_fn compare,
1804 : void *arg));
1805 : # endif
1806 : # if __GLIBC__ >= 2
1807 : _GL_CXXALIASWARN (qsort_r);
1808 : # endif
1809 : #elif defined GNULIB_POSIXCHECK
1810 : # undef qsort_r
1811 : # if HAVE_RAW_DECL_QSORT_R
1812 : _GL_WARN_ON_USE (qsort_r, "qsort_r is not portable - "
1813 : "use gnulib module qsort_r for portability");
1814 : # endif
1815 : #endif
1816 :
1817 :
1818 : #if 0 || (0 && !1)
1819 : # ifndef RAND_MAX
1820 : # define RAND_MAX 2147483647
1821 : # endif
1822 : #endif
1823 :
1824 :
1825 : #if 0
1826 : # if 0
1827 : # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1828 : # undef rand
1829 : # define rand rpl_rand
1830 : # endif
1831 : _GL_FUNCDECL_RPL (rand, int, (void), );
1832 : _GL_CXXALIAS_RPL (rand, int, (void));
1833 : # else
1834 : _GL_CXXALIAS_SYS (rand, int, (void));
1835 : # endif
1836 : # if __GLIBC__ >= 2
1837 : _GL_CXXALIASWARN (rand);
1838 : # endif
1839 : #endif
1840 :
1841 :
1842 : #if 0
1843 : # if 0
1844 : # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1845 : # undef random
1846 : # define random rpl_random
1847 : # endif
1848 : _GL_FUNCDECL_RPL (random, long, (void), );
1849 : _GL_CXXALIAS_RPL (random, long, (void));
1850 : # else
1851 : # if !1
1852 : _GL_FUNCDECL_SYS (random, long, (void), );
1853 : # endif
1854 : /* Need to cast, because on Haiku, the return type is
1855 : int. */
1856 : _GL_CXXALIAS_SYS_CAST (random, long, (void));
1857 : # endif
1858 : # if __GLIBC__ >= 2
1859 : _GL_CXXALIASWARN (random);
1860 : # endif
1861 : #elif defined GNULIB_POSIXCHECK
1862 : # undef random
1863 : # if HAVE_RAW_DECL_RANDOM
1864 : _GL_WARN_ON_USE (random, "random is unportable - "
1865 : "use gnulib module random for portability");
1866 : # endif
1867 : #endif
1868 :
1869 : #if 0
1870 : # if 0
1871 : # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1872 : # undef srandom
1873 : # define srandom rpl_srandom
1874 : # endif
1875 : _GL_FUNCDECL_RPL (srandom, void, (unsigned int seed), );
1876 : _GL_CXXALIAS_RPL (srandom, void, (unsigned int seed));
1877 : # else
1878 : # if !1
1879 : _GL_FUNCDECL_SYS (srandom, void, (unsigned int seed), );
1880 : # endif
1881 : /* Need to cast, because on FreeBSD, the first parameter is
1882 : unsigned long seed. */
1883 : _GL_CXXALIAS_SYS_CAST (srandom, void, (unsigned int seed));
1884 : # endif
1885 : # if __GLIBC__ >= 2
1886 : _GL_CXXALIASWARN (srandom);
1887 : # endif
1888 : #elif defined GNULIB_POSIXCHECK
1889 : # undef srandom
1890 : # if HAVE_RAW_DECL_SRANDOM
1891 : _GL_WARN_ON_USE (srandom, "srandom is unportable - "
1892 : "use gnulib module random for portability");
1893 : # endif
1894 : #endif
1895 :
1896 : #if 0
1897 : # if 0
1898 : # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1899 : # undef initstate
1900 : # define initstate rpl_initstate
1901 : # endif
1902 : _GL_FUNCDECL_RPL (initstate, char *,
1903 : (unsigned int seed, char *buf, size_t buf_size),
1904 : _GL_ARG_NONNULL ((2)));
1905 : _GL_CXXALIAS_RPL (initstate, char *,
1906 : (unsigned int seed, char *buf, size_t buf_size));
1907 : # else
1908 : # if !1 || !1
1909 : _GL_FUNCDECL_SYS (initstate, char *,
1910 : (unsigned int seed, char *buf, size_t buf_size),
1911 : _GL_ARG_NONNULL ((2)));
1912 : # endif
1913 : /* Need to cast, because on FreeBSD, the first parameter is
1914 : unsigned long seed. */
1915 : _GL_CXXALIAS_SYS_CAST (initstate, char *,
1916 : (unsigned int seed, char *buf, size_t buf_size));
1917 : # endif
1918 : # if __GLIBC__ >= 2
1919 : _GL_CXXALIASWARN (initstate);
1920 : # endif
1921 : #elif defined GNULIB_POSIXCHECK
1922 : # undef initstate
1923 : # if HAVE_RAW_DECL_INITSTATE
1924 : _GL_WARN_ON_USE (initstate, "initstate is unportable - "
1925 : "use gnulib module random for portability");
1926 : # endif
1927 : #endif
1928 :
1929 : #if 0
1930 : # if 0
1931 : # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1932 : # undef setstate
1933 : # define setstate rpl_setstate
1934 : # endif
1935 : _GL_FUNCDECL_RPL (setstate, char *, (char *arg_state), _GL_ARG_NONNULL ((1)));
1936 : _GL_CXXALIAS_RPL (setstate, char *, (char *arg_state));
1937 : # else
1938 : # if !1 || !1
1939 : _GL_FUNCDECL_SYS (setstate, char *, (char *arg_state), _GL_ARG_NONNULL ((1)));
1940 : # endif
1941 : /* Need to cast, because on Mac OS X 10.13, HP-UX, Solaris the first parameter
1942 : is const char *arg_state. */
1943 : _GL_CXXALIAS_SYS_CAST (setstate, char *, (char *arg_state));
1944 : # endif
1945 : # if __GLIBC__ >= 2
1946 : _GL_CXXALIASWARN (setstate);
1947 : # endif
1948 : #elif defined GNULIB_POSIXCHECK
1949 : # undef setstate
1950 : # if HAVE_RAW_DECL_SETSTATE
1951 : _GL_WARN_ON_USE (setstate, "setstate is unportable - "
1952 : "use gnulib module random for portability");
1953 : # endif
1954 : #endif
1955 :
1956 :
1957 : #if 0
1958 : # if 0
1959 : # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1960 : # undef random_r
1961 : # define random_r rpl_random_r
1962 : # endif
1963 : _GL_FUNCDECL_RPL (random_r, int, (struct random_data *buf, int32_t *result),
1964 : _GL_ARG_NONNULL ((1, 2)));
1965 : _GL_CXXALIAS_RPL (random_r, int, (struct random_data *buf, int32_t *result));
1966 : # else
1967 : # if !1
1968 : _GL_FUNCDECL_SYS (random_r, int, (struct random_data *buf, int32_t *result),
1969 : _GL_ARG_NONNULL ((1, 2)));
1970 : # endif
1971 : _GL_CXXALIAS_SYS (random_r, int, (struct random_data *buf, int32_t *result));
1972 : # endif
1973 : _GL_CXXALIASWARN (random_r);
1974 : #elif defined GNULIB_POSIXCHECK
1975 : # undef random_r
1976 : # if HAVE_RAW_DECL_RANDOM_R
1977 : _GL_WARN_ON_USE (random_r, "random_r is unportable - "
1978 : "use gnulib module random_r for portability");
1979 : # endif
1980 : #endif
1981 :
1982 : #if 0
1983 : # if 0
1984 : # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1985 : # undef srandom_r
1986 : # define srandom_r rpl_srandom_r
1987 : # endif
1988 : _GL_FUNCDECL_RPL (srandom_r, int,
1989 : (unsigned int seed, struct random_data *rand_state),
1990 : _GL_ARG_NONNULL ((2)));
1991 : _GL_CXXALIAS_RPL (srandom_r, int,
1992 : (unsigned int seed, struct random_data *rand_state));
1993 : # else
1994 : # if !1
1995 : _GL_FUNCDECL_SYS (srandom_r, int,
1996 : (unsigned int seed, struct random_data *rand_state),
1997 : _GL_ARG_NONNULL ((2)));
1998 : # endif
1999 : _GL_CXXALIAS_SYS (srandom_r, int,
2000 : (unsigned int seed, struct random_data *rand_state));
2001 : # endif
2002 : _GL_CXXALIASWARN (srandom_r);
2003 : #elif defined GNULIB_POSIXCHECK
2004 : # undef srandom_r
2005 : # if HAVE_RAW_DECL_SRANDOM_R
2006 : _GL_WARN_ON_USE (srandom_r, "srandom_r is unportable - "
2007 : "use gnulib module random_r for portability");
2008 : # endif
2009 : #endif
2010 :
2011 : #if 0
2012 : # if 0
2013 : # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2014 : # undef initstate_r
2015 : # define initstate_r rpl_initstate_r
2016 : # endif
2017 : _GL_FUNCDECL_RPL (initstate_r, int,
2018 : (unsigned int seed, char *buf, size_t buf_size,
2019 : struct random_data *rand_state),
2020 : _GL_ARG_NONNULL ((2, 4)));
2021 : _GL_CXXALIAS_RPL (initstate_r, int,
2022 : (unsigned int seed, char *buf, size_t buf_size,
2023 : struct random_data *rand_state));
2024 : # else
2025 : # if !1
2026 : _GL_FUNCDECL_SYS (initstate_r, int,
2027 : (unsigned int seed, char *buf, size_t buf_size,
2028 : struct random_data *rand_state),
2029 : _GL_ARG_NONNULL ((2, 4)));
2030 : # endif
2031 : /* Need to cast, because on Haiku, the third parameter is
2032 : unsigned long buf_size. */
2033 : _GL_CXXALIAS_SYS_CAST (initstate_r, int,
2034 : (unsigned int seed, char *buf, size_t buf_size,
2035 : struct random_data *rand_state));
2036 : # endif
2037 : _GL_CXXALIASWARN (initstate_r);
2038 : #elif defined GNULIB_POSIXCHECK
2039 : # undef initstate_r
2040 : # if HAVE_RAW_DECL_INITSTATE_R
2041 : _GL_WARN_ON_USE (initstate_r, "initstate_r is unportable - "
2042 : "use gnulib module random_r for portability");
2043 : # endif
2044 : #endif
2045 :
2046 : #if 0
2047 : # if 0
2048 : # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2049 : # undef setstate_r
2050 : # define setstate_r rpl_setstate_r
2051 : # endif
2052 : _GL_FUNCDECL_RPL (setstate_r, int,
2053 : (char *arg_state, struct random_data *rand_state),
2054 : _GL_ARG_NONNULL ((1, 2)));
2055 : _GL_CXXALIAS_RPL (setstate_r, int,
2056 : (char *arg_state, struct random_data *rand_state));
2057 : # else
2058 : # if !1
2059 : _GL_FUNCDECL_SYS (setstate_r, int,
2060 : (char *arg_state, struct random_data *rand_state),
2061 : _GL_ARG_NONNULL ((1, 2)));
2062 : # endif
2063 : /* Need to cast, because on Haiku, the first parameter is
2064 : void *arg_state. */
2065 : _GL_CXXALIAS_SYS_CAST (setstate_r, int,
2066 : (char *arg_state, struct random_data *rand_state));
2067 : # endif
2068 : _GL_CXXALIASWARN (setstate_r);
2069 : #elif defined GNULIB_POSIXCHECK
2070 : # undef setstate_r
2071 : # if HAVE_RAW_DECL_SETSTATE_R
2072 : _GL_WARN_ON_USE (setstate_r, "setstate_r is unportable - "
2073 : "use gnulib module random_r for portability");
2074 : # endif
2075 : #endif
2076 :
2077 :
2078 : #if 0
2079 : # if 0
2080 : # if 0 == 2
2081 : # define _GL_INLINE_RPL_REALLOC 1
2082 : # ifdef __cplusplus
2083 : extern "C" {
2084 : # endif
2085 : _GL_REALLOC_INLINE void *
2086 : rpl_realloc (void *ptr, size_t size)
2087 : {
2088 : return realloc (ptr, size ? size : 1);
2089 : }
2090 : # ifdef __cplusplus
2091 : }
2092 : # endif
2093 : # endif
2094 : # if !((defined __cplusplus && defined GNULIB_NAMESPACE) \
2095 : || _GL_USE_STDLIB_ALLOC)
2096 : # undef realloc
2097 : # define realloc rpl_realloc
2098 : # endif
2099 : # if !defined _GL_INLINE_RPL_REALLOC
2100 : _GL_FUNCDECL_RPL (realloc, void *,
2101 : (void *ptr, size_t size),
2102 : _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_NODISCARD);
2103 : # endif
2104 : _GL_CXXALIAS_RPL (realloc, void *, (void *ptr, size_t size));
2105 : # else
2106 : # if __GNUC__ >= 11 && !defined __clang__
2107 : /* For -Wmismatched-dealloc: Associate realloc with free or rpl_free. */
2108 : # if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2
2109 : _GL_FUNCDECL_SYS (realloc, void *,
2110 : (void *ptr, size_t size),
2111 : _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_NODISCARD)
2112 : _GL_ATTRIBUTE_NOTHROW;
2113 : # else
2114 : _GL_FUNCDECL_SYS (realloc, void *,
2115 : (void *ptr, size_t size),
2116 : _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_NODISCARD);
2117 : # endif
2118 : # endif
2119 : _GL_CXXALIAS_SYS (realloc, void *, (void *ptr, size_t size));
2120 : # endif
2121 : # if __GLIBC__ >= 2
2122 : _GL_CXXALIASWARN (realloc);
2123 : # endif
2124 : #else
2125 : # if 1 \
2126 : && (__GNUC__ >= 11 && !defined __clang__) && !defined realloc
2127 : /* For -Wmismatched-dealloc: Associate realloc with free or rpl_free. */
2128 : # if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2
2129 : _GL_FUNCDECL_SYS (realloc, void *,
2130 : (void *ptr, size_t size),
2131 : _GL_ATTRIBUTE_DEALLOC_FREE)
2132 : _GL_ATTRIBUTE_NOTHROW;
2133 : # else
2134 : _GL_FUNCDECL_SYS (realloc, void *,
2135 : (void *ptr, size_t size),
2136 : _GL_ATTRIBUTE_DEALLOC_FREE);
2137 : # endif
2138 : # endif
2139 : # if defined GNULIB_POSIXCHECK && !_GL_USE_STDLIB_ALLOC
2140 : # undef realloc
2141 : /* Assume realloc is always declared. */
2142 : _GL_WARN_ON_USE (realloc, "realloc is not POSIX compliant everywhere - "
2143 : "use gnulib module realloc-posix for portability");
2144 : # endif
2145 : #endif
2146 :
2147 :
2148 : #if 0
2149 : # if 0
2150 : # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2151 : # undef reallocarray
2152 : # define reallocarray rpl_reallocarray
2153 : # endif
2154 : _GL_FUNCDECL_RPL (reallocarray, void *,
2155 : (void *ptr, size_t nmemb, size_t size),
2156 : _GL_ATTRIBUTE_NODISCARD);
2157 : _GL_CXXALIAS_RPL (reallocarray, void *,
2158 : (void *ptr, size_t nmemb, size_t size));
2159 : # else
2160 : # if ! 1
2161 : _GL_FUNCDECL_SYS (reallocarray, void *,
2162 : (void *ptr, size_t nmemb, size_t size),
2163 : _GL_ATTRIBUTE_NODISCARD);
2164 : # endif
2165 : _GL_CXXALIAS_SYS (reallocarray, void *,
2166 : (void *ptr, size_t nmemb, size_t size));
2167 : # endif
2168 : # if __GLIBC__ >= 2
2169 : _GL_CXXALIASWARN (reallocarray);
2170 : # endif
2171 : #elif defined GNULIB_POSIXCHECK
2172 : # undef reallocarray
2173 : # if HAVE_RAW_DECL_REALLOCARRAY
2174 : _GL_WARN_ON_USE (reallocarray, "reallocarray is not portable - "
2175 : "use gnulib module reallocarray for portability");
2176 : # endif
2177 : #endif
2178 :
2179 : #if 0
2180 : # if 0
2181 : # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2182 : # define realpath rpl_realpath
2183 : # endif
2184 : _GL_FUNCDECL_RPL (realpath, char *,
2185 : (const char *restrict name, char *restrict resolved),
2186 : _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
2187 : _GL_CXXALIAS_RPL (realpath, char *,
2188 : (const char *restrict name, char *restrict resolved));
2189 : # else
2190 : # if !1
2191 : _GL_FUNCDECL_SYS (realpath, char *,
2192 : (const char *restrict name, char *restrict resolved),
2193 : _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
2194 : # endif
2195 : _GL_CXXALIAS_SYS (realpath, char *,
2196 : (const char *restrict name, char *restrict resolved));
2197 : # endif
2198 : _GL_CXXALIASWARN (realpath);
2199 : #elif defined GNULIB_POSIXCHECK
2200 : # undef realpath
2201 : # if HAVE_RAW_DECL_REALPATH
2202 : _GL_WARN_ON_USE (realpath, "realpath is unportable - use gnulib module "
2203 : "canonicalize or canonicalize-lgpl for portability");
2204 : # endif
2205 : #endif
2206 :
2207 : #if 0
2208 : /* Test a user response to a question.
2209 : Return 1 if it is affirmative, 0 if it is negative, or -1 if not clear. */
2210 : # if !1
2211 : _GL_FUNCDECL_SYS (rpmatch, int, (const char *response),
2212 : _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
2213 : # endif
2214 : _GL_CXXALIAS_SYS (rpmatch, int, (const char *response));
2215 : _GL_CXXALIASWARN (rpmatch);
2216 : #elif defined GNULIB_POSIXCHECK
2217 : # undef rpmatch
2218 : # if HAVE_RAW_DECL_RPMATCH
2219 : _GL_WARN_ON_USE (rpmatch, "rpmatch is unportable - "
2220 : "use gnulib module rpmatch for portability");
2221 : # endif
2222 : #endif
2223 :
2224 : #if 0
2225 : /* Look up NAME in the environment, returning 0 in insecure situations. */
2226 : # if !1
2227 : _GL_FUNCDECL_SYS (secure_getenv, char *,
2228 : (char const *name),
2229 : _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
2230 : # endif
2231 : _GL_CXXALIAS_SYS (secure_getenv, char *, (char const *name));
2232 : _GL_CXXALIASWARN (secure_getenv);
2233 : #elif defined GNULIB_POSIXCHECK
2234 : # undef secure_getenv
2235 : # if HAVE_RAW_DECL_SECURE_GETENV
2236 : _GL_WARN_ON_USE (secure_getenv, "secure_getenv is unportable - "
2237 : "use gnulib module secure_getenv for portability");
2238 : # endif
2239 : #endif
2240 :
2241 : #if 0
2242 : /* Set NAME to VALUE in the environment.
2243 : If REPLACE is nonzero, overwrite an existing value. */
2244 : # if 0
2245 : # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2246 : # undef setenv
2247 : # define setenv rpl_setenv
2248 : # endif
2249 : _GL_FUNCDECL_RPL (setenv, int,
2250 : (const char *name, const char *value, int replace),
2251 : _GL_ARG_NONNULL ((1)));
2252 : _GL_CXXALIAS_RPL (setenv, int,
2253 : (const char *name, const char *value, int replace));
2254 : # else
2255 : # if !1
2256 : _GL_FUNCDECL_SYS (setenv, int,
2257 : (const char *name, const char *value, int replace),
2258 : _GL_ARG_NONNULL ((1)));
2259 : # endif
2260 : _GL_CXXALIAS_SYS (setenv, int,
2261 : (const char *name, const char *value, int replace));
2262 : # endif
2263 : # if !(0 && !1)
2264 : _GL_CXXALIASWARN (setenv);
2265 : # endif
2266 : #elif defined GNULIB_POSIXCHECK
2267 : # undef setenv
2268 : # if HAVE_RAW_DECL_SETENV
2269 : _GL_WARN_ON_USE (setenv, "setenv is unportable - "
2270 : "use gnulib module setenv for portability");
2271 : # endif
2272 : #endif
2273 :
2274 : #if 0
2275 : /* Prints a stack trace of the current thread to standard error,
2276 : if possible. */
2277 : # if 0
2278 : _GL_EXTERN_C void print_stack_trace (void);
2279 : # else
2280 : # if !GNULIB_defined_print_stack_trace
2281 : # define print_stack_trace() /* nothing */
2282 : # define GNULIB_defined_print_stack_trace 1
2283 : # endif
2284 : # endif
2285 : #endif
2286 :
2287 : #if 0
2288 : /* Parse a double from STRING, updating ENDP if appropriate. */
2289 : # if 0
2290 : # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2291 : # define strtod rpl_strtod
2292 : # endif
2293 : # define GNULIB_defined_strtod_function 1
2294 : _GL_FUNCDECL_RPL (strtod, double,
2295 : (const char *restrict str, char **restrict endp),
2296 : _GL_ARG_NONNULL ((1)));
2297 : _GL_CXXALIAS_RPL (strtod, double,
2298 : (const char *restrict str, char **restrict endp));
2299 : # else
2300 : # if !1
2301 : _GL_FUNCDECL_SYS (strtod, double,
2302 : (const char *restrict str, char **restrict endp),
2303 : _GL_ARG_NONNULL ((1)));
2304 : # endif
2305 : _GL_CXXALIAS_SYS (strtod, double,
2306 : (const char *restrict str, char **restrict endp));
2307 : # endif
2308 : # if __GLIBC__ >= 2
2309 : _GL_CXXALIASWARN (strtod);
2310 : # endif
2311 : #elif defined GNULIB_POSIXCHECK
2312 : # undef strtod
2313 : # if HAVE_RAW_DECL_STRTOD
2314 : _GL_WARN_ON_USE (strtod, "strtod is unportable - "
2315 : "use gnulib module strtod for portability");
2316 : # endif
2317 : #endif
2318 :
2319 : #if 0
2320 : /* Parse a float from STRING, updating ENDP if appropriate. */
2321 : # if 0
2322 : # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2323 : # define strtof rpl_strtof
2324 : # endif
2325 : # define GNULIB_defined_strtof_function 1
2326 : _GL_FUNCDECL_RPL (strtof, float,
2327 : (const char *restrict str, char **restrict endp),
2328 : _GL_ARG_NONNULL ((1)));
2329 : _GL_CXXALIAS_RPL (strtof, float,
2330 : (const char *restrict str, char **restrict endp));
2331 : # else
2332 : # if !1
2333 : _GL_FUNCDECL_SYS (strtof, float,
2334 : (const char *restrict str, char **restrict endp),
2335 : _GL_ARG_NONNULL ((1)));
2336 : # endif
2337 : _GL_CXXALIAS_SYS (strtof, float,
2338 : (const char *restrict str, char **restrict endp));
2339 : # endif
2340 : # if __GLIBC__ >= 2
2341 : _GL_CXXALIASWARN (strtof);
2342 : # endif
2343 : #elif defined GNULIB_POSIXCHECK
2344 : # undef strtof
2345 : # if HAVE_RAW_DECL_STRTOF
2346 : _GL_WARN_ON_USE (strtof, "strtof is unportable - "
2347 : "use gnulib module strtof for portability");
2348 : # endif
2349 : #endif
2350 :
2351 : #if 0
2352 : /* Parse a 'long double' from STRING, updating ENDP if appropriate. */
2353 : # if 0
2354 : # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2355 : # define strtold rpl_strtold
2356 : # endif
2357 : # define GNULIB_defined_strtold_function 1
2358 : _GL_FUNCDECL_RPL (strtold, long double,
2359 : (const char *restrict str, char **restrict endp),
2360 : _GL_ARG_NONNULL ((1)));
2361 : _GL_CXXALIAS_RPL (strtold, long double,
2362 : (const char *restrict str, char **restrict endp));
2363 : # else
2364 : # if !1
2365 : _GL_FUNCDECL_SYS (strtold, long double,
2366 : (const char *restrict str, char **restrict endp),
2367 : _GL_ARG_NONNULL ((1)));
2368 : # endif
2369 : _GL_CXXALIAS_SYS (strtold, long double,
2370 : (const char *restrict str, char **restrict endp));
2371 : # endif
2372 : _GL_CXXALIASWARN (strtold);
2373 : #elif defined GNULIB_POSIXCHECK
2374 : # undef strtold
2375 : # if HAVE_RAW_DECL_STRTOLD
2376 : _GL_WARN_ON_USE (strtold, "strtold is unportable - "
2377 : "use gnulib module strtold for portability");
2378 : # endif
2379 : #endif
2380 :
2381 : #if 0
2382 : /* Parse a signed integer whose textual representation starts at STRING.
2383 : The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0,
2384 : it may be decimal or octal (with prefix "0") or hexadecimal (with prefix
2385 : "0x").
2386 : If ENDPTR is not NULL, the address of the first byte after the integer is
2387 : stored in *ENDPTR.
2388 : Upon overflow, the return value is LONG_MAX or LONG_MIN, and errno is set
2389 : to ERANGE. */
2390 : # if 0
2391 : # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2392 : # define strtol rpl_strtol
2393 : # endif
2394 : # define GNULIB_defined_strtol_function 1
2395 : _GL_FUNCDECL_RPL (strtol, long,
2396 : (const char *restrict string, char **restrict endptr,
2397 : int base),
2398 : _GL_ARG_NONNULL ((1)));
2399 : _GL_CXXALIAS_RPL (strtol, long,
2400 : (const char *restrict string, char **restrict endptr,
2401 : int base));
2402 : # else
2403 : # if !1
2404 : _GL_FUNCDECL_SYS (strtol, long,
2405 : (const char *restrict string, char **restrict endptr,
2406 : int base),
2407 : _GL_ARG_NONNULL ((1)));
2408 : # endif
2409 : _GL_CXXALIAS_SYS (strtol, long,
2410 : (const char *restrict string, char **restrict endptr,
2411 : int base));
2412 : # endif
2413 : # if __GLIBC__ >= 2
2414 : _GL_CXXALIASWARN (strtol);
2415 : # endif
2416 : #elif defined GNULIB_POSIXCHECK
2417 : # undef strtol
2418 : # if HAVE_RAW_DECL_STRTOL
2419 : _GL_WARN_ON_USE (strtol, "strtol is unportable - "
2420 : "use gnulib module strtol for portability");
2421 : # endif
2422 : #endif
2423 :
2424 : #if 0
2425 : /* Parse a signed integer whose textual representation starts at STRING.
2426 : The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0,
2427 : it may be decimal or octal (with prefix "0") or hexadecimal (with prefix
2428 : "0x").
2429 : If ENDPTR is not NULL, the address of the first byte after the integer is
2430 : stored in *ENDPTR.
2431 : Upon overflow, the return value is LLONG_MAX or LLONG_MIN, and errno is set
2432 : to ERANGE. */
2433 : # if 0
2434 : # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2435 : # define strtoll rpl_strtoll
2436 : # endif
2437 : # define GNULIB_defined_strtoll_function 1
2438 : _GL_FUNCDECL_RPL (strtoll, long long,
2439 : (const char *restrict string, char **restrict endptr,
2440 : int base),
2441 : _GL_ARG_NONNULL ((1)));
2442 : _GL_CXXALIAS_RPL (strtoll, long long,
2443 : (const char *restrict string, char **restrict endptr,
2444 : int base));
2445 : # else
2446 : # if !1
2447 : _GL_FUNCDECL_SYS (strtoll, long long,
2448 : (const char *restrict string, char **restrict endptr,
2449 : int base),
2450 : _GL_ARG_NONNULL ((1)));
2451 : # endif
2452 : _GL_CXXALIAS_SYS (strtoll, long long,
2453 : (const char *restrict string, char **restrict endptr,
2454 : int base));
2455 : # endif
2456 : _GL_CXXALIASWARN (strtoll);
2457 : #elif defined GNULIB_POSIXCHECK
2458 : # undef strtoll
2459 : # if HAVE_RAW_DECL_STRTOLL
2460 : _GL_WARN_ON_USE (strtoll, "strtoll is unportable - "
2461 : "use gnulib module strtoll for portability");
2462 : # endif
2463 : #endif
2464 :
2465 : #if 0
2466 : /* Parse an unsigned integer whose textual representation starts at STRING.
2467 : The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0,
2468 : it may be decimal or octal (with prefix "0") or hexadecimal (with prefix
2469 : "0x").
2470 : If ENDPTR is not NULL, the address of the first byte after the integer is
2471 : stored in *ENDPTR.
2472 : Upon overflow, the return value is ULONG_MAX, and errno is set to ERANGE. */
2473 : # if 0
2474 : # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2475 : # define strtoul rpl_strtoul
2476 : # endif
2477 : # define GNULIB_defined_strtoul_function 1
2478 : _GL_FUNCDECL_RPL (strtoul, unsigned long,
2479 : (const char *restrict string, char **restrict endptr,
2480 : int base),
2481 : _GL_ARG_NONNULL ((1)));
2482 : _GL_CXXALIAS_RPL (strtoul, unsigned long,
2483 : (const char *restrict string, char **restrict endptr,
2484 : int base));
2485 : # else
2486 : # if !1
2487 : _GL_FUNCDECL_SYS (strtoul, unsigned long,
2488 : (const char *restrict string, char **restrict endptr,
2489 : int base),
2490 : _GL_ARG_NONNULL ((1)));
2491 : # endif
2492 : _GL_CXXALIAS_SYS (strtoul, unsigned long,
2493 : (const char *restrict string, char **restrict endptr,
2494 : int base));
2495 : # endif
2496 : # if __GLIBC__ >= 2
2497 : _GL_CXXALIASWARN (strtoul);
2498 : # endif
2499 : #elif defined GNULIB_POSIXCHECK
2500 : # undef strtoul
2501 : # if HAVE_RAW_DECL_STRTOUL
2502 : _GL_WARN_ON_USE (strtoul, "strtoul is unportable - "
2503 : "use gnulib module strtoul for portability");
2504 : # endif
2505 : #endif
2506 :
2507 : #if 0
2508 : /* Parse an unsigned integer whose textual representation starts at STRING.
2509 : The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0,
2510 : it may be decimal or octal (with prefix "0") or hexadecimal (with prefix
2511 : "0x").
2512 : If ENDPTR is not NULL, the address of the first byte after the integer is
2513 : stored in *ENDPTR.
2514 : Upon overflow, the return value is ULLONG_MAX, and errno is set to
2515 : ERANGE. */
2516 : # if 0
2517 : # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2518 : # define strtoull rpl_strtoull
2519 : # endif
2520 : # define GNULIB_defined_strtoull_function 1
2521 : _GL_FUNCDECL_RPL (strtoull, unsigned long long,
2522 : (const char *restrict string, char **restrict endptr,
2523 : int base),
2524 : _GL_ARG_NONNULL ((1)));
2525 : _GL_CXXALIAS_RPL (strtoull, unsigned long long,
2526 : (const char *restrict string, char **restrict endptr,
2527 : int base));
2528 : # else
2529 : # if !1
2530 : _GL_FUNCDECL_SYS (strtoull, unsigned long long,
2531 : (const char *restrict string, char **restrict endptr,
2532 : int base),
2533 : _GL_ARG_NONNULL ((1)));
2534 : # endif
2535 : _GL_CXXALIAS_SYS (strtoull, unsigned long long,
2536 : (const char *restrict string, char **restrict endptr,
2537 : int base));
2538 : # endif
2539 : _GL_CXXALIASWARN (strtoull);
2540 : #elif defined GNULIB_POSIXCHECK
2541 : # undef strtoull
2542 : # if HAVE_RAW_DECL_STRTOULL
2543 : _GL_WARN_ON_USE (strtoull, "strtoull is unportable - "
2544 : "use gnulib module strtoull for portability");
2545 : # endif
2546 : #endif
2547 :
2548 : #if 0
2549 : /* Unlock the slave side of the pseudo-terminal whose master side is specified
2550 : by FD, so that it can be opened. */
2551 : # if !1
2552 : _GL_FUNCDECL_SYS (unlockpt, int, (int fd), );
2553 : # endif
2554 : _GL_CXXALIAS_SYS (unlockpt, int, (int fd));
2555 : _GL_CXXALIASWARN (unlockpt);
2556 : #elif defined GNULIB_POSIXCHECK
2557 : # undef unlockpt
2558 : # if HAVE_RAW_DECL_UNLOCKPT
2559 : _GL_WARN_ON_USE (unlockpt, "unlockpt is not portable - "
2560 : "use gnulib module unlockpt for portability");
2561 : # endif
2562 : #endif
2563 :
2564 : #if 1
2565 : /* Remove the variable NAME from the environment. */
2566 : # if 0
2567 : # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2568 : # undef unsetenv
2569 : # define unsetenv rpl_unsetenv
2570 : # endif
2571 : _GL_FUNCDECL_RPL (unsetenv, int, (const char *name), _GL_ARG_NONNULL ((1)));
2572 : _GL_CXXALIAS_RPL (unsetenv, int, (const char *name));
2573 : # else
2574 : # if !1
2575 : _GL_FUNCDECL_SYS (unsetenv, int, (const char *name), _GL_ARG_NONNULL ((1)));
2576 : # endif
2577 : _GL_CXXALIAS_SYS (unsetenv, int, (const char *name));
2578 : # endif
2579 : # if !(0 && !1)
2580 : _GL_CXXALIASWARN (unsetenv);
2581 : # endif
2582 : #elif defined GNULIB_POSIXCHECK
2583 : # undef unsetenv
2584 : # if HAVE_RAW_DECL_UNSETENV
2585 : _GL_WARN_ON_USE (unsetenv, "unsetenv is unportable - "
2586 : "use gnulib module unsetenv for portability");
2587 : # endif
2588 : #endif
2589 :
2590 : /* Convert a wide character to a multibyte character. */
2591 : #if 0
2592 : # if 0
2593 : # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2594 : # undef wctomb
2595 : # define wctomb rpl_wctomb
2596 : # endif
2597 : _GL_FUNCDECL_RPL (wctomb, int, (char *s, wchar_t wc), );
2598 : _GL_CXXALIAS_RPL (wctomb, int, (char *s, wchar_t wc));
2599 : # else
2600 : _GL_CXXALIAS_SYS (wctomb, int, (char *s, wchar_t wc));
2601 : # endif
2602 : # if __GLIBC__ >= 2
2603 : _GL_CXXALIASWARN (wctomb);
2604 : # endif
2605 : #endif
2606 :
2607 :
2608 : _GL_INLINE_HEADER_END
2609 :
2610 : #endif /* _GL_STDLIB_H */
2611 : #endif /* _GL_STDLIB_H */
2612 : #endif
|