| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
#ifndef _SYS_CDEFS_H |
| 19 |
#define _SYS_CDEFS_H 1 |
| 20 |
|
| 21 |
|
| 22 |
#ifndef _FEATURES_H |
| 23 |
# include <features.h> |
| 24 |
#endif |
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
#if defined __GNUC__ && !defined __STDC__ |
| 30 |
# error "You need a ISO C conforming compiler to use the glibc headers" |
| 31 |
#endif |
| 32 |
|
| 33 |
|
| 34 |
#undef __P |
| 35 |
#undef __PMT |
| 36 |
|
| 37 |
#ifdef __GNUC__ |
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
# if __GNUC_PREREQ (4, 6) && !defined _LIBC |
| 42 |
# define __LEAF , __leaf__ |
| 43 |
# define __LEAF_ATTR __attribute__ ((__leaf__)) |
| 44 |
# else |
| 45 |
# define __LEAF |
| 46 |
# define __LEAF_ATTR |
| 47 |
# endif |
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
# if !defined __cplusplus && __GNUC_PREREQ (3, 3) |
| 55 |
# define __THROW __attribute__ ((__nothrow__ __LEAF)) |
| 56 |
# define __THROWNL __attribute__ ((__nothrow__)) |
| 57 |
# define __NTH(fct) __attribute__ ((__nothrow__ __LEAF)) fct |
| 58 |
# define __NTHNL(fct) __attribute__ ((__nothrow__)) fct |
| 59 |
# else |
| 60 |
# if defined __cplusplus && __GNUC_PREREQ (2,8) |
| 61 |
# define __THROW throw () |
| 62 |
# define __THROWNL throw () |
| 63 |
# define __NTH(fct) __LEAF_ATTR fct throw () |
| 64 |
# define __NTHNL(fct) fct throw () |
| 65 |
# else |
| 66 |
# define __THROW |
| 67 |
# define __THROWNL |
| 68 |
# define __NTH(fct) fct |
| 69 |
# define __NTHNL(fct) fct |
| 70 |
# endif |
| 71 |
# endif |
| 72 |
|
| 73 |
#else |
| 74 |
|
| 75 |
# if (defined __cplusplus \ |
| 76 |
|| (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)) |
| 77 |
# define __inline inline |
| 78 |
# else |
| 79 |
# define __inline |
| 80 |
# endif |
| 81 |
|
| 82 |
# define __THROW |
| 83 |
# define __THROWNL |
| 84 |
# define __NTH(fct) fct |
| 85 |
|
| 86 |
#endif |
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
#if defined __clang__ && defined __has_extension |
| 92 |
# define __glibc_clang_has_extension(ext) __has_extension (ext) |
| 93 |
#else |
| 94 |
# define __glibc_clang_has_extension(ext) 0 |
| 95 |
#endif |
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
#define __P(args) args |
| 100 |
#define __PMT(args) args |
| 101 |
|
| 102 |
|
| 103 |
|
| 104 |
|
| 105 |
#define __CONCAT(x,y) x ## y |
| 106 |
#define __STRING(x) #x |
| 107 |
|
| 108 |
|
| 109 |
#define __ptr_t void * |
| 110 |
|
| 111 |
|
| 112 |
|
| 113 |
#ifdef __cplusplus |
| 114 |
# define __BEGIN_DECLS extern "C" { |
| 115 |
# define __END_DECLS } |
| 116 |
#else |
| 117 |
# define __BEGIN_DECLS |
| 118 |
# define __END_DECLS |
| 119 |
#endif |
| 120 |
|
| 121 |
|
| 122 |
|
| 123 |
#define __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1) |
| 124 |
#define __bos0(ptr) __builtin_object_size (ptr, 0) |
| 125 |
|
| 126 |
#if __GNUC_PREREQ (4,3) |
| 127 |
# define __warndecl(name, msg) \ |
| 128 |
extern void name (void) __attribute__((__warning__ (msg))) |
| 129 |
# define __warnattr(msg) __attribute__((__warning__ (msg))) |
| 130 |
# define __errordecl(name, msg) \ |
| 131 |
extern void name (void) __attribute__((__error__ (msg))) |
| 132 |
#else |
| 133 |
# define __warndecl(name, msg) extern void name (void) |
| 134 |
# define __warnattr(msg) |
| 135 |
# define __errordecl(name, msg) extern void name (void) |
| 136 |
#endif |
| 137 |
|
| 138 |
|
| 139 |
|
| 140 |
|
| 141 |
|
| 142 |
#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L && !defined __HP_cc |
| 143 |
# define __flexarr [] |
| 144 |
# define __glibc_c99_flexarr_available 1 |
| 145 |
#elif __GNUC_PREREQ (2,97) |
| 146 |
|
| 147 |
|
| 148 |
# define __flexarr [] |
| 149 |
# define __glibc_c99_flexarr_available 1 |
| 150 |
#elif defined __GNUC__ |
| 151 |
|
| 152 |
|
| 153 |
# define __flexarr [0] |
| 154 |
# define __glibc_c99_flexarr_available 1 |
| 155 |
#else |
| 156 |
|
| 157 |
# define __flexarr [1] |
| 158 |
# define __glibc_c99_flexarr_available 0 |
| 159 |
#endif |
| 160 |
|
| 161 |
|
| 162 |
|
| 163 |
|
| 164 |
|
| 165 |
|
| 166 |
|
| 167 |
|
| 168 |
|
| 169 |
|
| 170 |
|
| 171 |
|
| 172 |
#if defined __GNUC__ && __GNUC__ >= 2 |
| 173 |
|
| 174 |
# define __REDIRECT(name, proto, alias) name proto __asm__ (__ASMNAME (#alias)) |
| 175 |
# ifdef __cplusplus |
| 176 |
# define __REDIRECT_NTH(name, proto, alias) \ |
| 177 |
name proto __THROW __asm__ (__ASMNAME (#alias)) |
| 178 |
# define __REDIRECT_NTHNL(name, proto, alias) \ |
| 179 |
name proto __THROWNL __asm__ (__ASMNAME (#alias)) |
| 180 |
# else |
| 181 |
# define __REDIRECT_NTH(name, proto, alias) \ |
| 182 |
name proto __asm__ (__ASMNAME (#alias)) __THROW |
| 183 |
# define __REDIRECT_NTHNL(name, proto, alias) \ |
| 184 |
name proto __asm__ (__ASMNAME (#alias)) __THROWNL |
| 185 |
# endif |
| 186 |
# define __ASMNAME(cname) __ASMNAME2 (__USER_LABEL_PREFIX__, cname) |
| 187 |
# define __ASMNAME2(prefix, cname) __STRING (prefix) cname |
| 188 |
|
| 189 |
|
| 190 |
|
| 191 |
|
| 192 |
|
| 193 |
|
| 194 |
|
| 195 |
#endif |
| 196 |
|
| 197 |
|
| 198 |
|
| 199 |
|
| 200 |
#if !defined __GNUC__ || __GNUC__ < 2 |
| 201 |
# define __attribute__(xyz) |
| 202 |
#endif |
| 203 |
|
| 204 |
|
| 205 |
|
| 206 |
|
| 207 |
#if __GNUC_PREREQ (2,96) |
| 208 |
# define __attribute_malloc__ __attribute__ ((__malloc__)) |
| 209 |
#else |
| 210 |
# define __attribute_malloc__ |
| 211 |
#endif |
| 212 |
|
| 213 |
|
| 214 |
|
| 215 |
#if __GNUC_PREREQ (4, 3) |
| 216 |
# define __attribute_alloc_size__(params) \ |
| 217 |
__attribute__ ((__alloc_size__ params)) |
| 218 |
#else |
| 219 |
# define __attribute_alloc_size__(params) |
| 220 |
#endif |
| 221 |
|
| 222 |
|
| 223 |
|
| 224 |
|
| 225 |
#if __GNUC_PREREQ (2,96) |
| 226 |
# define __attribute_pure__ __attribute__ ((__pure__)) |
| 227 |
#else |
| 228 |
# define __attribute_pure__ |
| 229 |
#endif |
| 230 |
|
| 231 |
|
| 232 |
#if __GNUC_PREREQ (2,5) |
| 233 |
# define __attribute_const__ __attribute__ ((__const__)) |
| 234 |
#else |
| 235 |
# define __attribute_const__ |
| 236 |
#endif |
| 237 |
|
| 238 |
|
| 239 |
|
| 240 |
|
| 241 |
#if __GNUC_PREREQ (3,1) |
| 242 |
# define __attribute_used__ __attribute__ ((__used__)) |
| 243 |
# define __attribute_noinline__ __attribute__ ((__noinline__)) |
| 244 |
#else |
| 245 |
# define __attribute_used__ __attribute__ ((__unused__)) |
| 246 |
# define __attribute_noinline__ |
| 247 |
#endif |
| 248 |
|
| 249 |
|
| 250 |
#if __GNUC_PREREQ (3,2) |
| 251 |
# define __attribute_deprecated__ __attribute__ ((__deprecated__)) |
| 252 |
#else |
| 253 |
# define __attribute_deprecated__ |
| 254 |
#endif |
| 255 |
|
| 256 |
|
| 257 |
|
| 258 |
|
| 259 |
#if __GNUC_PREREQ (4,5) || \ |
| 260 |
__glibc_clang_has_extension (__attribute_deprecated_with_message__) |
| 261 |
# define __attribute_deprecated_msg__(msg) \ |
| 262 |
__attribute__ ((__deprecated__ (msg))) |
| 263 |
#else |
| 264 |
# define __attribute_deprecated_msg__(msg) __attribute_deprecated__ |
| 265 |
#endif |
| 266 |
|
| 267 |
|
| 268 |
|
| 269 |
|
| 270 |
|
| 271 |
|
| 272 |
|
| 273 |
#if __GNUC_PREREQ (2,8) |
| 274 |
# define __attribute_format_arg__(x) __attribute__ ((__format_arg__ (x))) |
| 275 |
#else |
| 276 |
# define __attribute_format_arg__(x) |
| 277 |
#endif |
| 278 |
|
| 279 |
|
| 280 |
|
| 281 |
|
| 282 |
|
| 283 |
#if __GNUC_PREREQ (2,97) |
| 284 |
# define __attribute_format_strfmon__(a,b) \ |
| 285 |
__attribute__ ((__format__ (__strfmon__, a, b))) |
| 286 |
#else |
| 287 |
# define __attribute_format_strfmon__(a,b) |
| 288 |
#endif |
| 289 |
|
| 290 |
|
| 291 |
|
| 292 |
|
| 293 |
#ifndef __nonnull |
| 294 |
# if __GNUC_PREREQ (3,3) |
| 295 |
# define __nonnull(params) __attribute__ ((__nonnull__ params)) |
| 296 |
# else |
| 297 |
# define __nonnull(params) |
| 298 |
# endif |
| 299 |
#endif |
| 300 |
|
| 301 |
|
| 302 |
|
| 303 |
#if __GNUC_PREREQ (3,4) |
| 304 |
# define __attribute_warn_unused_result__ \ |
| 305 |
__attribute__ ((__warn_unused_result__)) |
| 306 |
# if defined __USE_FORTIFY_LEVEL && __USE_FORTIFY_LEVEL > 0 |
| 307 |
# define __wur __attribute_warn_unused_result__ |
| 308 |
# endif |
| 309 |
#else |
| 310 |
# define __attribute_warn_unused_result__ |
| 311 |
#endif |
| 312 |
#ifndef __wur |
| 313 |
# define __wur |
| 314 |
#endif |
| 315 |
|
| 316 |
|
| 317 |
#if __GNUC_PREREQ (3,2) |
| 318 |
|
| 319 |
|
| 320 |
|
| 321 |
# undef __always_inline |
| 322 |
# define __always_inline __inline __attribute__ ((__always_inline__)) |
| 323 |
#else |
| 324 |
# undef __always_inline |
| 325 |
# define __always_inline __inline |
| 326 |
#endif |
| 327 |
|
| 328 |
|
| 329 |
|
| 330 |
#if __GNUC_PREREQ (4,3) |
| 331 |
# define __attribute_artificial__ __attribute__ ((__artificial__)) |
| 332 |
#else |
| 333 |
# define __attribute_artificial__ |
| 334 |
#endif |
| 335 |
|
| 336 |
|
| 337 |
|
| 338 |
|
| 339 |
|
| 340 |
|
| 341 |
|
| 342 |
|
| 343 |
|
| 344 |
|
| 345 |
#if (!defined __cplusplus || __GNUC_PREREQ (4,3) \ |
| 346 |
|| (defined __clang__ && (defined __GNUC_STDC_INLINE__ \ |
| 347 |
|| defined __GNUC_GNU_INLINE__))) |
| 348 |
# if defined __GNUC_STDC_INLINE__ || defined __cplusplus |
| 349 |
# define __extern_inline extern __inline __attribute__ ((__gnu_inline__)) |
| 350 |
# define __extern_always_inline \ |
| 351 |
extern __always_inline __attribute__ ((__gnu_inline__)) |
| 352 |
# else |
| 353 |
# define __extern_inline extern __inline |
| 354 |
# define __extern_always_inline extern __always_inline |
| 355 |
# endif |
| 356 |
#endif |
| 357 |
|
| 358 |
#ifdef __extern_always_inline |
| 359 |
# define __fortify_function __extern_always_inline __attribute_artificial__ |
| 360 |
#endif |
| 361 |
|
| 362 |
|
| 363 |
|
| 364 |
#if __GNUC_PREREQ (4,3) |
| 365 |
# define __va_arg_pack() __builtin_va_arg_pack () |
| 366 |
# define __va_arg_pack_len() __builtin_va_arg_pack_len () |
| 367 |
#endif |
| 368 |
|
| 369 |
|
| 370 |
|
| 371 |
|
| 372 |
|
| 373 |
#if !__GNUC_PREREQ (2,8) |
| 374 |
# define __extension__ |
| 375 |
#endif |
| 376 |
|
| 377 |
|
| 378 |
#if !__GNUC_PREREQ (2,92) |
| 379 |
# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L |
| 380 |
# define __restrict restrict |
| 381 |
# else |
| 382 |
# define __restrict |
| 383 |
# endif |
| 384 |
#endif |
| 385 |
|
| 386 |
|
| 387 |
|
| 388 |
|
| 389 |
#if __GNUC_PREREQ (3,1) && !defined __GNUG__ |
| 390 |
# define __restrict_arr __restrict |
| 391 |
#else |
| 392 |
# ifdef __GNUC__ |
| 393 |
# define __restrict_arr |
| 394 |
# else |
| 395 |
# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L |
| 396 |
# define __restrict_arr restrict |
| 397 |
# else |
| 398 |
|
| 399 |
# define __restrict_arr |
| 400 |
# endif |
| 401 |
# endif |
| 402 |
#endif |
| 403 |
|
| 404 |
#if __GNUC__ >= 3 |
| 405 |
# define __glibc_unlikely(cond) __builtin_expect ((cond), 0) |
| 406 |
# define __glibc_likely(cond) __builtin_expect ((cond), 1) |
| 407 |
#else |
| 408 |
# define __glibc_unlikely(cond) (cond) |
| 409 |
# define __glibc_likely(cond) (cond) |
| 410 |
#endif |
| 411 |
|
| 412 |
#ifdef __has_attribute |
| 413 |
# define __glibc_has_attribute(attr) __has_attribute (attr) |
| 414 |
#else |
| 415 |
# define __glibc_has_attribute(attr) 0 |
| 416 |
#endif |
| 417 |
|
| 418 |
#if (!defined _Noreturn \ |
| 419 |
&& (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \ |
| 420 |
&& !__GNUC_PREREQ (4,7)) |
| 421 |
# if __GNUC_PREREQ (2,8) |
| 422 |
# define _Noreturn __attribute__ ((__noreturn__)) |
| 423 |
# else |
| 424 |
# define _Noreturn |
| 425 |
# endif |
| 426 |
#endif |
| 427 |
|
| 428 |
#if __GNUC_PREREQ (8, 0) |
| 429 |
|
| 430 |
|
| 431 |
|
| 432 |
# define __attribute_nonstring__ __attribute__ ((__nonstring__)) |
| 433 |
#else |
| 434 |
# define __attribute_nonstring__ |
| 435 |
#endif |
| 436 |
|
| 437 |
#if (!defined _Static_assert && !defined __cplusplus \ |
| 438 |
&& (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \ |
| 439 |
&& (!__GNUC_PREREQ (4, 6) || defined __STRICT_ANSI__)) |
| 440 |
# define _Static_assert(expr, diagnostic) \ |
| 441 |
extern int (*__Static_assert_function (void)) \ |
| 442 |
[!!sizeof (struct { int __error_if_negative: (expr) ? 2 : -1; })] |
| 443 |
#endif |
| 444 |
|
| 445 |
|
| 446 |
|
| 447 |
#ifndef __WORDSIZE |
| 448 |
# include <bits/wordsize.h> |
| 449 |
# include <bits/long-double.h> |
| 450 |
#endif |
| 451 |
|
| 452 |
#if defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH |
| 453 |
# define __LDBL_COMPAT 1 |
| 454 |
# ifdef __REDIRECT |
| 455 |
# define __LDBL_REDIR1(name, proto, alias) __REDIRECT (name, proto, alias) |
| 456 |
# define __LDBL_REDIR(name, proto) \ |
| 457 |
__LDBL_REDIR1 (name, proto, __nldbl_##name) |
| 458 |
# define __LDBL_REDIR1_NTH(name, proto, alias) __REDIRECT_NTH (name, proto, alias) |
| 459 |
# define __LDBL_REDIR_NTH(name, proto) \ |
| 460 |
__LDBL_REDIR1_NTH (name, proto, __nldbl_##name) |
| 461 |
# define __LDBL_REDIR1_DECL(name, alias) \ |
| 462 |
extern __typeof (name) name __asm (__ASMNAME (#alias)); |
| 463 |
# define __LDBL_REDIR_DECL(name) \ |
| 464 |
extern __typeof (name) name __asm (__ASMNAME ("__nldbl_" #name)); |
| 465 |
# define __REDIRECT_LDBL(name, proto, alias) \ |
| 466 |
__LDBL_REDIR1 (name, proto, __nldbl_##alias) |
| 467 |
# define __REDIRECT_NTH_LDBL(name, proto, alias) \ |
| 468 |
__LDBL_REDIR1_NTH (name, proto, __nldbl_##alias) |
| 469 |
# endif |
| 470 |
#endif |
| 471 |
#if !defined __LDBL_COMPAT || !defined __REDIRECT |
| 472 |
# define __LDBL_REDIR1(name, proto, alias) name proto |
| 473 |
# define __LDBL_REDIR(name, proto) name proto |
| 474 |
# define __LDBL_REDIR1_NTH(name, proto, alias) name proto __THROW |
| 475 |
# define __LDBL_REDIR_NTH(name, proto) name proto __THROW |
| 476 |
# define __LDBL_REDIR_DECL(name) |
| 477 |
# ifdef __REDIRECT |
| 478 |
# define __REDIRECT_LDBL(name, proto, alias) __REDIRECT (name, proto, alias) |
| 479 |
# define __REDIRECT_NTH_LDBL(name, proto, alias) \ |
| 480 |
__REDIRECT_NTH (name, proto, alias) |
| 481 |
# endif |
| 482 |
#endif |
| 483 |
|
| 484 |
|
| 485 |
|
| 486 |
|
| 487 |
|
| 488 |
|
| 489 |
#if __GNUC_PREREQ (4,8) || __glibc_clang_prereq (3,5) |
| 490 |
# define __glibc_macro_warning1(message) _Pragma (#message) |
| 491 |
# define __glibc_macro_warning(message) \ |
| 492 |
__glibc_macro_warning1 (GCC warning message) |
| 493 |
#else |
| 494 |
# define __glibc_macro_warning(msg) |
| 495 |
#endif |
| 496 |
|
| 497 |
|
| 498 |
|
| 499 |
|
| 500 |
|
| 501 |
|
| 502 |
|
| 503 |
|
| 504 |
#if !defined __cplusplus \ |
| 505 |
&& (__GNUC_PREREQ (4, 9) \ |
| 506 |
|| __glibc_clang_has_extension (c_generic_selections) \ |
| 507 |
|| (!defined __GNUC__ && defined __STDC_VERSION__ \ |
| 508 |
&& __STDC_VERSION__ >= 201112L)) |
| 509 |
# define __HAVE_GENERIC_SELECTION 1 |
| 510 |
#else |
| 511 |
# define __HAVE_GENERIC_SELECTION 0 |
| 512 |
#endif |
| 513 |
|
| 514 |
#endif |