Blame lib/libc-config.h

Packit 8f70b4
/* System definitions for code taken from the GNU C Library
Packit 8f70b4
Packit 8f70b4
   Copyright 2017-2018 Free Software Foundation, Inc.
Packit 8f70b4
Packit 8f70b4
   This program 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
   This program 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 this program; if not, see
Packit 8f70b4
   <https://www.gnu.org/licenses/>.  */
Packit 8f70b4
Packit 8f70b4
/* Written by Paul Eggert.  */
Packit 8f70b4
Packit 8f70b4
/* This is intended to be a good-enough substitute for glibc system
Packit 8f70b4
   macros like those defined in <sys/cdefs.h>, so that Gnulib code
Packit 8f70b4
   shared with glibc can do this as the first #include:
Packit 8f70b4
Packit 8f70b4
     #ifndef _LIBC
Packit 8f70b4
     # include <libc-config.h>
Packit 8f70b4
     #endif
Packit 8f70b4
Packit 8f70b4
   When compiled as part of glibc this is a no-op; when compiled as
Packit 8f70b4
   part of Gnulib this includes Gnulib's <config.h> and defines macros
Packit 8f70b4
   that glibc library code would normally assume.  */
Packit 8f70b4
Packit 8f70b4
#include <config.h>
Packit 8f70b4
Packit 8f70b4
/* On glibc this includes <features.h> and <sys/cdefs.h> and #defines
Packit 8f70b4
   _FEATURES_H, __WORDSIZE, and __set_errno.  On FreeBSD 11 it
Packit 8f70b4
   includes <sys/cdefs.h> which defines __nonnull.  Elsewhere it
Packit 8f70b4
   is harmless.  */
Packit 8f70b4
#include <errno.h>
Packit 8f70b4
Packit 8f70b4
/* From glibc <errno.h>.  */
Packit 8f70b4
#ifndef __set_errno
Packit 8f70b4
# define __set_errno(val) (errno = (val))
Packit 8f70b4
#endif
Packit 8f70b4
Packit 8f70b4
/* From glibc <features.h>.  */
Packit 8f70b4
Packit 8f70b4
#ifndef __GNUC_PREREQ
Packit 8f70b4
# if defined __GNUC__ && defined __GNUC_MINOR__
Packit 8f70b4
#  define __GNUC_PREREQ(maj, min) ((maj) < __GNUC__ + ((min) <= __GNUC_MINOR__))
Packit 8f70b4
# else
Packit 8f70b4
#  define __GNUC_PREREQ(maj, min) 0
Packit 8f70b4
# endif
Packit 8f70b4
#endif
Packit 8f70b4
Packit 8f70b4
#ifndef __glibc_clang_prereq
Packit 8f70b4
# if defined __clang_major__ && defined __clang_minor__
Packit 8f70b4
#  define __glibc_clang_prereq(maj, min) \
Packit 8f70b4
     ((maj) < __clang_major__ + ((min) <= __clang_minor__))
Packit 8f70b4
# else
Packit 8f70b4
#  define __glibc_clang_prereq(maj, min) 0
Packit 8f70b4
# endif
Packit 8f70b4
#endif
Packit 8f70b4
Packit 8f70b4
Packit 8f70b4
/* Prepare to include <cdefs.h>, which is our copy of glibc
Packit 8f70b4
   <sys/cdefs.h>.  */
Packit 8f70b4
Packit 8f70b4
/* Define _FEATURES_H so that <cdefs.h> does not include <features.h>.  */
Packit 8f70b4
#ifndef _FEATURES_H
Packit 8f70b4
# define _FEATURES_H 1
Packit 8f70b4
#endif
Packit 8f70b4
/* Define __WORDSIZE so that <cdefs.h> does not attempt to include
Packit 8f70b4
   nonexistent files.  Make it a syntax error, since Gnulib does not
Packit 8f70b4
   use __WORDSIZE now, and if Gnulib uses it later the syntax error
Packit 8f70b4
   will let us know that __WORDSIZE needs configuring.  */
Packit 8f70b4
#ifndef __WORDSIZE
Packit 8f70b4
# define __WORDSIZE %%%
Packit 8f70b4
#endif
Packit 8f70b4
/* Undef the macros unconditionally defined by our copy of glibc
Packit 8f70b4
   <sys/cdefs.h>, so that they do not clash with any system-defined
Packit 8f70b4
   versions.  */
