+/*
+ * __disable_tail_calls causes the compiler to not perform tail call
+ * optimization inside the marked function.
+ */
+#if __has_attribute(disable_tail_calls)
+#define __disable_tail_calls __attribute__((__disable_tail_calls__))
+#else
+#define __disable_tail_calls
+#endif
+
+/*
+ * __not_tail_called causes the compiler to prevent tail call optimization
+ * on statically bound calls to the function. It has no effect on indirect
+ * calls. Virtual functions, objective-c methods, and functions marked as
+ * "always_inline" cannot be marked as __not_tail_called.
+ */
+#if __has_attribute(not_tail_called)
+#define __not_tail_called __attribute__((__not_tail_called__))
+#else
+#define __not_tail_called
+#endif
+
+/*
+ * __result_use_check warns callers of a function that not using the function
+ * return value is a bug, i.e. dismissing malloc() return value results in a
+ * memory leak.
+ */
+#if __has_attribute(warn_unused_result)
+#define __result_use_check __attribute__((__warn_unused_result__))
+#else
+#define __result_use_check
+#endif
+
+/*
+ * __swift_unavailable causes the compiler to mark a symbol as specifically
+ * unavailable in Swift, regardless of any other availability in C.
+ */
+#if __has_feature(attribute_availability_swift)
+#define __swift_unavailable(_msg) __attribute__((__availability__(swift, unavailable, message=_msg)))
+#else
+#define __swift_unavailable(_msg)
+#endif
+
+/*
+ * __abortlike is the attribute to put on functions like abort() that are
+ * typically used to mark assertions. These optimize the codegen
+ * for outlining while still maintaining debugability.
+ */
+#ifndef __abortlike
+#define __abortlike __dead2 __cold __not_tail_called
+#endif
+
+/* Declaring inline functions within headers is error-prone due to differences
+ * across various versions of the C language and extensions. __header_inline
+ * can be used to declare inline functions within system headers. In cases
+ * where you want to force inlining instead of letting the compiler make
+ * the decision, you can use __header_always_inline.
+ *
+ * Be aware that using inline for functions which compilers may also provide
+ * builtins can behave differently under various compilers. If you intend to
+ * provide an inline version of such a function, you may want to use a macro
+ * instead.
+ *
+ * The check for !__GNUC__ || __clang__ is because gcc doesn't correctly
+ * support c99 inline in some cases:
+ * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55965
+ */
+
+#if defined(__cplusplus) || \
+ (__STDC_VERSION__ >= 199901L && \
+ !defined(__GNUC_GNU_INLINE__) && \
+ (!defined(__GNUC__) || defined(__clang__)))
+# define __header_inline inline
+#elif defined(__GNUC__) && defined(__GNUC_STDC_INLINE__)
+# define __header_inline extern __inline __attribute__((__gnu_inline__))
+#elif defined(__GNUC__)
+# define __header_inline extern __inline
+#else
+/* If we land here, we've encountered an unsupported compiler,
+ * so hopefully it understands static __inline as a fallback.
+ */
+# define __header_inline static __inline
+#endif
+
+#ifdef __GNUC__
+# define __header_always_inline __header_inline __attribute__ ((__always_inline__))
+#else
+/* Unfortunately, we're using a compiler that we don't know how to force to
+ * inline. Oh well.
+ */
+# define __header_always_inline __header_inline
+#endif
+
+/*
+ * Compiler-dependent macros that bracket portions of code where the
+ * "-Wunreachable-code" warning should be ignored. Please use sparingly.
+ */
+#if defined(__clang__)
+# define __unreachable_ok_push \
+ _Pragma("clang diagnostic push") \
+ _Pragma("clang diagnostic ignored \"-Wunreachable-code\"")
+# define __unreachable_ok_pop \
+ _Pragma("clang diagnostic pop")
+#elif defined(__GNUC__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
+# define __unreachable_ok_push \
+ _Pragma("GCC diagnostic push") \
+ _Pragma("GCC diagnostic ignored \"-Wunreachable-code\"")
+# define __unreachable_ok_pop \
+ _Pragma("GCC diagnostic pop")
+#else
+# define __unreachable_ok_push
+# define __unreachable_ok_pop
+#endif
+