Blame lib/cdefs.h

Packit 8f70b4
/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
Packit 8f70b4
   This file is part of the GNU C Library.
Packit 8f70b4
Packit 8f70b4
   The GNU C Library is free software; you can redistribute it and/or
Packit 8f70b4
   modify it under the terms of the GNU General Public
Packit 8f70b4
   License as published by the Free Software Foundation; either
Packit 8f70b4
   version 3 of the License, or (at your option) any later version.
Packit 8f70b4
Packit 8f70b4
   The GNU C Library is distributed in the hope that it will be useful,
Packit 8f70b4
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 8f70b4
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 8f70b4
   General Public License for more details.
Packit 8f70b4
Packit 8f70b4
   You should have received a copy of the GNU General Public
Packit 8f70b4
   License along with the GNU C Library; if not, see
Packit 8f70b4
   <https://www.gnu.org/licenses/>.  */
Packit 8f70b4
Packit 8f70b4
#ifndef	_SYS_CDEFS_H
Packit 8f70b4
#define	_SYS_CDEFS_H	1
Packit 8f70b4
Packit 8f70b4
/* We are almost always included from features.h. */
Packit 8f70b4
#ifndef _FEATURES_H
Packit 8f70b4
# include <features.h>
Packit 8f70b4
#endif
Packit 8f70b4
Packit 8f70b4
/* The GNU libc does not support any K&R compilers or the traditional mode
Packit 8f70b4
   of ISO C compilers anymore.  Check for some of the combinations not
Packit 8f70b4
   anymore supported.  */
Packit 8f70b4
#if defined __GNUC__ && !defined __STDC__
Packit 8f70b4
# error "You need a ISO C conforming compiler to use the glibc headers"
Packit 8f70b4
#endif
Packit 8f70b4
Packit 8f70b4
/* Some user header file might have defined this before.  */
Packit 8f70b4
#undef	__P
Packit 8f70b4
#undef	__PMT
Packit 8f70b4
Packit 8f70b4
#ifdef __GNUC__
Packit 8f70b4
Packit 8f70b4
/* All functions, except those with callbacks or those that
Packit 8f70b4
   synchronize memory, are leaf functions.  */
Packit 8f70b4
# if __GNUC_PREREQ (4, 6) && !defined _LIBC
Packit 8f70b4
#  define __LEAF , __leaf__
Packit 8f70b4
#  define __LEAF_ATTR __attribute__ ((__leaf__))
Packit 8f70b4
# else
Packit 8f70b4
#  define __LEAF
Packit 8f70b4
#  define __LEAF_ATTR
Packit 8f70b4
# endif
Packit 8f70b4
Packit 8f70b4
/* GCC can always grok prototypes.  For C++ programs we add throw()
Packit 8f70b4
   to help it optimize the function calls.  But this works only with
Packit 8f70b4
   gcc 2.8.x and egcs.  For gcc 3.2 and up we even mark C functions
Packit 8f70b4
   as non-throwing using a function attribute since programs can use
Packit 8f70b4
   the -fexceptions options for C code as well.  */
Packit 8f70b4
# if !defined __cplusplus && __GNUC_PREREQ (3, 3)
Packit 8f70b4
#  define __THROW	__attribute__ ((__nothrow__ __LEAF))
Packit 8f70b4
#  define __THROWNL	__attribute__ ((__nothrow__))
Packit 8f70b4
#  define __NTH(fct)	__attribute__ ((__nothrow__ __LEAF)) fct
Packit 8f70b4
#  define __NTHNL(fct)  __attribute__ ((__nothrow__)) fct
Packit 8f70b4
# else
Packit 8f70b4
#  if defined __cplusplus && __GNUC_PREREQ (2,8)
Packit 8f70b4
#   define __THROW	throw ()
Packit 8f70b4
#   define __THROWNL	throw ()
Packit 8f70b4
#   define __NTH(fct)	__LEAF_ATTR fct throw ()
Packit 8f70b4
#   define __NTHNL(fct) fct throw ()
Packit 8f70b4
#  else
Packit 8f70b4
#   define __THROW
Packit 8f70b4
#   define __THROWNL
Packit 8f70b4
#   define __NTH(fct)	fct
Packit 8f70b4
#   define __NTHNL(fct) fct
Packit 8f70b4
#  endif
Packit 8f70b4
# endif
Packit 8f70b4
Packit 8f70b4
#else	/* Not GCC.  */
Packit 8f70b4
Packit 8f70b4
# if (defined __cplusplus						\
Packit 8f70b4
      || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L))
