gnulib: update to 776af40e0
[deliverable/binutils-gdb.git] / gnulib / import / cdefs.h
CommitLineData
9c9d63b1 1/* Copyright (C) 1992-2021 Free Software Foundation, Inc.
c0c3707f
CB
2 This file is part of the GNU C Library.
3
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public
6 License as published by the Free Software Foundation; either
7 version 3 of the License, or (at your option) any later version.
8
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 General Public License for more details.
13
14 You should have received a copy of the GNU General Public
15 License along with the GNU C Library; if not, see
16 <https://www.gnu.org/licenses/>. */
17
18#ifndef _SYS_CDEFS_H
19#define _SYS_CDEFS_H 1
20
21/* We are almost always included from features.h. */
22#ifndef _FEATURES_H
23# include <features.h>
24#endif
25
26/* The GNU libc does not support any K&R compilers or the traditional mode
27 of ISO C compilers anymore. Check for some of the combinations not
9c9d63b1 28 supported anymore. */
c0c3707f
CB
29#if defined __GNUC__ && !defined __STDC__
30# error "You need a ISO C conforming compiler to use the glibc headers"
31#endif
32
33/* Some user header file might have defined this before. */
34#undef __P
35#undef __PMT
36
9c9d63b1
PM
37/* Compilers that are not clang may object to
38 #if defined __clang__ && __has_attribute(...)
39 even though they do not need to evaluate the right-hand side of the &&. */
40#if defined __clang__ && defined __has_attribute
41# define __glibc_clang_has_attribute(name) __has_attribute (name)
42#else
43# define __glibc_clang_has_attribute(name) 0
44#endif
45
46/* Compilers that are not clang may object to
47 #if defined __clang__ && __has_builtin(...)
48 even though they do not need to evaluate the right-hand side of the &&. */
49#if defined __clang__ && defined __has_builtin
50# define __glibc_clang_has_builtin(name) __has_builtin (name)
51#else
52# define __glibc_clang_has_builtin(name) 0
53#endif
54
55/* Compilers that are not clang may object to
56 #if defined __clang__ && __has_extension(...)
57 even though they do not need to evaluate the right-hand side of the &&. */
58#if defined __clang__ && defined __has_extension
59# define __glibc_clang_has_extension(ext) __has_extension (ext)
60#else
61# define __glibc_clang_has_extension(ext) 0
62#endif
63
64#if defined __GNUC__ || defined __clang__
c0c3707f
CB
65
66/* All functions, except those with callbacks or those that
67 synchronize memory, are leaf functions. */
68# if __GNUC_PREREQ (4, 6) && !defined _LIBC
69# define __LEAF , __leaf__
70# define __LEAF_ATTR __attribute__ ((__leaf__))
71# else
72# define __LEAF
73# define __LEAF_ATTR
74# endif
75
76/* GCC can always grok prototypes. For C++ programs we add throw()
9c9d63b1
PM
77 to help it optimize the function calls. But this only works with
78 gcc 2.8.x and egcs. For gcc 3.4 and up we even mark C functions
c0c3707f
CB
79 as non-throwing using a function attribute since programs can use
80 the -fexceptions options for C code as well. */
9c9d63b1
PM
81# if !defined __cplusplus \
82 && (__GNUC_PREREQ (3, 4) || __glibc_clang_has_attribute (__nothrow__))
c0c3707f
CB
83# define __THROW __attribute__ ((__nothrow__ __LEAF))
84# define __THROWNL __attribute__ ((__nothrow__))
85# define __NTH(fct) __attribute__ ((__nothrow__ __LEAF)) fct
86# define __NTHNL(fct) __attribute__ ((__nothrow__)) fct
87# else
9c9d63b1
PM
88# if defined __cplusplus && (__GNUC_PREREQ (2,8) || __clang_major >= 4)
89# if __cplusplus >= 201103L
90# define __THROW noexcept (true)
91# else
92# define __THROW throw ()
93# endif
94# define __THROWNL __THROW
95# define __NTH(fct) __LEAF_ATTR fct __THROW
96# define __NTHNL(fct) fct __THROW
c0c3707f
CB
97# else
98# define __THROW
99# define __THROWNL
100# define __NTH(fct) fct
101# define __NTHNL(fct) fct
102# endif
103# endif
104
9c9d63b1 105#else /* Not GCC or clang. */
c0c3707f
CB
106
107# if (defined __cplusplus \
108 || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L))
109# define __inline inline
110# else
111# define __inline /* No inline functions. */
112# endif
113
114# define __THROW
115# define __THROWNL
116# define __NTH(fct) fct
117
9c9d63b1 118#endif /* GCC || clang. */
c0c3707f
CB
119
120/* These two macros are not used in glibc anymore. They are kept here
121 only because some other projects expect the macros to be defined. */
122#define __P(args) args
123#define __PMT(args) args
124
125/* For these things, GCC behaves the ANSI way normally,
126 and the non-ANSI way under -traditional. */
127
128#define __CONCAT(x,y) x ## y
129#define __STRING(x) #x
130
131/* This is not a typedef so `const __ptr_t' does the right thing. */
132#define __ptr_t void *
133
134
135/* C++ needs to know that types and declarations are C, not C++. */
136#ifdef __cplusplus
137# define __BEGIN_DECLS extern "C" {
138# define __END_DECLS }
139#else
140# define __BEGIN_DECLS
141# define __END_DECLS
142#endif
143
144
145/* Fortify support. */
146#define __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1)
147#define __bos0(ptr) __builtin_object_size (ptr, 0)
148
9c9d63b1
PM
149/* Use __builtin_dynamic_object_size at _FORTIFY_SOURCE=3 when available. */
150#if __USE_FORTIFY_LEVEL == 3 && __glibc_clang_prereq (9, 0)
151# define __glibc_objsize0(__o) __builtin_dynamic_object_size (__o, 0)
152# define __glibc_objsize(__o) __builtin_dynamic_object_size (__o, 1)
153#else
154# define __glibc_objsize0(__o) __bos0 (__o)
155# define __glibc_objsize(__o) __bos (__o)
156#endif
157
c0c3707f 158#if __GNUC_PREREQ (4,3)
c0c3707f
CB
159# define __warnattr(msg) __attribute__((__warning__ (msg)))
160# define __errordecl(name, msg) \
161 extern void name (void) __attribute__((__error__ (msg)))
162#else
c0c3707f
CB
163# define __warnattr(msg)
164# define __errordecl(name, msg) extern void name (void)
165#endif
166
167/* Support for flexible arrays.
168 Headers that should use flexible arrays only if they're "real"
169 (e.g. only if they won't affect sizeof()) should test
170 #if __glibc_c99_flexarr_available. */
171#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L && !defined __HP_cc
172# define __flexarr []
173# define __glibc_c99_flexarr_available 1
9c9d63b1
PM
174#elif __GNUC_PREREQ (2,97) || defined __clang__
175/* GCC 2.97 and clang support C99 flexible array members as an extension,
c0c3707f
CB
176 even when in C89 mode or compiling C++ (any version). */
177# define __flexarr []
178# define __glibc_c99_flexarr_available 1
179#elif defined __GNUC__
180/* Pre-2.97 GCC did not support C99 flexible arrays but did have
181 an equivalent extension with slightly different notation. */
182# define __flexarr [0]
183# define __glibc_c99_flexarr_available 1
184#else
185/* Some other non-C99 compiler. Approximate with [1]. */
186# define __flexarr [1]
187# define __glibc_c99_flexarr_available 0
188#endif
189
190
191/* __asm__ ("xyz") is used throughout the headers to rename functions
192 at the assembly language level. This is wrapped by the __REDIRECT
193 macro, in order to support compilers that can do this some other
194 way. When compilers don't support asm-names at all, we have to do
195 preprocessor tricks instead (which don't have exactly the right
196 semantics, but it's the best we can do).
197
198 Example:
199 int __REDIRECT(setpgrp, (__pid_t pid, __pid_t pgrp), setpgid); */
200
9c9d63b1 201#if (defined __GNUC__ && __GNUC__ >= 2) || (__clang_major__ >= 4)
c0c3707f
CB
202
203# define __REDIRECT(name, proto, alias) name proto __asm__ (__ASMNAME (#alias))
204# ifdef __cplusplus
205# define __REDIRECT_NTH(name, proto, alias) \
206 name proto __THROW __asm__ (__ASMNAME (#alias))
207# define __REDIRECT_NTHNL(name, proto, alias) \
208 name proto __THROWNL __asm__ (__ASMNAME (#alias))
209# else
210# define __REDIRECT_NTH(name, proto, alias) \
211 name proto __asm__ (__ASMNAME (#alias)) __THROW
212# define __REDIRECT_NTHNL(name, proto, alias) \
213 name proto __asm__ (__ASMNAME (#alias)) __THROWNL
214# endif
215# define __ASMNAME(cname) __ASMNAME2 (__USER_LABEL_PREFIX__, cname)
216# define __ASMNAME2(prefix, cname) __STRING (prefix) cname
217
218/*
219#elif __SOME_OTHER_COMPILER__
220
221# define __REDIRECT(name, proto, alias) name proto; \
222 _Pragma("let " #name " = " #alias)
223*/
224#endif
225
9c9d63b1
PM
226/* GCC and clang have various useful declarations that can be made with
227 the '__attribute__' syntax. All of the ways we use this do fine if
228 they are omitted for compilers that don't understand it. */
229#if !(defined __GNUC__ || defined __clang__)
c0c3707f
CB
230# define __attribute__(xyz) /* Ignore */
231#endif
232
233/* At some point during the gcc 2.96 development the `malloc' attribute
234 for functions was introduced. We don't want to use it unconditionally
235 (although this would be possible) since it generates warnings. */
9c9d63b1 236#if __GNUC_PREREQ (2,96) || __glibc_clang_has_attribute (__malloc__)
c0c3707f
CB
237# define __attribute_malloc__ __attribute__ ((__malloc__))
238#else
239# define __attribute_malloc__ /* Ignore */
240#endif
241
242/* Tell the compiler which arguments to an allocation function
243 indicate the size of the allocation. */
244#if __GNUC_PREREQ (4, 3)
245# define __attribute_alloc_size__(params) \
246 __attribute__ ((__alloc_size__ params))
247#else
248# define __attribute_alloc_size__(params) /* Ignore. */
249#endif
250
251/* At some point during the gcc 2.96 development the `pure' attribute
252 for functions was introduced. We don't want to use it unconditionally
253 (although this would be possible) since it generates warnings. */
9c9d63b1 254#if __GNUC_PREREQ (2,96) || __glibc_clang_has_attribute (__pure__)
c0c3707f
CB
255# define __attribute_pure__ __attribute__ ((__pure__))
256#else
257# define __attribute_pure__ /* Ignore */
258#endif
259
260/* This declaration tells the compiler that the value is constant. */
9c9d63b1 261#if __GNUC_PREREQ (2,5) || __glibc_clang_has_attribute (__const__)
c0c3707f
CB
262# define __attribute_const__ __attribute__ ((__const__))
263#else
264# define __attribute_const__ /* Ignore */
265#endif
266
267/* At some point during the gcc 3.1 development the `used' attribute
268 for functions was introduced. We don't want to use it unconditionally
269 (although this would be possible) since it generates warnings. */
9c9d63b1 270#if __GNUC_PREREQ (3,1) || __glibc_clang_has_attribute (__used__)
c0c3707f
CB
271# define __attribute_used__ __attribute__ ((__used__))
272# define __attribute_noinline__ __attribute__ ((__noinline__))
273#else
274# define __attribute_used__ __attribute__ ((__unused__))
275# define __attribute_noinline__ /* Ignore */
276#endif
277
278/* Since version 3.2, gcc allows marking deprecated functions. */
9c9d63b1 279#if __GNUC_PREREQ (3,2) || __glibc_clang_has_attribute (__deprecated__)
c0c3707f
CB
280# define __attribute_deprecated__ __attribute__ ((__deprecated__))
281#else
282# define __attribute_deprecated__ /* Ignore */
283#endif
284
285/* Since version 4.5, gcc also allows one to specify the message printed
286 when a deprecated function is used. clang claims to be gcc 4.2, but
287 may also support this feature. */
9c9d63b1
PM
288#if __GNUC_PREREQ (4,5) \
289 || __glibc_clang_has_extension (__attribute_deprecated_with_message__)
c0c3707f
CB
290# define __attribute_deprecated_msg__(msg) \
291 __attribute__ ((__deprecated__ (msg)))
292#else
293# define __attribute_deprecated_msg__(msg) __attribute_deprecated__
294#endif
295
296/* At some point during the gcc 2.8 development the `format_arg' attribute
297 for functions was introduced. We don't want to use it unconditionally
298 (although this would be possible) since it generates warnings.
299 If several `format_arg' attributes are given for the same function, in
300 gcc-3.0 and older, all but the last one are ignored. In newer gccs,
301 all designated arguments are considered. */
9c9d63b1 302#if __GNUC_PREREQ (2,8) || __glibc_clang_has_attribute (__format_arg__)
c0c3707f
CB
303# define __attribute_format_arg__(x) __attribute__ ((__format_arg__ (x)))
304#else
305# define __attribute_format_arg__(x) /* Ignore */
306#endif
307
308/* At some point during the gcc 2.97 development the `strfmon' format
309 attribute for functions was introduced. We don't want to use it
310 unconditionally (although this would be possible) since it
311 generates warnings. */
9c9d63b1 312#if __GNUC_PREREQ (2,97) || __glibc_clang_has_attribute (__format__)
c0c3707f
CB
313# define __attribute_format_strfmon__(a,b) \
314 __attribute__ ((__format__ (__strfmon__, a, b)))
315#else
316# define __attribute_format_strfmon__(a,b) /* Ignore */
317#endif
318
319/* The nonnull function attribute marks pointer parameters that
320 must not be NULL. Do not define __nonnull if it is already defined,
321 for portability when this file is used in Gnulib. */
322#ifndef __nonnull
9c9d63b1 323# if __GNUC_PREREQ (3,3) || __glibc_clang_has_attribute (__nonnull__)
c0c3707f
CB
324# define __nonnull(params) __attribute__ ((__nonnull__ params))
325# else
326# define __nonnull(params)
327# endif
328#endif
329
330/* If fortification mode, we warn about unused results of certain
331 function calls which can lead to problems. */
9c9d63b1 332#if __GNUC_PREREQ (3,4) || __glibc_clang_has_attribute (__warn_unused_result__)
c0c3707f
CB
333# define __attribute_warn_unused_result__ \
334 __attribute__ ((__warn_unused_result__))
335# if defined __USE_FORTIFY_LEVEL && __USE_FORTIFY_LEVEL > 0
336# define __wur __attribute_warn_unused_result__
337# endif
338#else
339# define __attribute_warn_unused_result__ /* empty */
340#endif
341#ifndef __wur
342# define __wur /* Ignore */
343#endif
344
345/* Forces a function to be always inlined. */
9c9d63b1 346#if __GNUC_PREREQ (3,2) || __glibc_clang_has_attribute (__always_inline__)
c0c3707f
CB
347/* The Linux kernel defines __always_inline in stddef.h (283d7573), and
348 it conflicts with this definition. Therefore undefine it first to
349 allow either header to be included first. */
350# undef __always_inline
351# define __always_inline __inline __attribute__ ((__always_inline__))
352#else
353# undef __always_inline
354# define __always_inline __inline
355#endif
356
357/* Associate error messages with the source location of the call site rather
358 than with the source location inside the function. */
9c9d63b1 359#if __GNUC_PREREQ (4,3) || __glibc_clang_has_attribute (__artificial__)
c0c3707f
CB
360# define __attribute_artificial__ __attribute__ ((__artificial__))
361#else
362# define __attribute_artificial__ /* Ignore */
363#endif
364
365/* GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99
366 inline semantics, unless -fgnu89-inline is used. Using __GNUC_STDC_INLINE__
367 or __GNUC_GNU_INLINE is not a good enough check for gcc because gcc versions
368 older than 4.3 may define these macros and still not guarantee GNU inlining
369 semantics.
370
371 clang++ identifies itself as gcc-4.2, but has support for GNU inlining
372 semantics, that can be checked for by using the __GNUC_STDC_INLINE_ and
373 __GNUC_GNU_INLINE__ macro definitions. */
374#if (!defined __cplusplus || __GNUC_PREREQ (4,3) \
375 || (defined __clang__ && (defined __GNUC_STDC_INLINE__ \
376 || defined __GNUC_GNU_INLINE__)))
377# if defined __GNUC_STDC_INLINE__ || defined __cplusplus
378# define __extern_inline extern __inline __attribute__ ((__gnu_inline__))
379# define __extern_always_inline \
380 extern __always_inline __attribute__ ((__gnu_inline__))
381# else
382# define __extern_inline extern __inline
383# define __extern_always_inline extern __always_inline
384# endif
385#endif
386
387#ifdef __extern_always_inline
388# define __fortify_function __extern_always_inline __attribute_artificial__
389#endif
390
391/* GCC 4.3 and above allow passing all anonymous arguments of an
392 __extern_always_inline function to some other vararg function. */
393#if __GNUC_PREREQ (4,3)
394# define __va_arg_pack() __builtin_va_arg_pack ()
395# define __va_arg_pack_len() __builtin_va_arg_pack_len ()
396#endif
397
398/* It is possible to compile containing GCC extensions even if GCC is
399 run in pedantic mode if the uses are carefully marked using the
400 `__extension__' keyword. But this is not generally available before
401 version 2.8. */
9c9d63b1 402#if !(__GNUC_PREREQ (2,8) || defined __clang__)
c0c3707f
CB
403# define __extension__ /* Ignore */
404#endif
405
9c9d63b1
PM
406/* __restrict is known in EGCS 1.2 and above, and in clang.
407 It works also in C++ mode (outside of arrays), but only when spelled
408 as '__restrict', not 'restrict'. */
409#if !(__GNUC_PREREQ (2,92) || __clang_major__ >= 3)
c0c3707f
CB
410# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
411# define __restrict restrict
412# else
413# define __restrict /* Ignore */
414# endif
415#endif
416
417/* ISO C99 also allows to declare arrays as non-overlapping. The syntax is
418 array_name[restrict]
9c9d63b1
PM
419 GCC 3.1 and clang support this.
420 This syntax is not usable in C++ mode. */
421#if (__GNUC_PREREQ (3,1) || __clang_major__ >= 3) && !defined __cplusplus
c0c3707f
CB
422# define __restrict_arr __restrict
423#else
424# ifdef __GNUC__
425# define __restrict_arr /* Not supported in old GCC. */
426# else
427# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
428# define __restrict_arr restrict
429# else
430/* Some other non-C99 compiler. */
431# define __restrict_arr /* Not supported. */
432# endif
433# endif
434#endif
435
9c9d63b1 436#if (__GNUC__ >= 3) || __glibc_clang_has_builtin (__builtin_expect)
c0c3707f
CB
437# define __glibc_unlikely(cond) __builtin_expect ((cond), 0)
438# define __glibc_likely(cond) __builtin_expect ((cond), 1)
439#else
440# define __glibc_unlikely(cond) (cond)
441# define __glibc_likely(cond) (cond)
442#endif
443
444#ifdef __has_attribute
445# define __glibc_has_attribute(attr) __has_attribute (attr)
446#else
447# define __glibc_has_attribute(attr) 0
448#endif
449
450#if (!defined _Noreturn \
451 && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \
9c9d63b1
PM
452 && !(__GNUC_PREREQ (4,7) \
453 || (3 < __clang_major__ + (5 <= __clang_minor__))))
c0c3707f
CB
454# if __GNUC_PREREQ (2,8)
455# define _Noreturn __attribute__ ((__noreturn__))
456# else
457# define _Noreturn
458# endif
459#endif
460
461#if __GNUC_PREREQ (8, 0)
462/* Describes a char array whose address can safely be passed as the first
463 argument to strncpy and strncat, as the char array is not necessarily
464 a NUL-terminated string. */
465# define __attribute_nonstring__ __attribute__ ((__nonstring__))
466#else
467# define __attribute_nonstring__
468#endif
469
9c9d63b1
PM
470/* Undefine (also defined in libc-symbols.h). */
471#undef __attribute_copy__
472#if __GNUC_PREREQ (9, 0)
473/* Copies attributes from the declaration or type referenced by
474 the argument. */
475# define __attribute_copy__(arg) __attribute__ ((__copy__ (arg)))
476#else
477# define __attribute_copy__(arg)
478#endif
479
c0c3707f
CB
480#if (!defined _Static_assert && !defined __cplusplus \
481 && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \
9c9d63b1
PM
482 && (!(__GNUC_PREREQ (4, 6) || __clang_major__ >= 4) \
483 || defined __STRICT_ANSI__))
c0c3707f
CB
484# define _Static_assert(expr, diagnostic) \
485 extern int (*__Static_assert_function (void)) \
486 [!!sizeof (struct { int __error_if_negative: (expr) ? 2 : -1; })]
487#endif
488
489/* The #ifndef lets Gnulib avoid including these on non-glibc
490 platforms, where the includes typically do not exist. */
491#ifndef __WORDSIZE
492# include <bits/wordsize.h>
493# include <bits/long-double.h>
494#endif
495
9c9d63b1
PM
496#if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1
497# ifdef __REDIRECT
498
499/* Alias name defined automatically. */
500# define __LDBL_REDIR(name, proto) ... unused__ldbl_redir
501# define __LDBL_REDIR_DECL(name) \
502 extern __typeof (name) name __asm (__ASMNAME ("__" #name "ieee128"));
503
504/* Alias name defined automatically, with leading underscores. */
505# define __LDBL_REDIR2_DECL(name) \
506 extern __typeof (__##name) __##name \
507 __asm (__ASMNAME ("__" #name "ieee128"));
508
509/* Alias name defined manually. */
510# define __LDBL_REDIR1(name, proto, alias) ... unused__ldbl_redir1
511# define __LDBL_REDIR1_DECL(name, alias) \
512 extern __typeof (name) name __asm (__ASMNAME (#alias));
513
514# define __LDBL_REDIR1_NTH(name, proto, alias) \
515 __REDIRECT_NTH (name, proto, alias)
516# define __REDIRECT_NTH_LDBL(name, proto, alias) \
517 __LDBL_REDIR1_NTH (name, proto, __##alias##ieee128)
518
519/* Unused. */
520# define __REDIRECT_LDBL(name, proto, alias) ... unused__redirect_ldbl
521# define __LDBL_REDIR_NTH(name, proto) ... unused__ldbl_redir_nth
522
523# else
524_Static_assert (0, "IEEE 128-bits long double requires redirection on this platform");
525# endif
526#elif defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH
c0c3707f
CB
527# define __LDBL_COMPAT 1
528# ifdef __REDIRECT
529# define __LDBL_REDIR1(name, proto, alias) __REDIRECT (name, proto, alias)
530# define __LDBL_REDIR(name, proto) \
531 __LDBL_REDIR1 (name, proto, __nldbl_##name)
532# define __LDBL_REDIR1_NTH(name, proto, alias) __REDIRECT_NTH (name, proto, alias)
533# define __LDBL_REDIR_NTH(name, proto) \
534 __LDBL_REDIR1_NTH (name, proto, __nldbl_##name)
9c9d63b1
PM
535# define __LDBL_REDIR2_DECL(name) \
536 extern __typeof (__##name) __##name __asm (__ASMNAME ("__nldbl___" #name));
c0c3707f
CB
537# define __LDBL_REDIR1_DECL(name, alias) \
538 extern __typeof (name) name __asm (__ASMNAME (#alias));
539# define __LDBL_REDIR_DECL(name) \
540 extern __typeof (name) name __asm (__ASMNAME ("__nldbl_" #name));
541# define __REDIRECT_LDBL(name, proto, alias) \
542 __LDBL_REDIR1 (name, proto, __nldbl_##alias)
543# define __REDIRECT_NTH_LDBL(name, proto, alias) \
544 __LDBL_REDIR1_NTH (name, proto, __nldbl_##alias)
545# endif
546#endif
9c9d63b1
PM
547#if (!defined __LDBL_COMPAT && __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0) \
548 || !defined __REDIRECT
c0c3707f
CB
549# define __LDBL_REDIR1(name, proto, alias) name proto
550# define __LDBL_REDIR(name, proto) name proto
551# define __LDBL_REDIR1_NTH(name, proto, alias) name proto __THROW
552# define __LDBL_REDIR_NTH(name, proto) name proto __THROW
9c9d63b1 553# define __LDBL_REDIR2_DECL(name)
c0c3707f
CB
554# define __LDBL_REDIR_DECL(name)
555# ifdef __REDIRECT
556# define __REDIRECT_LDBL(name, proto, alias) __REDIRECT (name, proto, alias)
557# define __REDIRECT_NTH_LDBL(name, proto, alias) \
558 __REDIRECT_NTH (name, proto, alias)
559# endif
560#endif
561
562/* __glibc_macro_warning (MESSAGE) issues warning MESSAGE. This is
563 intended for use in preprocessor macros.
564
565 Note: MESSAGE must be a _single_ string; concatenation of string
566 literals is not supported. */
567#if __GNUC_PREREQ (4,8) || __glibc_clang_prereq (3,5)
568# define __glibc_macro_warning1(message) _Pragma (#message)
569# define __glibc_macro_warning(message) \
570 __glibc_macro_warning1 (GCC warning message)
571#else
572# define __glibc_macro_warning(msg)
573#endif
574
575/* Generic selection (ISO C11) is a C-only feature, available in GCC
576 since version 4.9. Previous versions do not provide generic
577 selection, even though they might set __STDC_VERSION__ to 201112L,
578 when in -std=c11 mode. Thus, we must check for !defined __GNUC__
579 when testing __STDC_VERSION__ for generic selection support.
580 On the other hand, Clang also defines __GNUC__, so a clang-specific
581 check is required to enable the use of generic selection. */
582#if !defined __cplusplus \
583 && (__GNUC_PREREQ (4, 9) \
584 || __glibc_clang_has_extension (c_generic_selections) \
585 || (!defined __GNUC__ && defined __STDC_VERSION__ \
586 && __STDC_VERSION__ >= 201112L))
587# define __HAVE_GENERIC_SELECTION 1
588#else
589# define __HAVE_GENERIC_SELECTION 0
590#endif
591
9c9d63b1
PM
592#if __GNUC_PREREQ (10, 0)
593/* Designates a 1-based positional argument ref-index of pointer type
594 that can be used to access size-index elements of the pointed-to
595 array according to access mode, or at least one element when
596 size-index is not provided:
597 access (access-mode, <ref-index> [, <size-index>]) */
598#define __attr_access(x) __attribute__ ((__access__ x))
599#else
600# define __attr_access(x)
601#endif
602
603/* Specify that a function such as setjmp or vfork may return
604 twice. */
605#if __GNUC_PREREQ (4, 1)
606# define __attribute_returns_twice__ __attribute__ ((__returns_twice__))
607#else
608# define __attribute_returns_twice__ /* Ignore. */
609#endif
610
c0c3707f 611#endif /* sys/cdefs.h */
This page took 0.1026 seconds and 4 git commands to generate.