summary refs log tree commit diff
path: root/pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2019-03-05 20:23:43 -0500
committerMatthew Bauer <mjbauer95@gmail.com>2019-04-26 21:54:53 -0400
commit565f28fba718827251411f4b7868d84f81fd5f2a (patch)
treef09b56a558aafe93762ee742a287edaab9daa695 /pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix
parent27498cd2d1fca5bf34c2da0785482d04f53d1efb (diff)
downloadnixpkgs-565f28fba718827251411f4b7868d84f81fd5f2a.tar
nixpkgs-565f28fba718827251411f4b7868d84f81fd5f2a.tar.gz
nixpkgs-565f28fba718827251411f4b7868d84f81fd5f2a.tar.bz2
nixpkgs-565f28fba718827251411f4b7868d84f81fd5f2a.tar.lz
nixpkgs-565f28fba718827251411f4b7868d84f81fd5f2a.tar.xz
nixpkgs-565f28fba718827251411f4b7868d84f81fd5f2a.tar.zst
nixpkgs-565f28fba718827251411f4b7868d84f81fd5f2a.zip
Libsystem: add os/availability.h
Diffstat (limited to 'pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix')
-rw-r--r--pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix22
1 files changed, 22 insertions, 0 deletions
diff --git a/pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix b/pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix
index a0edfbbb3b5..89fc01c36f5 100644
--- a/pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix
+++ b/pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix
@@ -29,6 +29,28 @@ appleDerivation rec {
 
     (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
     #ifndef __TARGETCONDITIONALS__
     #define __TARGETCONDITIONALS__