Packit 8f70b4
#  define __inline	inline
Packit 8f70b4
# else
Packit 8f70b4
#  define __inline		/* No inline functions.  */
Packit 8f70b4
# endif
Packit 8f70b4
Packit 8f70b4
# define __THROW
Packit 8f70b4
# define __THROWNL
Packit 8f70b4
# define __NTH(fct)	fct
Packit 8f70b4
Packit 8f70b4
#endif	/* GCC.  */
Packit 8f70b4
Packit 8f70b4
/* Compilers that are not clang may object to
Packit 8f70b4
       #if defined __clang__ && __has_extension(...)
Packit 8f70b4
   even though they do not need to evaluate the right-hand side of the &&.  */
Packit 8f70b4
#if defined __clang__ && defined __has_extension
Packit 8f70b4
# define __glibc_clang_has_extension(ext) __has_extension (ext)
Packit 8f70b4
#else
Packit 8f70b4
# define __glibc_clang_has_extension(ext) 0
Packit 8f70b4
#endif
Packit 8f70b4
Packit 8f70b4
/* These two macros are not used in glibc anymore.  They are kept here
Packit 8f70b4
   only because some other projects expect the macros to be defined.  */
Packit 8f70b4
#define __P(args)	args
Packit 8f70b4
#define __PMT(args)	args
Packit 8f70b4
Packit 8f70b4
/* For these things, GCC behaves the ANSI way normally,
Packit 8f70b4
   and the non-ANSI way under -traditional.  */
Packit 8f70b4
Packit 8f70b4
#define __CONCAT(x,y)	x ## y
Packit 8f70b4
#define __STRING(x)	#x
Packit 8f70b4
Packit 8f70b4
/* This is not a typedef so `const __ptr_t' does the right thing.  */
Packit 8f70b4
#define __ptr_t void *
Packit 8f70b4
Packit 8f70b4
Packit 8f70b4
/* C++ needs to know that types and declarations are C, not C++.  */
Packit 8f70b4
#ifdef	__cplusplus
Packit 8f70b4
# define __BEGIN_DECLS	extern "C" {
Packit 8f70b4
# define __END_DECLS	}
Packit 8f70b4
#else
Packit 8f70b4
# define __BEGIN_DECLS
Packit 8f70b4
# define __END_DECLS
Packit 8f70b4
#endif
Packit 8f70b4
Packit 8f70b4
Packit 8f70b4
/* Fortify support.  */
Packit 8f70b4
#define __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1)
Packit 8f70b4
#define __bos0(ptr) __builtin_object_size (ptr, 0)
Packit 8f70b4
Packit 8f70b4
#if __GNUC_PREREQ (4,3)
Packit 8f70b4
# define __warndecl(name, msg) \
Packit 8f70b4
  extern void name (void) __attribute__((__warning__ (msg)))
Packit 8f70b4
# define __warnattr(msg) __attribute__((__warning__ (msg)))
Packit 8f70b4
# define __errordecl(name, msg) \
Packit 8f70b4
  extern void name (void) __attribute__((__error__ (msg)))
Packit 8f70b4
#else
Packit 8f70b4
# define __warndecl(name, msg) extern void name (void)
Packit 8f70b4
# define __warnattr(msg)
Packit 8f70b4
# define __errordecl(name, msg) extern void name (void)
Packit 8f70b4
#endif
Packit 8f70b4
Packit 8f70b4
/* Support for flexible arrays.
Packit 8f70b4
   Headers that should use flexible arrays only if they're "real"
Packit 8f70b4
   (e.g. only if they won't affect sizeof()) should test
Packit 8f70b4
   #if __glibc_c99_flexarr_available.  */
