Libsystem: add os/availability.h

This commit is contained in:
Matthew Bauer 2019-03-05 20:23:43 -05:00
parent 27498cd2d1
commit 565f28fba7

View file

@ -29,6 +29,28 @@ appleDerivation rec {
(cd ${cctools.dev}/include/mach-o && find . -name '*.h' | cpio -pdm $out/include/mach-o) (cd ${cctools.dev}/include/mach-o && find . -name '*.h' | cpio -pdm $out/include/mach-o)
mkdir -p $out/include/os
cat <<EOF > $out/include/os/availability.h
#ifndef __OS_AVAILABILITY__
#define __OS_AVAILABILITY__
#include <AvailabilityInternal.h>
#if defined(__has_feature) && defined(__has_attribute) && __has_attribute(availability)
#define API_AVAILABLE(...) __API_AVAILABLE_GET_MACRO(__VA_ARGS__, __API_AVAILABLE4, __API_AVAILABLE3, __API_AVAILABLE2, __API_AVAILABLE1)(__VA_ARGS__)
#define API_DEPRECATED(...) __API_DEPRECATED_MSG_GET_MACRO(__VA_ARGS__, __API_DEPRECATED_MSG5, __API_DEPRECATED_MSG4, __API_DEPRECATED_MSG3, __API_DEPRECATED_MSG2, __API_DEPRECATED_MSG1)(__VA_ARGS__)
#define API_DEPRECATED_WITH_REPLACEMENT(...) __API_DEPRECATED_REP_GET_MACRO(__VA_ARGS__, __API_DEPRECATED_REP5, __API_DEPRECATED_REP4, __API_DEPRECATED_REP3, __API_DEPRECATED_REP2, __API_DEPRECATED_REP1)(__VA_ARGS__)
#define API_UNAVAILABLE(...) __API_UNAVAILABLE_GET_MACRO(__VA_ARGS__, __API_UNAVAILABLE3, __API_UNAVAILABLE2, __API_UNAVAILABLE1)(__VA_ARGS__)
#else
#define API_AVAILABLE(...)
#define API_DEPRECATED(...)
#define API_DEPRECATED_WITH_REPLACEMENT(...)
#define API_UNAVAILABLE(...)
#endif
#endif
EOF
cat <<EOF > $out/include/TargetConditionals.h cat <<EOF > $out/include/TargetConditionals.h
#ifndef __TARGETCONDITIONALS__ #ifndef __TARGETCONDITIONALS__
#define __TARGETCONDITIONALS__ #define __TARGETCONDITIONALS__