Packit 8f70b4
#undef _SYS_CDEFS_H
Packit 8f70b4
#undef __ASMNAME
Packit 8f70b4
#undef __ASMNAME2
Packit 8f70b4
#undef __BEGIN_DECLS
Packit 8f70b4
#undef __CONCAT
Packit 8f70b4
#undef __END_DECLS
Packit 8f70b4
#undef __HAVE_GENERIC_SELECTION
Packit 8f70b4
#undef __LDBL_COMPAT
Packit 8f70b4
#undef __LDBL_REDIR
Packit 8f70b4
#undef __LDBL_REDIR1
Packit 8f70b4
#undef __LDBL_REDIR1_DECL
Packit 8f70b4
#undef __LDBL_REDIR1_NTH
Packit 8f70b4
#undef __LDBL_REDIR_DECL
Packit 8f70b4
#undef __LDBL_REDIR_NTH
Packit 8f70b4
#undef __LEAF
Packit 8f70b4
#undef __LEAF_ATTR
Packit 8f70b4
#undef __NTH
Packit 8f70b4
#undef __NTHNL
Packit 8f70b4
#undef __P
Packit 8f70b4
#undef __PMT
Packit 8f70b4
#undef __REDIRECT
Packit 8f70b4
#undef __REDIRECT_LDBL
Packit 8f70b4
#undef __REDIRECT_NTH
Packit 8f70b4
#undef __REDIRECT_NTHNL
Packit 8f70b4
#undef __REDIRECT_NTH_LDBL
Packit 8f70b4
#undef __STRING
Packit 8f70b4
#undef __THROW
Packit 8f70b4
#undef __THROWNL
Packit 8f70b4
#undef __always_inline
Packit 8f70b4
#undef __attribute__
Packit 8f70b4
#undef __attribute_alloc_size__
Packit 8f70b4
#undef __attribute_artificial__
Packit 8f70b4
#undef __attribute_const__
Packit 8f70b4
#undef __attribute_deprecated__
Packit 8f70b4
#undef __attribute_deprecated_msg__
Packit 8f70b4
#undef __attribute_format_arg__
Packit 8f70b4
#undef __attribute_format_strfmon__
Packit 8f70b4
#undef __attribute_malloc__
Packit 8f70b4
#undef __attribute_noinline__
Packit 8f70b4
#undef __attribute_nonstring__
Packit 8f70b4
#undef __attribute_pure__
Packit 8f70b4
#undef __attribute_used__
Packit 8f70b4
#undef __attribute_warn_unused_result__
Packit 8f70b4
#undef __bos
Packit 8f70b4
#undef __bos0
Packit 8f70b4
#undef __errordecl
Packit 8f70b4
#undef __extension__
Packit 8f70b4
#undef __extern_always_inline
Packit 8f70b4
#undef __extern_inline
Packit 8f70b4
#undef __flexarr
Packit 8f70b4
#undef __fortify_function
Packit 8f70b4
#undef __glibc_c99_flexarr_available
Packit 8f70b4
#undef __glibc_clang_has_extension
Packit 8f70b4
#undef __glibc_likely
Packit 8f70b4
#undef __glibc_macro_warning
Packit 8f70b4
#undef __glibc_macro_warning1
Packit 8f70b4
#undef __glibc_unlikely
Packit 8f70b4
#undef __inline
Packit 8f70b4
#undef __ptr_t
Packit 8f70b4
#undef __restrict
Packit 8f70b4
#undef __restrict_arr
Packit 8f70b4
#undef __va_arg_pack
Packit 8f70b4
#undef __va_arg_pack_len
Packit 8f70b4
#undef __warnattr
Packit 8f70b4
#undef __warndecl
Packit 8f70b4
Packit 8f70b4
/* Include our copy of glibc <sys/cdefs.h>.  */
Packit 8f70b4
#include <cdefs.h>
Packit 8f70b4
Packit 8f70b4
/* <cdefs.h> __inline is too pessimistic for non-GCC.  */
Packit 8f70b4
#undef __inline
Packit 8f70b4
#ifndef HAVE___INLINE
Packit 8f70b4
# if 199901 <= __STDC_VERSION__ || defined inline
Packit 8f70b4
#  define __inline inline
Packit 8f70b4
# else
Packit 8f70b4
#  define __inline
Packit 8f70b4
# endif
Packit 8f70b4
#endif
Packit 8f70b4
Packit 8f70b4
Packit 8f70b4
/* A substitute for glibc <libc-symbols.h>, good enough for Gnulib.  */
Packit 8f70b4
#define attribute_hidden
Packit 8f70b4
#define libc_hidden_proto(name, ...)
Packit 8f70b4
#define libc_hidden_def(name)
Packit 8f70b4
#define libc_hidden_weak(name)
Packit 8f70b4
#define libc_hidden_ver(local, name)
Packit 8f70b4
#define strong_alias(name, aliasname)
Packit 8f70b4
#define weak_alias(name, aliasname)
Packit 8f70b4
Packit 8f70b4
/* A substitute for glibc <shlib-compat.h>, good enough for Gnulib.  */
Packit 8f70b4
#define SHLIB_COMPAT(lib, introduced, obsoleted) 0
Packit 8f70b4
#define versioned_symbol(lib, local, symbol, version)