index b223afd058a938510fa89c47b6e15b2ae82ce866..21d59fa57a87789eab19625a28eac5ab90390b8c 100644 (file)
--- a/libc/include/sys/cdefs.h
+++ b/libc/include/sys/cdefs.h
#ifndef __has_builtin
#define __has_builtin(x) 0
#endif
+#ifndef __has_attribute
+#define __has_attribute(x) 0
+#endif
/*
#define __GNUC_PREREQ(x, y) 0
#endif
-#include <sys/cdefs_elf.h>
+#define __strong_alias(alias, sym) \
+ __asm__(".global " #alias "\n" \
+ #alias " = " #sym);
#if defined(__cplusplus)
#define __BEGIN_DECLS extern "C" {
#endif
#endif /* !(__STDC_VERSION__ >= 199901L) */
-#if defined(_KERNEL)
-#if defined(NO_KERNEL_RCSIDS)
-#undef __KERNEL_RCSID
-#define __KERNEL_RCSID(_n, _s) /* nothing */
-#endif /* NO_KERNEL_RCSIDS */
-#endif /* _KERNEL */
-
/*
* A barrier to stop the optimizer from moving code or assume live
* register values. This is gcc specific, the version is more or less
* do it in <sys/cdefs.h> instead because that's where our existing
* _POSIX_C_SOURCE tests were, and we're already confident that <sys/cdefs.h>
* is included everywhere it should be.
+ *
+ * The _GNU_SOURCE test needs to come before any _BSD_SOURCE or _POSIX* tests
+ * because _GNU_SOURCE implies everything else.
*/
-#if defined(_BSD_SOURCE)
-# define __USE_BSD 1
-#endif
-
#if defined(_GNU_SOURCE)
# define __USE_GNU 1
+# undef _POSIX_SOURCE
+# define _POSIX_SOURCE 1
+# undef _POSIX_C_SOURCE
+# define _POSIX_C_SOURCE 200809L
+# undef _BSD_SOURCE
+# define _BSD_SOURCE 1
+#endif
+
+#if defined(_BSD_SOURCE)
+# define __USE_BSD 1
#endif
/*-
#endif
#define __bos0(s) __builtin_object_size((s), 0)
+#if __GNUC_PREREQ(4,3) || __has_attribute(__artificial__)
+#define __BIONIC_FORTIFY_INLINE extern __inline__ __always_inline __attribute__((gnu_inline)) __attribute__((__artificial__))
+#else
#define __BIONIC_FORTIFY_INLINE extern __inline__ __always_inline __attribute__((gnu_inline))
#endif
+#endif
#define __BIONIC_FORTIFY_UNKNOWN_SIZE ((size_t) -1)
/* Used to tag non-static symbols that are private and never exposed by the shared library. */