1 | /* DO NOT EDIT! GENERATED AUTOMATICALLY! */ |
2 | /* Copyright (C) 2006-2019 Free Software Foundation, Inc. |
3 | Written by Paul Eggert, Bruno Haible, Derek Price. |
4 | This file is part of gnulib. |
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 | /* |
20 | * ISO C 99 <inttypes.h> for platforms that lack it. |
21 | * <http://www.opengroup.org/susv3xbd/inttypes.h.html> |
22 | */ |
23 | |
24 | #if __GNUC__ >= 3 |
25 | #pragma GCC system_header |
26 | #endif |
27 | |
28 | |
29 | /* Include the original <inttypes.h> if it exists, and if this file |
30 | has not been included yet or if this file includes gnulib stdint.h |
31 | which in turn includes this file. |
32 | The include_next requires a split double-inclusion guard. */ |
33 | #if ! defined INTTYPES_H || defined _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H |
34 | # if 1 |
35 | |
36 | /* Some pre-C++11 <stdint.h> implementations need this. */ |
37 | # if defined __cplusplus && ! defined __STDC_FORMAT_MACROS |
38 | # define __STDC_FORMAT_MACROS 1 |
39 | # endif |
40 | |
41 | # include_next <inttypes.h> |
42 | # endif |
43 | #endif |
44 | |
45 | #if ! defined INTTYPES_H && ! defined _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H |
46 | #define INTTYPES_H |
47 | |
48 | /* Include <stdint.h> or the gnulib replacement. |
49 | But avoid namespace pollution on glibc systems. */ |
50 | #ifndef __GLIBC__ |
51 | # include <stdint.h> |
52 | #endif |
53 | /* Get CHAR_BIT. */ |
54 | #include <limits.h> |
55 | /* On mingw, __USE_MINGW_ANSI_STDIO only works if <stdio.h> is also included */ |
56 | #if defined _WIN32 && ! defined __CYGWIN__ |
57 | # include <stdio.h> |
58 | #endif |
59 | |
60 | #if !(INT_MIN == INT32_MIN && INT_MAX == INT32_MAX) |
61 | # error "This file assumes that 'int' has exactly 32 bits. Please report your platform and compiler to <bug-gnulib@gnu.org>." |
62 | #endif |
63 | |
64 | /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ |
65 | /* C++ compatible function declaration macros. |
66 | Copyright (C) 2010-2019 Free Software Foundation, Inc. |
67 | |
68 | This program is free software: you can redistribute it and/or modify it |
69 | under the terms of the GNU General Public License as published |
70 | by the Free Software Foundation; either version 3 of the License, or |
71 | (at your option) any later version. |
72 | |
73 | This program is distributed in the hope that it will be useful, |
74 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
75 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
76 | General Public License for more details. |
77 | |
78 | You should have received a copy of the GNU General Public License |
79 | along with this program. If not, see <https://www.gnu.org/licenses/>. */ |
80 | |
81 | #ifndef _GL_CXXDEFS_H |
82 | #define _GL_CXXDEFS_H |
83 | |
84 | /* Begin/end the GNULIB_NAMESPACE namespace. */ |
85 | #if defined __cplusplus && defined GNULIB_NAMESPACE |
86 | # define _GL_BEGIN_NAMESPACE namespace GNULIB_NAMESPACE { |
87 | # define _GL_END_NAMESPACE } |
88 | #else |
89 | # define _GL_BEGIN_NAMESPACE |
90 | # define _GL_END_NAMESPACE |
91 | #endif |
92 | |
93 | /* The three most frequent use cases of these macros are: |
94 | |
95 | * For providing a substitute for a function that is missing on some |
96 | platforms, but is declared and works fine on the platforms on which |
97 | it exists: |
98 | |
99 | #if @GNULIB_FOO@ |
100 | # if !@HAVE_FOO@ |
101 | _GL_FUNCDECL_SYS (foo, ...); |
102 | # endif |
103 | _GL_CXXALIAS_SYS (foo, ...); |
104 | _GL_CXXALIASWARN (foo); |
105 | #elif defined GNULIB_POSIXCHECK |
106 | ... |
107 | #endif |
108 | |
109 | * For providing a replacement for a function that exists on all platforms, |
110 | but is broken/insufficient and needs to be replaced on some platforms: |
111 | |
112 | #if @GNULIB_FOO@ |
113 | # if @REPLACE_FOO@ |
114 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
115 | # undef foo |
116 | # define foo rpl_foo |
117 | # endif |
118 | _GL_FUNCDECL_RPL (foo, ...); |
119 | _GL_CXXALIAS_RPL (foo, ...); |
120 | # else |
121 | _GL_CXXALIAS_SYS (foo, ...); |
122 | # endif |
123 | _GL_CXXALIASWARN (foo); |
124 | #elif defined GNULIB_POSIXCHECK |
125 | ... |
126 | #endif |
127 | |
128 | * For providing a replacement for a function that exists on some platforms |
129 | but is broken/insufficient and needs to be replaced on some of them and |
130 | is additionally either missing or undeclared on some other platforms: |
131 | |
132 | #if @GNULIB_FOO@ |
133 | # if @REPLACE_FOO@ |
134 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
135 | # undef foo |
136 | # define foo rpl_foo |
137 | # endif |
138 | _GL_FUNCDECL_RPL (foo, ...); |
139 | _GL_CXXALIAS_RPL (foo, ...); |
140 | # else |
141 | # if !@HAVE_FOO@ or if !@HAVE_DECL_FOO@ |
142 | _GL_FUNCDECL_SYS (foo, ...); |
143 | # endif |
144 | _GL_CXXALIAS_SYS (foo, ...); |
145 | # endif |
146 | _GL_CXXALIASWARN (foo); |
147 | #elif defined GNULIB_POSIXCHECK |
148 | ... |
149 | #endif |
150 | */ |
151 | |
152 | /* _GL_EXTERN_C declaration; |
153 | performs the declaration with C linkage. */ |
154 | #if defined __cplusplus |
155 | # define _GL_EXTERN_C extern "C" |
156 | #else |
157 | # define _GL_EXTERN_C extern |
158 | #endif |
159 | |
160 | /* _GL_FUNCDECL_RPL (func, rettype, parameters_and_attributes); |
161 | declares a replacement function, named rpl_func, with the given prototype, |
162 | consisting of return type, parameters, and attributes. |
163 | Example: |
164 | _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...) |
165 | _GL_ARG_NONNULL ((1))); |
166 | */ |
167 | #define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \ |
168 | _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes) |
169 | #define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \ |
170 | _GL_EXTERN_C rettype rpl_func parameters_and_attributes |
171 | |
172 | /* _GL_FUNCDECL_SYS (func, rettype, parameters_and_attributes); |
173 | declares the system function, named func, with the given prototype, |
174 | consisting of return type, parameters, and attributes. |
175 | Example: |
176 | _GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...) |
177 | _GL_ARG_NONNULL ((1))); |
178 | */ |
179 | #define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \ |
180 | _GL_EXTERN_C rettype func parameters_and_attributes |
181 | |
182 | /* _GL_CXXALIAS_RPL (func, rettype, parameters); |
183 | declares a C++ alias called GNULIB_NAMESPACE::func |
184 | that redirects to rpl_func, if GNULIB_NAMESPACE is defined. |
185 | Example: |
186 | _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...)); |
187 | |
188 | Wrapping rpl_func in an object with an inline conversion operator |
189 | avoids a reference to rpl_func unless GNULIB_NAMESPACE::func is |
190 | actually used in the program. */ |
191 | #define _GL_CXXALIAS_RPL(func,rettype,parameters) \ |
192 | _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters) |
193 | #if defined __cplusplus && defined GNULIB_NAMESPACE |
194 | # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \ |
195 | namespace GNULIB_NAMESPACE \ |
196 | { \ |
197 | static const struct _gl_ ## func ## _wrapper \ |
198 | { \ |
199 | typedef rettype (*type) parameters; \ |
200 | \ |
201 | inline operator type () const \ |
202 | { \ |
203 | return ::rpl_func; \ |
204 | } \ |
205 | } func = {}; \ |
206 | } \ |
207 | _GL_EXTERN_C int _gl_cxxalias_dummy |
208 | #else |
209 | # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \ |
210 | _GL_EXTERN_C int _gl_cxxalias_dummy |
211 | #endif |
212 | |
213 | /* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters); |
214 | is like _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters); |
215 | except that the C function rpl_func may have a slightly different |
216 | declaration. A cast is used to silence the "invalid conversion" error |
217 | that would otherwise occur. */ |
218 | #if defined __cplusplus && defined GNULIB_NAMESPACE |
219 | # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \ |
220 | namespace GNULIB_NAMESPACE \ |
221 | { \ |
222 | static const struct _gl_ ## func ## _wrapper \ |
223 | { \ |
224 | typedef rettype (*type) parameters; \ |
225 | \ |
226 | inline operator type () const \ |
227 | { \ |
228 | return reinterpret_cast<type>(::rpl_func); \ |
229 | } \ |
230 | } func = {}; \ |
231 | } \ |
232 | _GL_EXTERN_C int _gl_cxxalias_dummy |
233 | #else |
234 | # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \ |
235 | _GL_EXTERN_C int _gl_cxxalias_dummy |
236 | #endif |
237 | |
238 | /* _GL_CXXALIAS_SYS (func, rettype, parameters); |
239 | declares a C++ alias called GNULIB_NAMESPACE::func |
240 | that redirects to the system provided function func, if GNULIB_NAMESPACE |
241 | is defined. |
242 | Example: |
243 | _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...)); |
244 | |
245 | Wrapping func in an object with an inline conversion operator |
246 | avoids a reference to func unless GNULIB_NAMESPACE::func is |
247 | actually used in the program. */ |
248 | #if defined __cplusplus && defined GNULIB_NAMESPACE |
249 | # define _GL_CXXALIAS_SYS(func,rettype,parameters) \ |
250 | namespace GNULIB_NAMESPACE \ |
251 | { \ |
252 | static const struct _gl_ ## func ## _wrapper \ |
253 | { \ |
254 | typedef rettype (*type) parameters; \ |
255 | \ |
256 | inline operator type () const \ |
257 | { \ |
258 | return ::func; \ |
259 | } \ |
260 | } func = {}; \ |
261 | } \ |
262 | _GL_EXTERN_C int _gl_cxxalias_dummy |
263 | #else |
264 | # define _GL_CXXALIAS_SYS(func,rettype,parameters) \ |
265 | _GL_EXTERN_C int _gl_cxxalias_dummy |
266 | #endif |
267 | |
268 | /* _GL_CXXALIAS_SYS_CAST (func, rettype, parameters); |
269 | is like _GL_CXXALIAS_SYS (func, rettype, parameters); |
270 | except that the C function func may have a slightly different declaration. |
271 | A cast is used to silence the "invalid conversion" error that would |
272 | otherwise occur. */ |
273 | #if defined __cplusplus && defined GNULIB_NAMESPACE |
274 | # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \ |
275 | namespace GNULIB_NAMESPACE \ |
276 | { \ |
277 | static const struct _gl_ ## func ## _wrapper \ |
278 | { \ |
279 | typedef rettype (*type) parameters; \ |
280 | \ |
281 | inline operator type () const \ |
282 | { \ |
283 | return reinterpret_cast<type>(::func); \ |
284 | } \ |
285 | } func = {}; \ |
286 | } \ |
287 | _GL_EXTERN_C int _gl_cxxalias_dummy |
288 | #else |
289 | # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \ |
290 | _GL_EXTERN_C int _gl_cxxalias_dummy |
291 | #endif |
292 | |
293 | /* _GL_CXXALIAS_SYS_CAST2 (func, rettype, parameters, rettype2, parameters2); |
294 | is like _GL_CXXALIAS_SYS (func, rettype, parameters); |
295 | except that the C function is picked among a set of overloaded functions, |
296 | namely the one with rettype2 and parameters2. Two consecutive casts |
297 | are used to silence the "cannot find a match" and "invalid conversion" |
298 | errors that would otherwise occur. */ |
299 | #if defined __cplusplus && defined GNULIB_NAMESPACE |
300 | /* The outer cast must be a reinterpret_cast. |
301 | The inner cast: When the function is defined as a set of overloaded |
302 | functions, it works as a static_cast<>, choosing the designated variant. |
303 | When the function is defined as a single variant, it works as a |
304 | reinterpret_cast<>. The parenthesized cast syntax works both ways. */ |
305 | # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \ |
306 | namespace GNULIB_NAMESPACE \ |
307 | { \ |
308 | static const struct _gl_ ## func ## _wrapper \ |
309 | { \ |
310 | typedef rettype (*type) parameters; \ |
311 | \ |
312 | inline operator type () const \ |
313 | { \ |
314 | return reinterpret_cast<type>((rettype2 (*) parameters2)(::func)); \ |
315 | } \ |
316 | } func = {}; \ |
317 | } \ |
318 | _GL_EXTERN_C int _gl_cxxalias_dummy |
319 | #else |
320 | # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \ |
321 | _GL_EXTERN_C int _gl_cxxalias_dummy |
322 | #endif |
323 | |
324 | /* _GL_CXXALIASWARN (func); |
325 | causes a warning to be emitted when ::func is used but not when |
326 | GNULIB_NAMESPACE::func is used. func must be defined without overloaded |
327 | variants. */ |
328 | #if defined __cplusplus && defined GNULIB_NAMESPACE |
329 | # define _GL_CXXALIASWARN(func) \ |
330 | _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE) |
331 | # define _GL_CXXALIASWARN_1(func,namespace) \ |
332 | _GL_CXXALIASWARN_2 (func, namespace) |
333 | /* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>, |
334 | we enable the warning only when not optimizing. */ |
335 | # if !__OPTIMIZE__ |
336 | # define _GL_CXXALIASWARN_2(func,namespace) \ |
337 | _GL_WARN_ON_USE (func, \ |
338 | "The symbol ::" #func " refers to the system function. " \ |
339 | "Use " #namespace "::" #func " instead.") |
340 | # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING |
341 | # define _GL_CXXALIASWARN_2(func,namespace) \ |
342 | extern __typeof__ (func) func |
343 | # else |
344 | # define _GL_CXXALIASWARN_2(func,namespace) \ |
345 | _GL_EXTERN_C int _gl_cxxalias_dummy |
346 | # endif |
347 | #else |
348 | # define _GL_CXXALIASWARN(func) \ |
349 | _GL_EXTERN_C int _gl_cxxalias_dummy |
350 | #endif |
351 | |
352 | /* _GL_CXXALIASWARN1 (func, rettype, parameters_and_attributes); |
353 | causes a warning to be emitted when the given overloaded variant of ::func |
354 | is used but not when GNULIB_NAMESPACE::func is used. */ |
355 | #if defined __cplusplus && defined GNULIB_NAMESPACE |
356 | # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \ |
357 | _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \ |
358 | GNULIB_NAMESPACE) |
359 | # define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \ |
360 | _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace) |
361 | /* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>, |
362 | we enable the warning only when not optimizing. */ |
363 | # if !__OPTIMIZE__ |
364 | # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ |
365 | _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \ |
366 | "The symbol ::" #func " refers to the system function. " \ |
367 | "Use " #namespace "::" #func " instead.") |
368 | # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING |
369 | # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ |
370 | extern __typeof__ (func) func |
371 | # else |
372 | # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ |
373 | _GL_EXTERN_C int _gl_cxxalias_dummy |
374 | # endif |
375 | #else |
376 | # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \ |
377 | _GL_EXTERN_C int _gl_cxxalias_dummy |
378 | #endif |
379 | |
380 | #endif /* _GL_CXXDEFS_H */ |
381 | |
382 | /* The definition of _GL_ARG_NONNULL is copied here. */ |
383 | /* A C macro for declaring that specific arguments must not be NULL. |
384 | Copyright (C) 2009-2019 Free Software Foundation, Inc. |
385 | |
386 | This program is free software: you can redistribute it and/or modify it |
387 | under the terms of the GNU General Public License as published |
388 | by the Free Software Foundation; either version 3 of the License, or |
389 | (at your option) any later version. |
390 | |
391 | This program is distributed in the hope that it will be useful, |
392 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
393 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
394 | General Public License for more details. |
395 | |
396 | You should have received a copy of the GNU General Public License |
397 | along with this program. If not, see <https://www.gnu.org/licenses/>. */ |
398 | |
399 | /* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools |
400 | that the values passed as arguments n, ..., m must be non-NULL pointers. |
401 | n = 1 stands for the first argument, n = 2 for the second argument etc. */ |
402 | #ifndef _GL_ARG_NONNULL |
403 | # if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3 |
404 | # define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params)) |
405 | # else |
406 | # define _GL_ARG_NONNULL(params) |
407 | # endif |
408 | #endif |
409 | |
410 | /* The definition of _GL_WARN_ON_USE is copied here. */ |
411 | /* A C macro for emitting warnings if a function is used. |
412 | Copyright (C) 2010-2019 Free Software Foundation, Inc. |
413 | |
414 | This program is free software: you can redistribute it and/or modify it |
415 | under the terms of the GNU General Public License as published |
416 | by the Free Software Foundation; either version 3 of the License, or |
417 | (at your option) any later version. |
418 | |
419 | This program is distributed in the hope that it will be useful, |
420 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
421 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
422 | General Public License for more details. |
423 | |
424 | You should have received a copy of the GNU General Public License |
425 | along with this program. If not, see <https://www.gnu.org/licenses/>. */ |
426 | |
427 | /* _GL_WARN_ON_USE (function, "literal string") issues a declaration |
428 | for FUNCTION which will then trigger a compiler warning containing |
429 | the text of "literal string" anywhere that function is called, if |
430 | supported by the compiler. If the compiler does not support this |
431 | feature, the macro expands to an unused extern declaration. |
432 | |
433 | _GL_WARN_ON_USE_ATTRIBUTE ("literal string") expands to the |
434 | attribute used in _GL_WARN_ON_USE. If the compiler does not support |
435 | this feature, it expands to empty. |
436 | |
437 | These macros are useful for marking a function as a potential |
438 | portability trap, with the intent that "literal string" include |
439 | instructions on the replacement function that should be used |
440 | instead. |
441 | _GL_WARN_ON_USE is for functions with 'extern' linkage. |
442 | _GL_WARN_ON_USE_ATTRIBUTE is for functions with 'static' or 'inline' |
443 | linkage. |
444 | |
445 | However, one of the reasons that a function is a portability trap is |
446 | if it has the wrong signature. Declaring FUNCTION with a different |
447 | signature in C is a compilation error, so this macro must use the |
448 | same type as any existing declaration so that programs that avoid |
449 | the problematic FUNCTION do not fail to compile merely because they |
450 | included a header that poisoned the function. But this implies that |
451 | _GL_WARN_ON_USE is only safe to use if FUNCTION is known to already |
452 | have a declaration. Use of this macro implies that there must not |
453 | be any other macro hiding the declaration of FUNCTION; but |
454 | undefining FUNCTION first is part of the poisoning process anyway |
455 | (although for symbols that are provided only via a macro, the result |
456 | is a compilation error rather than a warning containing |
457 | "literal string"). Also note that in C++, it is only safe to use if |
458 | FUNCTION has no overloads. |
459 | |
460 | For an example, it is possible to poison 'getline' by: |
461 | - adding a call to gl_WARN_ON_USE_PREPARE([[#include <stdio.h>]], |
462 | [getline]) in configure.ac, which potentially defines |
463 | HAVE_RAW_DECL_GETLINE |
464 | - adding this code to a header that wraps the system <stdio.h>: |
465 | #undef getline |
466 | #if HAVE_RAW_DECL_GETLINE |
467 | _GL_WARN_ON_USE (getline, "getline is required by POSIX 2008, but" |
468 | "not universally present; use the gnulib module getline"); |
469 | #endif |
470 | |
471 | It is not possible to directly poison global variables. But it is |
472 | possible to write a wrapper accessor function, and poison that |
473 | (less common usage, like &environ, will cause a compilation error |
474 | rather than issue the nice warning, but the end result of informing |
475 | the developer about their portability problem is still achieved): |
476 | #if HAVE_RAW_DECL_ENVIRON |
477 | static char *** |
478 | rpl_environ (void) { return &environ; } |
479 | _GL_WARN_ON_USE (rpl_environ, "environ is not always properly declared"); |
480 | # undef environ |
481 | # define environ (*rpl_environ ()) |
482 | #endif |
483 | or better (avoiding contradictory use of 'static' and 'extern'): |
484 | #if HAVE_RAW_DECL_ENVIRON |
485 | static char *** |
486 | _GL_WARN_ON_USE_ATTRIBUTE ("environ is not always properly declared") |
487 | rpl_environ (void) { return &environ; } |
488 | # undef environ |
489 | # define environ (*rpl_environ ()) |
490 | #endif |
491 | */ |
492 | #ifndef _GL_WARN_ON_USE |
493 | |
494 | # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) |
495 | /* A compiler attribute is available in gcc versions 4.3.0 and later. */ |
496 | # define _GL_WARN_ON_USE(function, message) \ |
497 | extern __typeof__ (function) function __attribute__ ((__warning__ (message))) |
498 | # define _GL_WARN_ON_USE_ATTRIBUTE(message) \ |
499 | __attribute__ ((__warning__ (message))) |
500 | # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING |
501 | /* Verify the existence of the function. */ |
502 | # define _GL_WARN_ON_USE(function, message) \ |
503 | extern __typeof__ (function) function |
504 | # define _GL_WARN_ON_USE_ATTRIBUTE(message) |
505 | # else /* Unsupported. */ |
506 | # define _GL_WARN_ON_USE(function, message) \ |
507 | _GL_WARN_EXTERN_C int _gl_warn_on_use |
508 | # define _GL_WARN_ON_USE_ATTRIBUTE(message) |
509 | # endif |
510 | #endif |
511 | |
512 | /* _GL_WARN_ON_USE_CXX (function, rettype, parameters_and_attributes, "string") |
513 | is like _GL_WARN_ON_USE (function, "string"), except that the function is |
514 | declared with the given prototype, consisting of return type, parameters, |
515 | and attributes. |
516 | This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does |
517 | not work in this case. */ |
518 | #ifndef _GL_WARN_ON_USE_CXX |
519 | # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) |
520 | # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ |
521 | extern rettype function parameters_and_attributes \ |
522 | __attribute__ ((__warning__ (msg))) |
523 | # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING |
524 | /* Verify the existence of the function. */ |
525 | # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ |
526 | extern rettype function parameters_and_attributes |
527 | # else /* Unsupported. */ |
528 | # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ |
529 | _GL_WARN_EXTERN_C int _gl_warn_on_use |
530 | # endif |
531 | #endif |
532 | |
533 | /* _GL_WARN_EXTERN_C declaration; |
534 | performs the declaration with C linkage. */ |
535 | #ifndef _GL_WARN_EXTERN_C |
536 | # if defined __cplusplus |
537 | # define _GL_WARN_EXTERN_C extern "C" |
538 | # else |
539 | # define _GL_WARN_EXTERN_C extern |
540 | # endif |
541 | #endif |
542 | |
543 | /* 7.8.1 Macros for format specifiers */ |
544 | |
545 | #if defined _TNS_R_TARGET |
546 | /* Tandem NonStop R series and compatible platforms released before |
547 | July 2005 support %Ld but not %lld. */ |
548 | # define _LONG_LONG_FORMAT_PREFIX "L" |
549 | #else |
550 | # define _LONG_LONG_FORMAT_PREFIX "ll" |
551 | #endif |
552 | |
553 | #if !defined PRId8 || 0 |
554 | # undef PRId8 |
555 | # ifdef INT8_MAX |
556 | # define PRId8 "d" |
557 | # endif |
558 | #endif |
559 | #if !defined PRIi8 || 0 |
560 | # undef PRIi8 |
561 | # ifdef INT8_MAX |
562 | # define PRIi8 "i" |
563 | # endif |
564 | #endif |
565 | #if !defined PRIo8 || 0 |
566 | # undef PRIo8 |
567 | # ifdef UINT8_MAX |
568 | # define PRIo8 "o" |
569 | # endif |
570 | #endif |
571 | #if !defined PRIu8 || 0 |
572 | # undef PRIu8 |
573 | # ifdef UINT8_MAX |
574 | # define PRIu8 "u" |
575 | # endif |
576 | #endif |
577 | #if !defined PRIx8 || 0 |
578 | # undef PRIx8 |
579 | # ifdef UINT8_MAX |
580 | # define PRIx8 "x" |
581 | # endif |
582 | #endif |
583 | #if !defined PRIX8 || 0 |
584 | # undef PRIX8 |
585 | # ifdef UINT8_MAX |
586 | # define PRIX8 "X" |
587 | # endif |
588 | #endif |
589 | #if !defined PRId16 || 0 |
590 | # undef PRId16 |
591 | # ifdef INT16_MAX |
592 | # define PRId16 "d" |
593 | # endif |
594 | #endif |
595 | #if !defined PRIi16 || 0 |
596 | # undef PRIi16 |
597 | # ifdef INT16_MAX |
598 | # define PRIi16 "i" |
599 | # endif |
600 | #endif |
601 | #if !defined PRIo16 || 0 |
602 | # undef PRIo16 |
603 | # ifdef UINT16_MAX |
604 | # define PRIo16 "o" |
605 | # endif |
606 | #endif |
607 | #if !defined PRIu16 || 0 |
608 | # undef PRIu16 |
609 | # ifdef UINT16_MAX |
610 | # define PRIu16 "u" |
611 | # endif |
612 | #endif |
613 | #if !defined PRIx16 || 0 |
614 | # undef PRIx16 |
615 | # ifdef UINT16_MAX |
616 | # define PRIx16 "x" |
617 | # endif |
618 | #endif |
619 | #if !defined PRIX16 || 0 |
620 | # undef PRIX16 |
621 | # ifdef UINT16_MAX |
622 | # define PRIX16 "X" |
623 | # endif |
624 | #endif |
625 | #if !defined PRId32 || 0 |
626 | # undef PRId32 |
627 | # ifdef INT32_MAX |
628 | # define PRId32 "d" |
629 | # endif |
630 | #endif |
631 | #if !defined PRIi32 || 0 |
632 | # undef PRIi32 |
633 | # ifdef INT32_MAX |
634 | # define PRIi32 "i" |
635 | # endif |
636 | #endif |
637 | #if !defined PRIo32 || 0 |
638 | # undef PRIo32 |
639 | # ifdef UINT32_MAX |
640 | # define PRIo32 "o" |
641 | # endif |
642 | #endif |
643 | #if !defined PRIu32 || 0 |
644 | # undef PRIu32 |
645 | # ifdef UINT32_MAX |
646 | # define PRIu32 "u" |
647 | # endif |
648 | #endif |
649 | #if !defined PRIx32 || 0 |
650 | # undef PRIx32 |
651 | # ifdef UINT32_MAX |
652 | # define PRIx32 "x" |
653 | # endif |
654 | #endif |
655 | #if !defined PRIX32 || 0 |
656 | # undef PRIX32 |
657 | # ifdef UINT32_MAX |
658 | # define PRIX32 "X" |
659 | # endif |
660 | #endif |
661 | #ifdef INT64_MAX |
662 | # if (0 ? defined _LP64 : 1) |
663 | # define _PRI64_PREFIX "l" |
664 | # elif defined _MSC_VER || defined __MINGW32__ |
665 | # define _PRI64_PREFIX "I64" |
666 | # elif 1 && LONG_MAX >> 30 == 1 |
667 | # define _PRI64_PREFIX _LONG_LONG_FORMAT_PREFIX |
668 | # endif |
669 | # if !defined PRId64 || 0 |
670 | # undef PRId64 |
671 | # define PRId64 _PRI64_PREFIX "d" |
672 | # endif |
673 | # if !defined PRIi64 || 0 |
674 | # undef PRIi64 |
675 | # define PRIi64 _PRI64_PREFIX "i" |
676 | # endif |
677 | #endif |
678 | #ifdef UINT64_MAX |
679 | # if (0 ? defined _LP64 : 1) |
680 | # define _PRIu64_PREFIX "l" |
681 | # elif defined _MSC_VER || defined __MINGW32__ |
682 | # define _PRIu64_PREFIX "I64" |
683 | # elif 1 && ULONG_MAX >> 31 == 1 |
684 | # define _PRIu64_PREFIX _LONG_LONG_FORMAT_PREFIX |
685 | # endif |
686 | # if !defined PRIo64 || 0 |
687 | # undef PRIo64 |
688 | # define PRIo64 _PRIu64_PREFIX "o" |
689 | # endif |
690 | # if !defined PRIu64 || 0 |
691 | # undef PRIu64 |
692 | # define PRIu64 _PRIu64_PREFIX "u" |
693 | # endif |
694 | # if !defined PRIx64 || 0 |
695 | # undef PRIx64 |
696 | # define PRIx64 _PRIu64_PREFIX "x" |
697 | # endif |
698 | # if !defined PRIX64 || 0 |
699 | # undef PRIX64 |
700 | # define PRIX64 _PRIu64_PREFIX "X" |
701 | # endif |
702 | #endif |
703 | |
704 | #if !defined PRIdLEAST8 || 0 |
705 | # undef PRIdLEAST8 |
706 | # define PRIdLEAST8 "d" |
707 | #endif |
708 | #if !defined PRIiLEAST8 || 0 |
709 | # undef PRIiLEAST8 |
710 | # define PRIiLEAST8 "i" |
711 | #endif |
712 | #if !defined PRIoLEAST8 || 0 |
713 | # undef PRIoLEAST8 |
714 | # define PRIoLEAST8 "o" |
715 | #endif |
716 | #if !defined PRIuLEAST8 || 0 |
717 | # undef PRIuLEAST8 |
718 | # define PRIuLEAST8 "u" |
719 | #endif |
720 | #if !defined PRIxLEAST8 || 0 |
721 | # undef PRIxLEAST8 |
722 | # define PRIxLEAST8 "x" |
723 | #endif |
724 | #if !defined PRIXLEAST8 || 0 |
725 | # undef PRIXLEAST8 |
726 | # define PRIXLEAST8 "X" |
727 | #endif |
728 | #if !defined PRIdLEAST16 || 0 |
729 | # undef PRIdLEAST16 |
730 | # define PRIdLEAST16 "d" |
731 | #endif |
732 | #if !defined PRIiLEAST16 || 0 |
733 | # undef PRIiLEAST16 |
734 | # define PRIiLEAST16 "i" |
735 | #endif |
736 | #if !defined PRIoLEAST16 || 0 |
737 | # undef PRIoLEAST16 |
738 | # define PRIoLEAST16 "o" |
739 | #endif |
740 | #if !defined PRIuLEAST16 || 0 |
741 | # undef PRIuLEAST16 |
742 | # define PRIuLEAST16 "u" |
743 | #endif |
744 | #if !defined PRIxLEAST16 || 0 |
745 | # undef PRIxLEAST16 |
746 | # define PRIxLEAST16 "x" |
747 | #endif |
748 | #if !defined PRIXLEAST16 || 0 |
749 | # undef PRIXLEAST16 |
750 | # define PRIXLEAST16 "X" |
751 | #endif |
752 | #if !defined PRIdLEAST32 || 0 |
753 | # undef PRIdLEAST32 |
754 | # define PRIdLEAST32 "d" |
755 | #endif |
756 | #if !defined PRIiLEAST32 || 0 |
757 | # undef PRIiLEAST32 |
758 | # define PRIiLEAST32 "i" |
759 | #endif |
760 | #if !defined PRIoLEAST32 || 0 |
761 | # undef PRIoLEAST32 |
762 | # define PRIoLEAST32 "o" |
763 | #endif |
764 | #if !defined PRIuLEAST32 || 0 |
765 | # undef PRIuLEAST32 |
766 | # define PRIuLEAST32 "u" |
767 | #endif |
768 | #if !defined PRIxLEAST32 || 0 |
769 | # undef PRIxLEAST32 |
770 | # define PRIxLEAST32 "x" |
771 | #endif |
772 | #if !defined PRIXLEAST32 || 0 |
773 | # undef PRIXLEAST32 |
774 | # define PRIXLEAST32 "X" |
775 | #endif |
776 | #ifdef INT64_MAX |
777 | # if !defined PRIdLEAST64 || 0 |
778 | # undef PRIdLEAST64 |
779 | # define PRIdLEAST64 PRId64 |
780 | # endif |
781 | # if !defined PRIiLEAST64 || 0 |
782 | # undef PRIiLEAST64 |
783 | # define PRIiLEAST64 PRIi64 |
784 | # endif |
785 | #endif |
786 | #ifdef UINT64_MAX |
787 | # if !defined PRIoLEAST64 || 0 |
788 | # undef PRIoLEAST64 |
789 | # define PRIoLEAST64 PRIo64 |
790 | # endif |
791 | # if !defined PRIuLEAST64 || 0 |
792 | # undef PRIuLEAST64 |
793 | # define PRIuLEAST64 PRIu64 |
794 | # endif |
795 | # if !defined PRIxLEAST64 || 0 |
796 | # undef PRIxLEAST64 |
797 | # define PRIxLEAST64 PRIx64 |
798 | # endif |
799 | # if !defined PRIXLEAST64 || 0 |
800 | # undef PRIXLEAST64 |
801 | # define PRIXLEAST64 PRIX64 |
802 | # endif |
803 | #endif |
804 | |
805 | #if !defined PRIdFAST8 || 0 |
806 | # undef PRIdFAST8 |
807 | # if INT_FAST8_MAX > INT32_MAX |
808 | # define PRIdFAST8 PRId64 |
809 | # else |
810 | # define PRIdFAST8 "d" |
811 | # endif |
812 | #endif |
813 | #if !defined PRIiFAST8 || 0 |
814 | # undef PRIiFAST8 |
815 | # if INT_FAST8_MAX > INT32_MAX |
816 | # define PRIiFAST8 PRIi64 |
817 | # else |
818 | # define PRIiFAST8 "i" |
819 | # endif |
820 | #endif |
821 | #if !defined PRIoFAST8 || 0 |
822 | # undef PRIoFAST8 |
823 | # if UINT_FAST8_MAX > UINT32_MAX |
824 | # define PRIoFAST8 PRIo64 |
825 | # else |
826 | # define PRIoFAST8 "o" |
827 | # endif |
828 | #endif |
829 | #if !defined PRIuFAST8 || 0 |
830 | # undef PRIuFAST8 |
831 | # if UINT_FAST8_MAX > UINT32_MAX |
832 | # define PRIuFAST8 PRIu64 |
833 | # else |
834 | # define PRIuFAST8 "u" |
835 | # endif |
836 | #endif |
837 | #if !defined PRIxFAST8 || 0 |
838 | # undef PRIxFAST8 |
839 | # if UINT_FAST8_MAX > UINT32_MAX |
840 | # define PRIxFAST8 PRIx64 |
841 | # else |
842 | # define PRIxFAST8 "x" |
843 | # endif |
844 | #endif |
845 | #if !defined PRIXFAST8 || 0 |
846 | # undef PRIXFAST8 |
847 | # if UINT_FAST8_MAX > UINT32_MAX |
848 | # define PRIXFAST8 PRIX64 |
849 | # else |
850 | # define PRIXFAST8 "X" |
851 | # endif |
852 | #endif |
853 | #if !defined PRIdFAST16 || 0 |
854 | # undef PRIdFAST16 |
855 | # if INT_FAST16_MAX > INT32_MAX |
856 | # define PRIdFAST16 PRId64 |
857 | # else |
858 | # define PRIdFAST16 "d" |
859 | # endif |
860 | #endif |
861 | #if !defined PRIiFAST16 || 0 |
862 | # undef PRIiFAST16 |
863 | # if INT_FAST16_MAX > INT32_MAX |
864 | # define PRIiFAST16 PRIi64 |
865 | # else |
866 | # define PRIiFAST16 "i" |
867 | # endif |
868 | #endif |
869 | #if !defined PRIoFAST16 || 0 |
870 | # undef PRIoFAST16 |
871 | # if UINT_FAST16_MAX > UINT32_MAX |
872 | # define PRIoFAST16 PRIo64 |
873 | # else |
874 | # define PRIoFAST16 "o" |
875 | # endif |
876 | #endif |
877 | #if !defined PRIuFAST16 || 0 |
878 | # undef PRIuFAST16 |
879 | # if UINT_FAST16_MAX > UINT32_MAX |
880 | # define PRIuFAST16 PRIu64 |
881 | # else |
882 | # define PRIuFAST16 "u" |
883 | # endif |
884 | #endif |
885 | #if !defined PRIxFAST16 || 0 |
886 | # undef PRIxFAST16 |
887 | # if UINT_FAST16_MAX > UINT32_MAX |
888 | # define PRIxFAST16 PRIx64 |
889 | # else |
890 | # define PRIxFAST16 "x" |
891 | # endif |
892 | #endif |
893 | #if !defined PRIXFAST16 || 0 |
894 | # undef PRIXFAST16 |
895 | # if UINT_FAST16_MAX > UINT32_MAX |
896 | # define PRIXFAST16 PRIX64 |
897 | # else |
898 | # define PRIXFAST16 "X" |
899 | # endif |
900 | #endif |
901 | #if !defined PRIdFAST32 || 0 |
902 | # undef PRIdFAST32 |
903 | # if INT_FAST32_MAX > INT32_MAX |
904 | # define PRIdFAST32 PRId64 |
905 | # else |
906 | # define PRIdFAST32 "d" |
907 | # endif |
908 | #endif |
909 | #if !defined PRIiFAST32 || 0 |
910 | # undef PRIiFAST32 |
911 | # if INT_FAST32_MAX > INT32_MAX |
912 | # define PRIiFAST32 PRIi64 |
913 | # else |
914 | # define PRIiFAST32 "i" |
915 | # endif |
916 | #endif |
917 | #if !defined PRIoFAST32 || 0 |
918 | # undef PRIoFAST32 |
919 | # if UINT_FAST32_MAX > UINT32_MAX |
920 | # define PRIoFAST32 PRIo64 |
921 | # else |
922 | # define PRIoFAST32 "o" |
923 | # endif |
924 | #endif |
925 | #if !defined PRIuFAST32 || 0 |
926 | # undef PRIuFAST32 |
927 | # if UINT_FAST32_MAX > UINT32_MAX |
928 | # define PRIuFAST32 PRIu64 |
929 | # else |
930 | # define PRIuFAST32 "u" |
931 | # endif |
932 | #endif |
933 | #if !defined PRIxFAST32 || 0 |
934 | # undef PRIxFAST32 |
935 | # if UINT_FAST32_MAX > UINT32_MAX |
936 | # define PRIxFAST32 PRIx64 |
937 | # else |
938 | # define PRIxFAST32 "x" |
939 | # endif |
940 | #endif |
941 | #if !defined PRIXFAST32 || 0 |
942 | # undef PRIXFAST32 |
943 | # if UINT_FAST32_MAX > UINT32_MAX |
944 | # define PRIXFAST32 PRIX64 |
945 | # else |
946 | # define PRIXFAST32 "X" |
947 | # endif |
948 | #endif |
949 | #ifdef INT64_MAX |
950 | # if !defined PRIdFAST64 || 0 |
951 | # undef PRIdFAST64 |
952 | # define PRIdFAST64 PRId64 |
953 | # endif |
954 | # if !defined PRIiFAST64 || 0 |
955 | # undef PRIiFAST64 |
956 | # define PRIiFAST64 PRIi64 |
957 | # endif |
958 | #endif |
959 | #ifdef UINT64_MAX |
960 | # if !defined PRIoFAST64 || 0 |
961 | # undef PRIoFAST64 |
962 | # define PRIoFAST64 PRIo64 |
963 | # endif |
964 | # if !defined PRIuFAST64 || 0 |
965 | # undef PRIuFAST64 |
966 | # define PRIuFAST64 PRIu64 |
967 | # endif |
968 | # if !defined PRIxFAST64 || 0 |
969 | # undef PRIxFAST64 |
970 | # define PRIxFAST64 PRIx64 |
971 | # endif |
972 | # if !defined PRIXFAST64 || 0 |
973 | # undef PRIXFAST64 |
974 | # define PRIXFAST64 PRIX64 |
975 | # endif |
976 | #endif |
977 | |
978 | #if !defined PRIdMAX || 0 |
979 | # undef PRIdMAX |
980 | # if 1 |
981 | # define PRIdMAX PRId64 |
982 | # else |
983 | # define PRIdMAX "ld" |
984 | # endif |
985 | #endif |
986 | #if !defined PRIiMAX || 0 |
987 | # undef PRIiMAX |
988 | # if 1 |
989 | # define PRIiMAX PRIi64 |
990 | # else |
991 | # define PRIiMAX "li" |
992 | # endif |
993 | #endif |
994 | #if !defined PRIoMAX || 0 |
995 | # undef PRIoMAX |
996 | # if 1 |
997 | # define PRIoMAX PRIo64 |
998 | # else |
999 | # define PRIoMAX "lo" |
1000 | # endif |
1001 | #endif |
1002 | #if !defined PRIuMAX || 0 |
1003 | # undef PRIuMAX |
1004 | # if 1 |
1005 | # define PRIuMAX PRIu64 |
1006 | # else |
1007 | # define PRIuMAX "lu" |
1008 | # endif |
1009 | #endif |
1010 | #if !defined PRIxMAX || 0 |
1011 | # undef PRIxMAX |
1012 | # if 1 |
1013 | # define PRIxMAX PRIx64 |
1014 | # else |
1015 | # define PRIxMAX "lx" |
1016 | # endif |
1017 | #endif |
1018 | #if !defined PRIXMAX || 0 |
1019 | # undef PRIXMAX |
1020 | # if 1 |
1021 | # define PRIXMAX PRIX64 |
1022 | # else |
1023 | # define PRIXMAX "lX" |
1024 | # endif |
1025 | #endif |
1026 | |
1027 | #if !defined PRIdPTR || 0 |
1028 | # undef PRIdPTR |
1029 | # ifdef INTPTR_MAX |
1030 | # define PRIdPTR "l" "d" |
1031 | # endif |
1032 | #endif |
1033 | #if !defined PRIiPTR || 0 |
1034 | # undef PRIiPTR |
1035 | # ifdef INTPTR_MAX |
1036 | # define PRIiPTR "l" "i" |
1037 | # endif |
1038 | #endif |
1039 | #if !defined PRIoPTR || 0 |
1040 | # undef PRIoPTR |
1041 | # ifdef UINTPTR_MAX |
1042 | # define PRIoPTR "l" "o" |
1043 | # endif |
1044 | #endif |
1045 | #if !defined PRIuPTR || 0 |
1046 | # undef PRIuPTR |
1047 | # ifdef UINTPTR_MAX |
1048 | # define PRIuPTR "l" "u" |
1049 | # endif |
1050 | #endif |
1051 | #if !defined PRIxPTR || 0 |
1052 | # undef PRIxPTR |
1053 | # ifdef UINTPTR_MAX |
1054 | # define PRIxPTR "l" "x" |
1055 | # endif |
1056 | #endif |
1057 | #if !defined PRIXPTR || 0 |
1058 | # undef PRIXPTR |
1059 | # ifdef UINTPTR_MAX |
1060 | # define PRIXPTR "l" "X" |
1061 | # endif |
1062 | #endif |
1063 | |
1064 | #if !defined SCNd8 || 0 |
1065 | # undef SCNd8 |
1066 | # ifdef INT8_MAX |
1067 | # define SCNd8 "hhd" |
1068 | # endif |
1069 | #endif |
1070 | #if !defined SCNi8 || 0 |
1071 | # undef SCNi8 |
1072 | # ifdef INT8_MAX |
1073 | # define SCNi8 "hhi" |
1074 | # endif |
1075 | #endif |
1076 | #if !defined SCNo8 || 0 |
1077 | # undef SCNo8 |
1078 | # ifdef UINT8_MAX |
1079 | # define SCNo8 "hho" |
1080 | # endif |
1081 | #endif |
1082 | #if !defined SCNu8 || 0 |
1083 | # undef SCNu8 |
1084 | # ifdef UINT8_MAX |
1085 | # define SCNu8 "hhu" |
1086 | # endif |
1087 | #endif |
1088 | #if !defined SCNx8 || 0 |
1089 | # undef SCNx8 |
1090 | # ifdef UINT8_MAX |
1091 | # define SCNx8 "hhx" |
1092 | # endif |
1093 | #endif |
1094 | #if !defined SCNd16 || 0 |
1095 | # undef SCNd16 |
1096 | # ifdef INT16_MAX |
1097 | # define SCNd16 "hd" |
1098 | # endif |
1099 | #endif |
1100 | #if !defined SCNi16 || 0 |
1101 | # undef SCNi16 |
1102 | # ifdef INT16_MAX |
1103 | # define SCNi16 "hi" |
1104 | # endif |
1105 | #endif |
1106 | #if !defined SCNo16 || 0 |
1107 | # undef SCNo16 |
1108 | # ifdef UINT16_MAX |
1109 | # define SCNo16 "ho" |
1110 | # endif |
1111 | #endif |
1112 | #if !defined SCNu16 || 0 |
1113 | # undef SCNu16 |
1114 | # ifdef UINT16_MAX |
1115 | # define SCNu16 "hu" |
1116 | # endif |
1117 | #endif |
1118 | #if !defined SCNx16 || 0 |
1119 | # undef SCNx16 |
1120 | # ifdef UINT16_MAX |
1121 | # define SCNx16 "hx" |
1122 | # endif |
1123 | #endif |
1124 | #if !defined SCNd32 || 0 |
1125 | # undef SCNd32 |
1126 | # ifdef INT32_MAX |
1127 | # define SCNd32 "d" |
1128 | # endif |
1129 | #endif |
1130 | #if !defined SCNi32 || 0 |
1131 | # undef SCNi32 |
1132 | # ifdef INT32_MAX |
1133 | # define SCNi32 "i" |
1134 | # endif |
1135 | #endif |
1136 | #if !defined SCNo32 || 0 |
1137 | # undef SCNo32 |
1138 | # ifdef UINT32_MAX |
1139 | # define SCNo32 "o" |
1140 | # endif |
1141 | #endif |
1142 | #if !defined SCNu32 || 0 |
1143 | # undef SCNu32 |
1144 | # ifdef UINT32_MAX |
1145 | # define SCNu32 "u" |
1146 | # endif |
1147 | #endif |
1148 | #if !defined SCNx32 || 0 |
1149 | # undef SCNx32 |
1150 | # ifdef UINT32_MAX |
1151 | # define SCNx32 "x" |
1152 | # endif |
1153 | #endif |
1154 | #ifdef INT64_MAX |
1155 | # if (0 ? defined _LP64 : 1) |
1156 | # define _SCN64_PREFIX "l" |
1157 | # elif defined _MSC_VER || defined __MINGW32__ |
1158 | # define _SCN64_PREFIX "I64" |
1159 | # elif 1 && LONG_MAX >> 30 == 1 |
1160 | # define _SCN64_PREFIX _LONG_LONG_FORMAT_PREFIX |
1161 | # endif |
1162 | # if !defined SCNd64 || 0 |
1163 | # undef SCNd64 |
1164 | # define SCNd64 _SCN64_PREFIX "d" |
1165 | # endif |
1166 | # if !defined SCNi64 || 0 |
1167 | # undef SCNi64 |
1168 | # define SCNi64 _SCN64_PREFIX "i" |
1169 | # endif |
1170 | #endif |
1171 | #ifdef UINT64_MAX |
1172 | # if (0 ? defined _LP64 : 1) |
1173 | # define _SCNu64_PREFIX "l" |
1174 | # elif defined _MSC_VER || defined __MINGW32__ |
1175 | # define _SCNu64_PREFIX "I64" |
1176 | # elif 1 && ULONG_MAX >> 31 == 1 |
1177 | # define _SCNu64_PREFIX _LONG_LONG_FORMAT_PREFIX |
1178 | # endif |
1179 | # if !defined SCNo64 || 0 |
1180 | # undef SCNo64 |
1181 | # define SCNo64 _SCNu64_PREFIX "o" |
1182 | # endif |
1183 | # if !defined SCNu64 || 0 |
1184 | # undef SCNu64 |
1185 | # define SCNu64 _SCNu64_PREFIX "u" |
1186 | # endif |
1187 | # if !defined SCNx64 || 0 |
1188 | # undef SCNx64 |
1189 | # define SCNx64 _SCNu64_PREFIX "x" |
1190 | # endif |
1191 | #endif |
1192 | |
1193 | #if !defined SCNdLEAST8 || 0 |
1194 | # undef SCNdLEAST8 |
1195 | # define SCNdLEAST8 "hhd" |
1196 | #endif |
1197 | #if !defined SCNiLEAST8 || 0 |
1198 | # undef SCNiLEAST8 |
1199 | # define SCNiLEAST8 "hhi" |
1200 | #endif |
1201 | #if !defined SCNoLEAST8 || 0 |
1202 | # undef SCNoLEAST8 |
1203 | # define SCNoLEAST8 "hho" |
1204 | #endif |
1205 | #if !defined SCNuLEAST8 || 0 |
1206 | # undef SCNuLEAST8 |
1207 | # define SCNuLEAST8 "hhu" |
1208 | #endif |
1209 | #if !defined SCNxLEAST8 || 0 |
1210 | # undef SCNxLEAST8 |
1211 | # define SCNxLEAST8 "hhx" |
1212 | #endif |
1213 | #if !defined SCNdLEAST16 || 0 |
1214 | # undef SCNdLEAST16 |
1215 | # define SCNdLEAST16 "hd" |
1216 | #endif |
1217 | #if !defined SCNiLEAST16 || 0 |
1218 | # undef SCNiLEAST16 |
1219 | # define SCNiLEAST16 "hi" |
1220 | #endif |
1221 | #if !defined SCNoLEAST16 || 0 |
1222 | # undef SCNoLEAST16 |
1223 | # define SCNoLEAST16 "ho" |
1224 | #endif |
1225 | #if !defined SCNuLEAST16 || 0 |
1226 | # undef SCNuLEAST16 |
1227 | # define SCNuLEAST16 "hu" |
1228 | #endif |
1229 | #if !defined SCNxLEAST16 || 0 |
1230 | # undef SCNxLEAST16 |
1231 | # define SCNxLEAST16 "hx" |
1232 | #endif |
1233 | #if !defined SCNdLEAST32 || 0 |
1234 | # undef SCNdLEAST32 |
1235 | # define SCNdLEAST32 "d" |
1236 | #endif |
1237 | #if !defined SCNiLEAST32 || 0 |
1238 | # undef SCNiLEAST32 |
1239 | # define SCNiLEAST32 "i" |
1240 | #endif |
1241 | #if !defined SCNoLEAST32 || 0 |
1242 | # undef SCNoLEAST32 |
1243 | # define SCNoLEAST32 "o" |
1244 | #endif |
1245 | #if !defined SCNuLEAST32 || 0 |
1246 | # undef SCNuLEAST32 |
1247 | # define SCNuLEAST32 "u" |
1248 | #endif |
1249 | #if !defined SCNxLEAST32 || 0 |
1250 | # undef SCNxLEAST32 |
1251 | # define SCNxLEAST32 "x" |
1252 | #endif |
1253 | #ifdef INT64_MAX |
1254 | # if !defined SCNdLEAST64 || 0 |
1255 | # undef SCNdLEAST64 |
1256 | # define SCNdLEAST64 SCNd64 |
1257 | # endif |
1258 | # if !defined SCNiLEAST64 || 0 |
1259 | # undef SCNiLEAST64 |
1260 | # define SCNiLEAST64 SCNi64 |
1261 | # endif |
1262 | #endif |
1263 | #ifdef UINT64_MAX |
1264 | # if !defined SCNoLEAST64 || 0 |
1265 | # undef SCNoLEAST64 |
1266 | # define SCNoLEAST64 SCNo64 |
1267 | # endif |
1268 | # if !defined SCNuLEAST64 || 0 |
1269 | # undef SCNuLEAST64 |
1270 | # define SCNuLEAST64 SCNu64 |
1271 | # endif |
1272 | # if !defined SCNxLEAST64 || 0 |
1273 | # undef SCNxLEAST64 |
1274 | # define SCNxLEAST64 SCNx64 |
1275 | # endif |
1276 | #endif |
1277 | |
1278 | #if !defined SCNdFAST8 || 0 |
1279 | # undef SCNdFAST8 |
1280 | # if INT_FAST8_MAX > INT32_MAX |
1281 | # define SCNdFAST8 SCNd64 |
1282 | # elif INT_FAST8_MAX == 0x7fff |
1283 | # define SCNdFAST8 "hd" |
1284 | # elif INT_FAST8_MAX == 0x7f |
1285 | # define SCNdFAST8 "hhd" |
1286 | # else |
1287 | # define SCNdFAST8 "d" |
1288 | # endif |
1289 | #endif |
1290 | #if !defined SCNiFAST8 || 0 |
1291 | # undef SCNiFAST8 |
1292 | # if INT_FAST8_MAX > INT32_MAX |
1293 | # define SCNiFAST8 SCNi64 |
1294 | # elif INT_FAST8_MAX == 0x7fff |
1295 | # define SCNiFAST8 "hi" |
1296 | # elif INT_FAST8_MAX == 0x7f |
1297 | # define SCNiFAST8 "hhi" |
1298 | # else |
1299 | # define SCNiFAST8 "i" |
1300 | # endif |
1301 | #endif |
1302 | #if !defined SCNoFAST8 || 0 |
1303 | # undef SCNoFAST8 |
1304 | # if UINT_FAST8_MAX > UINT32_MAX |
1305 | # define SCNoFAST8 SCNo64 |
1306 | # elif UINT_FAST8_MAX == 0xffff |
1307 | # define SCNoFAST8 "ho" |
1308 | # elif UINT_FAST8_MAX == 0xff |
1309 | # define SCNoFAST8 "hho" |
1310 | # else |
1311 | # define SCNoFAST8 "o" |
1312 | # endif |
1313 | #endif |
1314 | #if !defined SCNuFAST8 || 0 |
1315 | # undef SCNuFAST8 |
1316 | # if UINT_FAST8_MAX > UINT32_MAX |
1317 | # define SCNuFAST8 SCNu64 |
1318 | # elif UINT_FAST8_MAX == 0xffff |
1319 | # define SCNuFAST8 "hu" |
1320 | # elif UINT_FAST8_MAX == 0xff |
1321 | # define SCNuFAST8 "hhu" |
1322 | # else |
1323 | # define SCNuFAST8 "u" |
1324 | # endif |
1325 | #endif |
1326 | #if !defined SCNxFAST8 || 0 |
1327 | # undef SCNxFAST8 |
1328 | # if UINT_FAST8_MAX > UINT32_MAX |
1329 | # define SCNxFAST8 SCNx64 |
1330 | # elif UINT_FAST8_MAX == 0xffff |
1331 | # define SCNxFAST8 "hx" |
1332 | # elif UINT_FAST8_MAX == 0xff |
1333 | # define SCNxFAST8 "hhx" |
1334 | # else |
1335 | # define SCNxFAST8 "x" |
1336 | # endif |
1337 | #endif |
1338 | #if !defined SCNdFAST16 || 0 |
1339 | # undef SCNdFAST16 |
1340 | # if INT_FAST16_MAX > INT32_MAX |
1341 | # define SCNdFAST16 SCNd64 |
1342 | # elif INT_FAST16_MAX == 0x7fff |
1343 | # define SCNdFAST16 "hd" |
1344 | # else |
1345 | # define SCNdFAST16 "d" |
1346 | # endif |
1347 | #endif |
1348 | #if !defined SCNiFAST16 || 0 |
1349 | # undef SCNiFAST16 |
1350 | # if INT_FAST16_MAX > INT32_MAX |
1351 | # define SCNiFAST16 SCNi64 |
1352 | # elif INT_FAST16_MAX == 0x7fff |
1353 | # define SCNiFAST16 "hi" |
1354 | # else |
1355 | # define SCNiFAST16 "i" |
1356 | # endif |
1357 | #endif |
1358 | #if !defined SCNoFAST16 || 0 |
1359 | # undef SCNoFAST16 |
1360 | # if UINT_FAST16_MAX > UINT32_MAX |
1361 | # define SCNoFAST16 SCNo64 |
1362 | # elif UINT_FAST16_MAX == 0xffff |
1363 | # define SCNoFAST16 "ho" |
1364 | # else |
1365 | # define SCNoFAST16 "o" |
1366 | # endif |
1367 | #endif |
1368 | #if !defined SCNuFAST16 || 0 |
1369 | # undef SCNuFAST16 |
1370 | # if UINT_FAST16_MAX > UINT32_MAX |
1371 | # define SCNuFAST16 SCNu64 |
1372 | # elif UINT_FAST16_MAX == 0xffff |
1373 | # define SCNuFAST16 "hu" |
1374 | # else |
1375 | # define SCNuFAST16 "u" |
1376 | # endif |
1377 | #endif |
1378 | #if !defined SCNxFAST16 || 0 |
1379 | # undef SCNxFAST16 |
1380 | # if UINT_FAST16_MAX > UINT32_MAX |
1381 | # define SCNxFAST16 SCNx64 |
1382 | # elif UINT_FAST16_MAX == 0xffff |
1383 | # define SCNxFAST16 "hx" |
1384 | # else |
1385 | # define SCNxFAST16 "x" |
1386 | # endif |
1387 | #endif |
1388 | #if !defined SCNdFAST32 || 0 |
1389 | # undef SCNdFAST32 |
1390 | # if INT_FAST32_MAX > INT32_MAX |
1391 | # define SCNdFAST32 SCNd64 |
1392 | # else |
1393 | # define SCNdFAST32 "d" |
1394 | # endif |
1395 | #endif |
1396 | #if !defined SCNiFAST32 || 0 |
1397 | # undef SCNiFAST32 |
1398 | # if INT_FAST32_MAX > INT32_MAX |
1399 | # define SCNiFAST32 SCNi64 |
1400 | # else |
1401 | # define SCNiFAST32 "i" |
1402 | # endif |
1403 | #endif |
1404 | #if !defined SCNoFAST32 || 0 |
1405 | # undef SCNoFAST32 |
1406 | # if UINT_FAST32_MAX > UINT32_MAX |
1407 | # define SCNoFAST32 SCNo64 |
1408 | # else |
1409 | # define SCNoFAST32 "o" |
1410 | # endif |
1411 | #endif |
1412 | #if !defined SCNuFAST32 || 0 |
1413 | # undef SCNuFAST32 |
1414 | # if UINT_FAST32_MAX > UINT32_MAX |
1415 | # define SCNuFAST32 SCNu64 |
1416 | # else |
1417 | # define SCNuFAST32 "u" |
1418 | # endif |
1419 | #endif |
1420 | #if !defined SCNxFAST32 || 0 |
1421 | # undef SCNxFAST32 |
1422 | # if UINT_FAST32_MAX > UINT32_MAX |
1423 | # define SCNxFAST32 SCNx64 |
1424 | # else |
1425 | # define SCNxFAST32 "x" |
1426 | # endif |
1427 | #endif |
1428 | #ifdef INT64_MAX |
1429 | # if !defined SCNdFAST64 || 0 |
1430 | # undef SCNdFAST64 |
1431 | # define SCNdFAST64 SCNd64 |
1432 | # endif |
1433 | # if !defined SCNiFAST64 || 0 |
1434 | # undef SCNiFAST64 |
1435 | # define SCNiFAST64 SCNi64 |
1436 | # endif |
1437 | #endif |
1438 | #ifdef UINT64_MAX |
1439 | # if !defined SCNoFAST64 || 0 |
1440 | # undef SCNoFAST64 |
1441 | # define SCNoFAST64 SCNo64 |
1442 | # endif |
1443 | # if !defined SCNuFAST64 || 0 |
1444 | # undef SCNuFAST64 |
1445 | # define SCNuFAST64 SCNu64 |
1446 | # endif |
1447 | # if !defined SCNxFAST64 || 0 |
1448 | # undef SCNxFAST64 |
1449 | # define SCNxFAST64 SCNx64 |
1450 | # endif |
1451 | #endif |
1452 | |
1453 | #if !defined SCNdMAX || 0 |
1454 | # undef SCNdMAX |
1455 | # if 1 |
1456 | # define SCNdMAX SCNd64 |
1457 | # else |
1458 | # define SCNdMAX "ld" |
1459 | # endif |
1460 | #endif |
1461 | #if !defined SCNiMAX || 0 |
1462 | # undef SCNiMAX |
1463 | # if 1 |
1464 | # define SCNiMAX SCNi64 |
1465 | # else |
1466 | # define SCNiMAX "li" |
1467 | # endif |
1468 | #endif |
1469 | #if !defined SCNoMAX || 0 |
1470 | # undef SCNoMAX |
1471 | # if 1 |
1472 | # define SCNoMAX SCNo64 |
1473 | # else |
1474 | # define SCNoMAX "lo" |
1475 | # endif |
1476 | #endif |
1477 | #if !defined SCNuMAX || 0 |
1478 | # undef SCNuMAX |
1479 | # if 1 |
1480 | # define SCNuMAX SCNu64 |
1481 | # else |
1482 | # define SCNuMAX "lu" |
1483 | # endif |
1484 | #endif |
1485 | #if !defined SCNxMAX || 0 |
1486 | # undef SCNxMAX |
1487 | # if 1 |
1488 | # define SCNxMAX SCNx64 |
1489 | # else |
1490 | # define SCNxMAX "lx" |
1491 | # endif |
1492 | #endif |
1493 | |
1494 | #if !defined SCNdPTR || 0 |
1495 | # undef SCNdPTR |
1496 | # ifdef INTPTR_MAX |
1497 | # define SCNdPTR "l" "d" |
1498 | # endif |
1499 | #endif |
1500 | #if !defined SCNiPTR || 0 |
1501 | # undef SCNiPTR |
1502 | # ifdef INTPTR_MAX |
1503 | # define SCNiPTR "l" "i" |
1504 | # endif |
1505 | #endif |
1506 | #if !defined SCNoPTR || 0 |
1507 | # undef SCNoPTR |
1508 | # ifdef UINTPTR_MAX |
1509 | # define SCNoPTR "l" "o" |
1510 | # endif |
1511 | #endif |
1512 | #if !defined SCNuPTR || 0 |
1513 | # undef SCNuPTR |
1514 | # ifdef UINTPTR_MAX |
1515 | # define SCNuPTR "l" "u" |
1516 | # endif |
1517 | #endif |
1518 | #if !defined SCNxPTR || 0 |
1519 | # undef SCNxPTR |
1520 | # ifdef UINTPTR_MAX |
1521 | # define SCNxPTR "l" "x" |
1522 | # endif |
1523 | #endif |
1524 | |
1525 | /* 7.8.2 Functions for greatest-width integer types */ |
1526 | |
1527 | #ifdef __cplusplus |
1528 | extern "C" { |
1529 | #endif |
1530 | |
1531 | #if 0 |
1532 | # if !1 |
1533 | extern intmax_t imaxabs (intmax_t); |
1534 | # endif |
1535 | #elif defined GNULIB_POSIXCHECK |
1536 | # undef imaxabs |
1537 | # if HAVE_RAW_DECL_IMAXABS |
1538 | _GL_WARN_ON_USE (imaxabs, "imaxabs is unportable - " |
1539 | "use gnulib module imaxabs for portability" ); |
1540 | # endif |
1541 | #endif |
1542 | |
1543 | #if 0 |
1544 | # if !1 |
1545 | # if !GNULIB_defined_imaxdiv_t |
1546 | typedef struct { intmax_t quot; intmax_t rem; } imaxdiv_t; |
1547 | # define GNULIB_defined_imaxdiv_t 1 |
1548 | # endif |
1549 | # endif |
1550 | # if !1 |
1551 | extern imaxdiv_t imaxdiv (intmax_t, intmax_t); |
1552 | # endif |
1553 | #elif defined GNULIB_POSIXCHECK |
1554 | # undef imaxdiv |
1555 | # if HAVE_RAW_DECL_IMAXDIV |
1556 | _GL_WARN_ON_USE (imaxdiv, "imaxdiv is unportable - " |
1557 | "use gnulib module imaxdiv for portability" ); |
1558 | # endif |
1559 | #endif |
1560 | |
1561 | #if 0 |
1562 | # if 0 |
1563 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
1564 | # undef strtoimax |
1565 | # define strtoimax rpl_strtoimax |
1566 | # endif |
1567 | _GL_FUNCDECL_RPL (strtoimax, intmax_t, |
1568 | (const char *, char **, int) _GL_ARG_NONNULL ((1))); |
1569 | _GL_CXXALIAS_RPL (strtoimax, intmax_t, (const char *, char **, int)); |
1570 | # else |
1571 | # if !1 |
1572 | # undef strtoimax |
1573 | _GL_FUNCDECL_SYS (strtoimax, intmax_t, |
1574 | (const char *, char **, int) _GL_ARG_NONNULL ((1))); |
1575 | # endif |
1576 | _GL_CXXALIAS_SYS (strtoimax, intmax_t, (const char *, char **, int)); |
1577 | # endif |
1578 | _GL_CXXALIASWARN (strtoimax); |
1579 | #elif defined GNULIB_POSIXCHECK |
1580 | # undef strtoimax |
1581 | # if HAVE_RAW_DECL_STRTOIMAX |
1582 | _GL_WARN_ON_USE (strtoimax, "strtoimax is unportable - " |
1583 | "use gnulib module strtoimax for portability" ); |
1584 | # endif |
1585 | #endif |
1586 | |
1587 | #if 0 |
1588 | # if 0 |
1589 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
1590 | # undef strtoumax |
1591 | # define strtoumax rpl_strtoumax |
1592 | # endif |
1593 | _GL_FUNCDECL_RPL (strtoumax, uintmax_t, |
1594 | (const char *, char **, int) _GL_ARG_NONNULL ((1))); |
1595 | _GL_CXXALIAS_RPL (strtoumax, uintmax_t, (const char *, char **, int)); |
1596 | # else |
1597 | # if !1 |
1598 | # undef strtoumax |
1599 | _GL_FUNCDECL_SYS (strtoumax, uintmax_t, |
1600 | (const char *, char **, int) _GL_ARG_NONNULL ((1))); |
1601 | # endif |
1602 | _GL_CXXALIAS_SYS (strtoumax, uintmax_t, (const char *, char **, int)); |
1603 | # endif |
1604 | _GL_CXXALIASWARN (strtoumax); |
1605 | #elif defined GNULIB_POSIXCHECK |
1606 | # undef strtoumax |
1607 | # if HAVE_RAW_DECL_STRTOUMAX |
1608 | _GL_WARN_ON_USE (strtoumax, "strtoumax is unportable - " |
1609 | "use gnulib module strtoumax for portability" ); |
1610 | # endif |
1611 | #endif |
1612 | |
1613 | /* Don't bother defining or declaring wcstoimax and wcstoumax, since |
1614 | wide-character functions like this are hardly ever useful. */ |
1615 | |
1616 | #ifdef __cplusplus |
1617 | } |
1618 | #endif |
1619 | |
1620 | #endif /* !defined INTTYPES_H && !defined _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H */ |
1621 | |