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