Packit 8f70b4
#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
Packit 8f70b4
# define __flexarr	[]
Packit 8f70b4
# define __glibc_c99_flexarr_available 1
Packit 8f70b4
#elif __GNUC_PREREQ (2,97)
Packit 8f70b4
/* GCC 2.97 supports C99 flexible array members as an extension,
Packit 8f70b4
   even when in C89 mode or compiling C++ (any version).  */
Packit 8f70b4
# define __flexarr	[]
Packit 8f70b4
# define __glibc_c99_flexarr_available 1
Packit 8f70b4
#elif defined __GNUC__
Packit 8f70b4
/* Pre-2.97 GCC did not support C99 flexible arrays but did have
Packit 8f70b4
   an equivalent extension with slightly different notation.  */
Packit 8f70b4
# define __flexarr	[0]
Packit 8f70b4
# define __glibc_c99_flexarr_available 1
Packit 8f70b4
#else
Packit 8f70b4
/* Some other non-C99 compiler.  Approximate with [1].  */
Packit 8f70b4
# define __flexarr	[1]
Packit 8f70b4
# define __glibc_c99_flexarr_available 0
Packit 8f70b4
#endif
Packit 8f70b4
Packit 8f70b4
Packit 8f70b4
/* __asm__ ("xyz") is used throughout the headers to rename functions
Packit 8f70b4
   at the assembly language level.  This is wrapped by the __REDIRECT
Packit 8f70b4
   macro, in order to support compilers that can do this some other
Packit 8f70b4
   way.  When compilers don't support asm-names at all, we have to do
Packit 8f70b4
   preprocessor tricks instead (which don't have exactly the right
Packit 8f70b4
   semantics, but it's the best we can do).
Packit 8f70b4
Packit 8f70b4
   Example:
Packit 8f70b4
   int __REDIRECT(setpgrp, (__pid_t pid, __pid_t pgrp), setpgid); */
Packit 8f70b4
Packit 8f70b4
#if defined __GNUC__ && __GNUC__ >= 2
Packit 8f70b4
Packit 8f70b4
# define __REDIRECT(name, proto, alias) name proto __asm__ (__ASMNAME (#alias))
Packit 8f70b4
# ifdef __cplusplus
Packit 8f70b4
#  define __REDIRECT_NTH(name, proto, alias) \
Packit 8f70b4
     name proto __THROW __asm__ (__ASMNAME (#alias))
Packit 8f70b4
#  define __REDIRECT_NTHNL(name, proto, alias) \
Packit 8f70b4
     name proto __THROWNL __asm__ (__ASMNAME (#alias))
Packit 8f70b4
# else
Packit 8f70b4
#  define __REDIRECT_NTH(name, proto, alias) \
Packit 8f70b4
     name proto __asm__ (__ASMNAME (#alias)) __THROW
Packit 8f70b4
#  define __REDIRECT_NTHNL(name, proto, alias) \
Packit 8f70b4
     name proto __asm__ (__ASMNAME (#alias)) __THROWNL
Packit 8f70b4
# endif
Packit 8f70b4
# define __ASMNAME(cname)  __ASMNAME2 (__USER_LABEL_PREFIX__, cname)
Packit 8f70b4
# define __ASMNAME2(prefix, cname) __STRING (prefix) cname
Packit 8f70b4
Packit 8f70b4
/*
Packit 8f70b4
#elif __SOME_OTHER_COMPILER__
Packit 8f70b4
Packit 8f70b4
# define __REDIRECT(name, proto, alias) name proto; \
Packit 8f70b4
	_Pragma("let " #name " = " #alias)
Packit 8f70b4
*/
Packit 8f70b4
#endif
Packit 8f70b4
Packit 8f70b4
/* GCC has various useful declarations that can be made with the
Packit 8f70b4
   `__attribute__' syntax.  All of the ways we use this do fine if
Packit 8f70b4
   they are omitted for compilers that don't understand it. */
Packit 8f70b4
#if !defined __GNUC__ || __GNUC__ < 2
Packit 8f70b4
# define __attribute__(xyz)	/* Ignore */
Packit 8f70b4
#endif
Packit 8f70b4
Packit 8f70b4
/* At some point during the gcc 2.96 development the `malloc' attribute
Packit 8f70b4
   for functions was introduced.  We don't want to use it unconditionally
Packit 8f70b4
   (although this would be possible) since it generates warnings.  */
Packit 8f70b4
#if __GNUC_PREREQ (2,96)
Packit 8f70b4
# define __attribute_malloc__ __attribute__ ((__malloc__))
Packit 8f70b4
#else
Packit 8f70b4
# define __attribute_malloc__ /* Ignore */
Packit 8f70b4
#endif
Packit 8f70b4
Packit 8f70b4
/* Tell the compiler which arguments to an allocation function
Packit 8f70b4
   indicate the size of the allocation.  */
Packit 8f70b4
#if __GNUC_PREREQ (4, 3)
Packit 8f70b4
# define __attribute_alloc_size__(params) \
Packit 8f70b4
  __attribute__ ((__alloc_size__ params))
Packit 8f70b4
#else
Packit 8f70b4
# define __attribute_alloc_size__(params) /* Ignore.  */
Packit 8f70b4
#endif
Packit 8f70b4
Packit 8f70b4
/* At some point during the gcc 2.96 development the `pure' attribute
Packit 8f70b4
   for functions was introduced.  We don't want to use it unconditionally
Packit 8f70b4
   (although this would be possible) since it generates warnings.  */
Packit 8f70b4
#if __GNUC_PREREQ (2,96)
Packit 8f70b4
# define __attribute_pure__ __attribute__ ((__pure__))
Packit 8f70b4
#else
Packit 8f70b4
# define __attribute_pure__ /* Ignore */
Packit 8f70b4
#endif
Packit 8f70b4
Packit 8f70b4
/* This declaration tells the compiler that the value is constant.  */
Packit 8f70b4
#if __GNUC_PREREQ (2,5)
Packit 8f70b4
# define __attribute_const__ __attribute__ ((__const__))
Packit 8f70b4
#else
Packit 8f70b4
# define __attribute_const__ /* Ignore */
Packit 8f70b4
#endif
Packit 8f70b4
Packit 8f70b4
/* At some point during the gcc 3.1 development the `used' attribute
Packit 8f70b4
   for functions was introduced.  We don't want to use it unconditionally
Packit 8f70b4
   (although this would be possible) since it generates warnings.  */
Packit 8f70b4
#if __GNUC_PREREQ (3,1)
Packit 8f70b4
# define __attribute_used__ __attribute__ ((__used__))
Packit 8f70b4
# define __attribute_noinline__ __attribute__ ((__noinline__))
Packit 8f70b4
#else
Packit 8f70b4
# define __attribute_used__ __attribute__ ((__unused__))
Packit 8f70b4
# define __attribute_noinline__ /* Ignore */
Packit 8f70b4
#endif
Packit 8f70b4
Packit 8f70b4
/* Since version 3.2, gcc allows marking deprecated functions.  */
Packit 8f70b4
#if __GNUC_PREREQ (3,2)
Packit 8f70b4
# define __attribute_deprecated__ __attribute__ ((__deprecated__))
Packit 8f70b4
#else
Packit 8f70b4
# define __attribute_deprecated__ /* Ignore */
Packit 8f70b4
#endif
Packit 8f70b4
Packit 8f70b4
/* Since version 4.5, gcc also allows one to specify the message printed
Packit 8f70b4
   when a deprecated function is used.  clang claims to be gcc 4.2, but
Packit 8f70b4
   may also support this feature.  */
Packit 8f70b4
#if __GNUC_PREREQ (4,5) || \
Packit 8f70b4
    __glibc_clang_has_extension (__attribute_deprecated_with_message__)
Packit 8f70b4
# define __attribute_deprecated_msg__(msg) \
Packit 8f70b4
	 __attribute__ ((__deprecated__ (msg)))
Packit 8f70b4
#else
Packit 8f70b4
# define __attribute_deprecated_msg__(msg) __attribute_deprecated__
Packit 8f70b4
#endif
Packit 8f70b4
Packit 8f70b4
/* At some point during the gcc 2.8 development the `format_arg' attribute
Packit 8f70b4
   for functions was introduced.  We don't want to use it unconditionally
Packit 8f70b4
   (although this would be possible) since it generates warnings.
Packit 8f70b4
   If several `format_arg' attributes are given for the same function, in
Packit 8f70b4
   gcc-3.0 and older, all but the last one are ignored.  In newer gccs,
Packit 8f70b4
   all designated arguments are considered.  */
Packit 8f70b4
#if __GNUC_PREREQ (2,8)
Packit 8f70b4
# define __attribute_format_arg__(x) __attribute__ ((__format_arg__ (x)))
Packit 8f70b4
#else
Packit 8f70b4
# define __attribute_format_arg__(x) /* Ignore */
Packit 8f70b4
#endif
Packit 8f70b4
Packit 8f70b4
/* At some point during the gcc 2.97 development the `strfmon' format
Packit 8f70b4
   attribute for functions was introduced.  We don't want to use it
Packit 8f70b4
   unconditionally (although this would be possible) since it
Packit 8f70b4
   generates warnings.  */
Packit 8f70b4
#if __GNUC_PREREQ (2,97)
Packit 8f70b4
# define __attribute_format_strfmon__(a,b) \
Packit 8f70b4
  __attribute__ ((__format__ (__strfmon__, a, b)))
Packit 8f70b4
#else
Packit 8f70b4
# define __attribute_format_strfmon__(a,b) /* Ignore */
Packit 8f70b4
#endif
Packit 8f70b4
Packit 8f70b4
/* The nonnull function attribute marks pointer parameters that
Packit 8f70b4
   must not be NULL.  Do not define __nonnull if it is already defined,
Packit 8f70b4
   for portability when this file is used in Gnulib.  */
Packit 8f70b4
#ifndef __nonnull
Packit 8f70b4
# if __GNUC_PREREQ (3,3)
Packit 8f70b4
#  define __nonnull(params) __attribute__ ((__nonnull__ params))
Packit 8f70b4
# else
Packit 8f70b4
#  define __nonnull(params)
Packit 8f70b4
# endif
Packit 8f70b4
#endif
Packit 8f70b4
Packit 8f70b4
/* If fortification mode, we warn about unused results of certain
Packit 8f70b4
   function calls which can lead to problems.  */
Packit 8f70b4
#if __GNUC_PREREQ (3,4)
Packit 8f70b4
# define __attribute_warn_unused_result__ \
Packit 8f70b4
   __attribute__ ((__warn_unused_result__))
Packit 8f70b4
# if defined __USE_FORTIFY_LEVEL && __USE_FORTIFY_LEVEL > 0
Packit 8f70b4
#  define __wur __attribute_warn_unused_result__
Packit 8f70b4
# endif
Packit 8f70b4
#else
Packit 8f70b4
# define __attribute_warn_unused_result__ /* empty */
Packit 8f70b4
#endif
Packit 8f70b4
#ifndef __wur
Packit 8f70b4
# define __wur /* Ignore */
Packit 8f70b4
#endif
Packit 8f70b4
Packit 8f70b4
/* Forces a function to be always inlined.  */
Packit 8f70b4
#if __GNUC_PREREQ (3,2)
Packit 8f70b4
/* The Linux kernel defines __always_inline in stddef.h (283d7573), and
Packit 8f70b4
   it conflicts with this definition.  Therefore undefine it first to
Packit 8f70b4
   allow either header to be included first.  */
Packit 8f70b4
# undef __always_inline
Packit 8f70b4
# define __always_inline __inline __attribute__ ((__always_inline__))
Packit 8f70b4
#else
Packit 8f70b4
# undef __always_inline
Packit 8f70b4
# define __always_inline __inline
Packit 8f70b4
#endif
Packit 8f70b4
Packit 8f70b4
/* Associate error messages with the source location of the call site rather
Packit 8f70b4
   than with the source location inside the function.  */
Packit 8f70b4
#if __GNUC_PREREQ (4,3)
Packit 8f70b4
# define __attribute_artificial__ __attribute__ ((__artificial__))
Packit 8f70b4
#else
Packit 8f70b4
# define __attribute_artificial__ /* Ignore */
Packit 8f70b4
#endif
Packit 8f70b4
Packit 8f70b4
/* GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99
Packit 8f70b4
   inline semantics, unless -fgnu89-inline is used.  Using __GNUC_STDC_INLINE__
Packit 8f70b4
   or __GNUC_GNU_INLINE is not a good enough check for gcc because gcc versions
Packit 8f70b4
   older than 4.3 may define these macros and still not guarantee GNU inlining
Packit 8f70b4
   semantics.
Packit 8f70b4
Packit 8f70b4
   clang++ identifies itself as gcc-4.2, but has support for GNU inlining
Packit 8f70b4
   semantics, that can be checked fot by using the __GNUC_STDC_INLINE_ and
Packit 8f70b4
   __GNUC_GNU_INLINE__ macro definitions.  */
Packit 8f70b4
#if (!defined __cplusplus || __GNUC_PREREQ (4,3) \
Packit 8f70b4
     || (defined __clang__ && (defined __GNUC_STDC_INLINE__ \
Packit 8f70b4
			       || defined __GNUC_GNU_INLINE__)))
Packit 8f70b4
# if defined __GNUC_STDC_INLINE__ || defined __cplusplus
Packit 8f70b4
#  define __extern_inline extern __inline __attribute__ ((__gnu_inline__))
Packit 8f70b4
#  define __extern_always_inline \
Packit 8f70b4
  extern __always_inline __attribute__ ((__gnu_inline__))
Packit 8f70b4
# else
Packit 8f70b4
#  define __extern_inline extern __inline
Packit 8f70b4
#  define __extern_always_inline extern __always_inline
Packit 8f70b4
# endif
Packit 8f70b4
#endif
Packit 8f70b4
Packit 8f70b4
#ifdef __extern_always_inline
Packit 8f70b4
# define __fortify_function __extern_always_inline __attribute_artificial__
Packit 8f70b4
#endif
Packit 8f70b4
Packit 8f70b4
/* GCC 4.3 and above allow passing all anonymous arguments of an
Packit 8f70b4
   __extern_always_inline function to some other vararg function.  */
Packit 8f70b4
#if __GNUC_PREREQ (4,3)
Packit 8f70b4
# define __va_arg_pack() __builtin_va_arg_pack ()
Packit 8f70b4
# define __va_arg_pack_len() __builtin_va_arg_pack_len ()
Packit 8f70b4
#endif
Packit 8f70b4
Packit 8f70b4
/* It is possible to compile containing GCC extensions even if GCC is
Packit 8f70b4
   run in pedantic mode if the uses are carefully marked using the
Packit 8f70b4
   `__extension__' keyword.  But this is not generally available before
Packit 8f70b4
   version 2.8.  */
Packit 8f70b4
#if !__GNUC_PREREQ (2,8)
Packit 8f70b4
# define __extension__		/* Ignore */
Packit 8f70b4
#endif
Packit 8f70b4
Packit 8f70b4
/* __restrict is known in EGCS 1.2 and above. */
Packit 8f70b4
#if !__GNUC_PREREQ (2,92)
Packit 8f70b4
# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
Packit 8f70b4
#  define __restrict	restrict
Packit 8f70b4
# else
Packit 8f70b4
#  define __restrict	/* Ignore */
Packit 8f70b4
# endif
Packit 8f70b4
#endif
Packit 8f70b4
Packit 8f70b4
/* ISO C99 also allows to declare arrays as non-overlapping.  The syntax is
Packit 8f70b4
     array_name[restrict]
Packit 8f70b4
   GCC 3.1 supports this.  */
Packit 8f70b4
#if __GNUC_PREREQ (3,1) && !defined __GNUG__
Packit 8f70b4
# define __restrict_arr	__restrict
Packit 8f70b4
#else
Packit 8f70b4
# ifdef __GNUC__
Packit 8f70b4
#  define __restrict_arr	/* Not supported in old GCC.  */
Packit 8f70b4
# else
Packit 8f70b4
#  if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
Packit 8f70b4
#   define __restrict_arr	restrict
Packit 8f70b4
#  else
Packit 8f70b4
/* Some other non-C99 compiler.  */
Packit 8f70b4
#   define __restrict_arr	/* Not supported.  */
Packit 8f70b4
#  endif
Packit 8f70b4
# endif
Packit 8f70b4
#endif
Packit 8f70b4
Packit 8f70b4
#if __GNUC__ >= 3
Packit 8f70b4
# define __glibc_unlikely(cond)	__builtin_expect ((cond), 0)
Packit 8f70b4
# define __glibc_likely(cond)	__builtin_expect ((cond), 1)
Packit 8f70b4
#else
Packit 8f70b4
# define __glibc_unlikely(cond)	(cond)
Packit 8f70b4
# define __glibc_likely(cond)	(cond)
Packit 8f70b4
#endif
Packit 8f70b4
Packit 8f70b4
#if (!defined _Noreturn \
Packit 8f70b4
     && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \
Packit 8f70b4
     &&  !__GNUC_PREREQ (4,7))
Packit 8f70b4
# if __GNUC_PREREQ (2,8)
Packit 8f70b4
#  define _Noreturn __attribute__ ((__noreturn__))
Packit 8f70b4
# else
Packit 8f70b4
#  define _Noreturn
Packit 8f70b4
# endif
Packit 8f70b4
#endif
Packit 8f70b4
Packit 8f70b4
#if __GNUC_PREREQ (8, 0)
Packit 8f70b4
/* Describes a char array whose address can safely be passed as the first
Packit 8f70b4
   argument to strncpy and strncat, as the char array is not necessarily
Packit 8f70b4
   a NUL-terminated string.  */
Packit 8f70b4
# define __attribute_nonstring__ __attribute__ ((__nonstring__))
Packit 8f70b4
#else
Packit 8f70b4
# define __attribute_nonstring__
Packit 8f70b4
#endif
Packit 8f70b4
Packit 8f70b4
#if (!defined _Static_assert && !defined __cplusplus \
Packit 8f70b4
     && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \
Packit 8f70b4
     && (!__GNUC_PREREQ (4, 6) || defined __STRICT_ANSI__))
Packit 8f70b4
# define _Static_assert(expr, diagnostic) \
Packit 8f70b4
    extern int (*__Static_assert_function (void)) \
Packit 8f70b4
      [!!sizeof (struct { int __error_if_negative: (expr) ? 2 : -1; })]
Packit 8f70b4
#endif
Packit 8f70b4
Packit 8f70b4
/* The #ifndef lets Gnulib avoid including these on non-glibc
Packit 8f70b4
   platforms, where the includes typically do not exist.  */
Packit 8f70b4
#ifndef __WORDSIZE
Packit 8f70b4
# include <bits/wordsize.h>
Packit 8f70b4
# include <bits/long-double.h>
Packit 8f70b4
#endif
Packit 8f70b4
Packit 8f70b4
#if defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH
Packit 8f70b4
# define __LDBL_COMPAT 1
Packit 8f70b4
# ifdef __REDIRECT
Packit 8f70b4
#  define __LDBL_REDIR1(name, proto, alias) __REDIRECT (name, proto, alias)
Packit 8f70b4
#  define __LDBL_REDIR(name, proto) \
Packit 8f70b4
  __LDBL_REDIR1 (name, proto, __nldbl_##name)
Packit 8f70b4
#  define __LDBL_REDIR1_NTH(name, proto, alias) __REDIRECT_NTH (name, proto, alias)
Packit 8f70b4
#  define __LDBL_REDIR_NTH(name, proto) \
Packit 8f70b4
  __LDBL_REDIR1_NTH (name, proto, __nldbl_##name)
Packit 8f70b4
#  define __LDBL_REDIR1_DECL(name, alias) \
Packit 8f70b4
  extern __typeof (name) name __asm (__ASMNAME (#alias));
Packit 8f70b4
#  define __LDBL_REDIR_DECL(name) \
Packit 8f70b4
  extern __typeof (name) name __asm (__ASMNAME ("__nldbl_" #name));
Packit 8f70b4
#  define __REDIRECT_LDBL(name, proto, alias) \
Packit 8f70b4
  __LDBL_REDIR1 (name, proto, __nldbl_##alias)
Packit 8f70b4
#  define __REDIRECT_NTH_LDBL(name, proto, alias) \
Packit 8f70b4
  __LDBL_REDIR1_NTH (name, proto, __nldbl_##alias)
Packit 8f70b4
# endif
Packit 8f70b4
#endif
Packit 8f70b4
#if !defined __LDBL_COMPAT || !defined __REDIRECT
Packit 8f70b4
# define __LDBL_REDIR1(name, proto, alias) name proto
Packit 8f70b4
# define __LDBL_REDIR(name, proto) name proto
Packit 8f70b4
# define __LDBL_REDIR1_NTH(name, proto, alias) name proto __THROW
Packit 8f70b4
# define __LDBL_REDIR_NTH(name, proto) name proto __THROW
Packit 8f70b4
# define __LDBL_REDIR_DECL(name)
Packit 8f70b4
# ifdef __REDIRECT
Packit 8f70b4
#  define __REDIRECT_LDBL(name, proto, alias) __REDIRECT (name, proto, alias)
Packit 8f70b4
#  define __REDIRECT_NTH_LDBL(name, proto, alias) \
Packit 8f70b4
  __REDIRECT_NTH (name, proto, alias)
Packit 8f70b4
# endif
Packit 8f70b4
#endif
Packit 8f70b4
Packit 8f70b4
/* __glibc_macro_warning (MESSAGE) issues warning MESSAGE.  This is
Packit 8f70b4
   intended for use in preprocessor macros.
Packit 8f70b4
Packit 8f70b4
   Note: MESSAGE must be a _single_ string; concatenation of string
Packit 8f70b4
   literals is not supported.  */
Packit 8f70b4
#if __GNUC_PREREQ (4,8) || __glibc_clang_prereq (3,5)
Packit 8f70b4
# define __glibc_macro_warning1(message) _Pragma (#message)
Packit 8f70b4
# define __glibc_macro_warning(message) \
Packit 8f70b4
  __glibc_macro_warning1 (GCC warning message)
Packit 8f70b4
#else
Packit 8f70b4
# define __glibc_macro_warning(msg)
Packit 8f70b4
#endif
Packit 8f70b4
Packit 8f70b4
/* Generic selection (ISO C11) is a C-only feature, available in GCC
Packit 8f70b4
   since version 4.9.  Previous versions do not provide generic
Packit 8f70b4
   selection, even though they might set __STDC_VERSION__ to 201112L,
Packit 8f70b4
   when in -std=c11 mode.  Thus, we must check for !defined __GNUC__
Packit 8f70b4
   when testing __STDC_VERSION__ for generic selection support.
Packit 8f70b4
   On the other hand, Clang also defines __GNUC__, so a clang-specific
Packit 8f70b4
   check is required to enable the use of generic selection.  */
Packit 8f70b4
#if !defined __cplusplus \
Packit 8f70b4
    && (__GNUC_PREREQ (4, 9) \
Packit 8f70b4
	|| __glibc_clang_has_extension (c_generic_selections) \
Packit 8f70b4
	|| (!defined __GNUC__ && defined __STDC_VERSION__ \
Packit 8f70b4
	    && __STDC_VERSION__ >= 201112L))
Packit 8f70b4
# define __HAVE_GENERIC_SELECTION 1
Packit 8f70b4
#else
Packit 8f70b4
# define __HAVE_GENERIC_SELECTION 0
Packit 8f70b4
#endif
Packit 8f70b4
Packit 8f70b4
#endif	 /* sys/cdefs.h */