Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Availability Headers #23

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Headers/Availability.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@

#include <AvailabilityVersions.h>
#include <AvailabilityInternal.h>
#include <AvailabilityInternalLegacy.h>
#if __has_include(<AvailabilityInternalPrivate.h>)
#include <AvailabilityInternalPrivate.h>
#endif

#ifdef __IPHONE_OS_VERSION_MIN_REQUIRED
#define __OSX_AVAILABLE_STARTING(_osx, _ios) __AVAILABILITY_INTERNAL##_ios
Expand Down Expand Up @@ -557,3 +561,4 @@
#endif

#endif /* __AVAILABILITY__ */

52 changes: 21 additions & 31 deletions Headers/AvailabilityInternal.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,41 +30,39 @@
#ifndef __AVAILABILITY_INTERNAL__
#define __AVAILABILITY_INTERNAL__

#if __has_include(<AvailabilityInternalPrivate.h>)
#include <AvailabilityInternalPrivate.h>
#endif
#include <AvailabilityVersions.h>

#ifndef __MAC_OS_X_VERSION_MIN_REQUIRED
#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
/* compiler for Mac OS X sets __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ */
#define __MAC_OS_X_VERSION_MIN_REQUIRED __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
#define __MAC_OS_X_VERSION_MAX_ALLOWED __MAC_14_5
#define __MAC_OS_X_VERSION_MAX_ALLOWED __MAC_15_2
#endif
#endif /* __MAC_OS_X_VERSION_MIN_REQUIRED */

#ifndef __IPHONE_OS_VERSION_MIN_REQUIRED
#if defined(__has_builtin) && __has_builtin(__is_target_os)
#if __is_target_os(ios)
#define __IPHONE_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__
#define __IPHONE_OS_VERSION_MAX_ALLOWED __IPHONE_17_5
#define __IPHONE_OS_VERSION_MAX_ALLOWED __IPHONE_18_2
#endif
#elif __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__
#define __IPHONE_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__
#define __IPHONE_OS_VERSION_MAX_ALLOWED __IPHONE_17_5
#define __IPHONE_OS_VERSION_MAX_ALLOWED __IPHONE_18_2
#endif /* __has_builtin(__is_target_os) && __is_target_os(ios) */
#endif /* __IPHONE_OS_VERSION_MIN_REQUIRED */

#ifndef __WATCH_OS_VERSION_MIN_REQUIRED
#if defined(__has_builtin) && __has_builtin(__is_target_os)
#if __is_target_os(watchos)
#define __WATCH_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__
#define __WATCH_OS_VERSION_MAX_ALLOWED __WATCHOS_10_5
#define __WATCH_OS_VERSION_MAX_ALLOWED __WATCHOS_11_2
/* for compatibility with existing code. New code should use platform specific checks */
#define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_9_0
#endif
#elif __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__
#define __WATCH_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__
#define __WATCH_OS_VERSION_MAX_ALLOWED __WATCHOS_10_5
#define __WATCH_OS_VERSION_MAX_ALLOWED __WATCHOS_11_2
/* for compatibility with existing code. New code should use platform specific checks */
#define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_9_0
#endif /* __has_builtin(__is_target_os) && __is_target_os(watchos) */
Expand All @@ -74,13 +72,13 @@
#if defined(__has_builtin) && __has_builtin(__is_target_os)
#if __is_target_os(tvos)
#define __TV_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__
#define __TV_OS_VERSION_MAX_ALLOWED __TVOS_17_5
#define __TV_OS_VERSION_MAX_ALLOWED __TVOS_18_2
/* for compatibility with existing code. New code should use platform specific checks */
#define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_9_0
#endif
#elif __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__
#define __TV_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__
#define __TV_OS_VERSION_MAX_ALLOWED __TVOS_17_5
#define __TV_OS_VERSION_MAX_ALLOWED __TVOS_18_2
/* for compatibility with existing code. New code should use platform specific checks */
#define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_9_0
#endif /* __has_builtin(__is_target_os) && __is_target_os(tvos) */
Expand All @@ -90,7 +88,7 @@
#if defined(__has_builtin) && __has_builtin(__is_target_os)
#if __is_target_os(bridgeos)
#define __BRIDGE_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__
#define __BRIDGE_OS_VERSION_MAX_ALLOWED __BRIDGEOS_8_5
#define __BRIDGE_OS_VERSION_MAX_ALLOWED __BRIDGEOS_9_2
/* for compatibility with existing code. New code should use platform specific checks */
#define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_11_0
#endif
Expand All @@ -101,7 +99,7 @@
#if defined(__has_builtin) && __has_builtin(__is_target_os)
#if __is_target_os(driverkit)
#define __DRIVERKIT_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__
#define __DRIVERKIT_VERSION_MAX_ALLOWED __DRIVERKIT_23_5
#define __DRIVERKIT_VERSION_MAX_ALLOWED __DRIVERKIT_24_2
#endif
#endif /* __has_builtin(__is_target_os) && __is_target_os(driverkit) */
#endif /* __DRIVERKIT_VERSION_MIN_REQUIRED */
Expand All @@ -110,7 +108,7 @@
#if defined(__has_builtin) && __has_builtin(__is_target_os)
#if __is_target_os(visionos)
#define __VISION_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__
#define __VISION_OS_VERSION_MAX_ALLOWED __VISIONOS_1_2
#define __VISION_OS_VERSION_MAX_ALLOWED __VISIONOS_2_2
/* for compatibility with existing code. New code should use platform specific checks */
#define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_17_1
#endif
Expand Down Expand Up @@ -169,8 +167,6 @@
#define __AVAILABILITY_INTERNAL_WEAK_IMPORT __attribute__((weak_import))
#define __AVAILABILITY_INTERNAL_REGULAR

#include <AvailabilityInternalLegacy.h>

#if defined(__has_feature) && defined(__has_attribute)
#if __has_attribute(availability)
#define __API_AVAILABLE_PLATFORM_macos(x) macos,introduced=x
Expand Down Expand Up @@ -315,6 +311,16 @@
#define __API_DEPRECATED_BEGIN_REP7(msg,arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7) __API_R_BEGIN(msg,arg0) __API_R_BEGIN(msg,arg1) __API_R_BEGIN(msg,arg2) __API_R_BEGIN(msg,arg3) __API_R_BEGIN(msg,arg4) __API_R_BEGIN(msg,arg5) __API_R_BEGIN(msg,arg6) __API_R_BEGIN(msg,arg7)
#define __API_DEPRECATED_BEGIN_REP8(msg,arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) __API_R_BEGIN(msg,arg0) __API_R_BEGIN(msg,arg1) __API_R_BEGIN(msg,arg2) __API_R_BEGIN(msg,arg3) __API_R_BEGIN(msg,arg4) __API_R_BEGIN(msg,arg5) __API_R_BEGIN(msg,arg6) __API_R_BEGIN(msg,arg7) __API_R_BEGIN(msg,arg8)
#define __API_DEPRECATED_BEGIN_REP_GET_MACRO(_0,_1,_2,_3,_4,_5,_6,_7,_8,_9,NAME,...) NAME
#define __API_DEPRECATED_WITH_REPLACEMENT_BEGIN0(msg,arg0) __API_R_BEGIN(msg,arg0)
#define __API_DEPRECATED_WITH_REPLACEMENT_BEGIN1(msg,arg0,arg1) __API_R_BEGIN(msg,arg0) __API_R_BEGIN(msg,arg1)
#define __API_DEPRECATED_WITH_REPLACEMENT_BEGIN2(msg,arg0,arg1,arg2) __API_R_BEGIN(msg,arg0) __API_R_BEGIN(msg,arg1) __API_R_BEGIN(msg,arg2)
#define __API_DEPRECATED_WITH_REPLACEMENT_BEGIN3(msg,arg0,arg1,arg2,arg3) __API_R_BEGIN(msg,arg0) __API_R_BEGIN(msg,arg1) __API_R_BEGIN(msg,arg2) __API_R_BEGIN(msg,arg3)
#define __API_DEPRECATED_WITH_REPLACEMENT_BEGIN4(msg,arg0,arg1,arg2,arg3,arg4) __API_R_BEGIN(msg,arg0) __API_R_BEGIN(msg,arg1) __API_R_BEGIN(msg,arg2) __API_R_BEGIN(msg,arg3) __API_R_BEGIN(msg,arg4)
#define __API_DEPRECATED_WITH_REPLACEMENT_BEGIN5(msg,arg0,arg1,arg2,arg3,arg4,arg5) __API_R_BEGIN(msg,arg0) __API_R_BEGIN(msg,arg1) __API_R_BEGIN(msg,arg2) __API_R_BEGIN(msg,arg3) __API_R_BEGIN(msg,arg4) __API_R_BEGIN(msg,arg5)
#define __API_DEPRECATED_WITH_REPLACEMENT_BEGIN6(msg,arg0,arg1,arg2,arg3,arg4,arg5,arg6) __API_R_BEGIN(msg,arg0) __API_R_BEGIN(msg,arg1) __API_R_BEGIN(msg,arg2) __API_R_BEGIN(msg,arg3) __API_R_BEGIN(msg,arg4) __API_R_BEGIN(msg,arg5) __API_R_BEGIN(msg,arg6)
#define __API_DEPRECATED_WITH_REPLACEMENT_BEGIN7(msg,arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7) __API_R_BEGIN(msg,arg0) __API_R_BEGIN(msg,arg1) __API_R_BEGIN(msg,arg2) __API_R_BEGIN(msg,arg3) __API_R_BEGIN(msg,arg4) __API_R_BEGIN(msg,arg5) __API_R_BEGIN(msg,arg6) __API_R_BEGIN(msg,arg7)
#define __API_DEPRECATED_WITH_REPLACEMENT_BEGIN8(msg,arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) __API_R_BEGIN(msg,arg0) __API_R_BEGIN(msg,arg1) __API_R_BEGIN(msg,arg2) __API_R_BEGIN(msg,arg3) __API_R_BEGIN(msg,arg4) __API_R_BEGIN(msg,arg5) __API_R_BEGIN(msg,arg6) __API_R_BEGIN(msg,arg7) __API_R_BEGIN(msg,arg8)
#define __API_DEPRECATED_WITH_REPLACEMENT_BEGIN_GET_MACRO(_0,_1,_2,_3,_4,_5,_6,_7,_8,_9,NAME,...) NAME

/*
* API Unavailability
Expand Down Expand Up @@ -374,20 +380,4 @@
#define __swift_compiler_version_at_least(...) 1
#endif

/*
* If __SPI_AVAILABLE has not been defined elsewhere, disable it.
*/

#ifndef __SPI_AVAILABLE
#define __SPI_AVAILABLE(...)
#endif

#ifndef __SPI_AVAILABLE_BEGIN
#define __SPI_AVAILABLE_BEGIN(...)
#endif

#ifndef __SPI_AVAILABLE_END
#define __SPI_AVAILABLE_END(...)
#endif

#endif /* __AVAILABILITY_INTERNAL__ */
2 changes: 2 additions & 0 deletions Headers/AvailabilityInternalLegacy.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
#ifndef __AVAILABILITY_INTERNAL_LEGACY__
#define __AVAILABILITY_INTERNAL_LEGACY__

#include <AvailabilityInternal.h>

#if defined(__has_builtin)
#if __has_builtin(__is_target_arch)
#if __has_builtin(__is_target_vendor)
Expand Down
5 changes: 3 additions & 2 deletions Headers/AvailabilityMacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,12 @@

*/

#include <AvailabilityVersions.h>

#ifndef __AVAILABILITYMACROS__
#define __AVAILABILITYMACROS__

#include <AvailabilityVersions.h>
#include <TargetConditionals.h>

/*
* If min OS not specified, assume 10.4 for intel
* Note: compiler driver may set _ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED_ based on MACOSX_DEPLOYMENT_TARGET environment variable
Expand Down
24 changes: 24 additions & 0 deletions Headers/AvailabilityVersions.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@
#define __MAC_14_3 140300
#define __MAC_14_4 140400
#define __MAC_14_5 140500
#define __MAC_15_0 150000
#define __MAC_15_1 150100
#define __MAC_15_2 150200
/* __MAC__NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */

#define __IPHONE_2_0 20000
Expand Down Expand Up @@ -168,6 +171,9 @@
#define __IPHONE_17_3 170300
#define __IPHONE_17_4 170400
#define __IPHONE_17_5 170500
#define __IPHONE_18_0 180000
#define __IPHONE_18_1 180100
#define __IPHONE_18_2 180200
/* __IPHONE__NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */

#define __WATCHOS_1_0 10000
Expand Down Expand Up @@ -217,6 +223,9 @@
#define __WATCHOS_10_3 100300
#define __WATCHOS_10_4 100400
#define __WATCHOS_10_5 100500
#define __WATCHOS_11_0 110000
#define __WATCHOS_11_1 110100
#define __WATCHOS_11_2 110200
/* __WATCHOS__NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */

#define __TVOS_9_0 90000
Expand Down Expand Up @@ -267,6 +276,9 @@
#define __TVOS_17_3 170300
#define __TVOS_17_4 170400
#define __TVOS_17_5 170500
#define __TVOS_18_0 180000
#define __TVOS_18_1 180100
#define __TVOS_18_2 180200
/* __TVOS__NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */

#define __BRIDGEOS_2_0 20000
Expand Down Expand Up @@ -296,6 +308,9 @@
#define __BRIDGEOS_8_3 80300
#define __BRIDGEOS_8_4 80400
#define __BRIDGEOS_8_5 80500
#define __BRIDGEOS_9_0 90000
#define __BRIDGEOS_9_1 90100
#define __BRIDGEOS_9_2 90200


#define __DRIVERKIT_19_0 190000
Expand All @@ -311,11 +326,17 @@
#define __DRIVERKIT_23_3 230300
#define __DRIVERKIT_23_4 230400
#define __DRIVERKIT_23_5 230500
#define __DRIVERKIT_24_0 240000
#define __DRIVERKIT_24_1 240100
#define __DRIVERKIT_24_2 240200
/* __DRIVERKIT__NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */

#define __VISIONOS_1_0 10000
#define __VISIONOS_1_1 10100
#define __VISIONOS_1_2 10200
#define __VISIONOS_2_0 20000
#define __VISIONOS_2_1 20100
#define __VISIONOS_2_2 20200
/* __VISIONOS__NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */


Expand Down Expand Up @@ -393,6 +414,9 @@
#define MAC_OS_VERSION_14_3 __MAC_14_3
#define MAC_OS_VERSION_14_4 __MAC_14_4
#define MAC_OS_VERSION_14_5 __MAC_14_5
#define MAC_OS_VERSION_15_0 __MAC_15_0
#define MAC_OS_VERSION_15_1 __MAC_15_1
#define MAC_OS_VERSION_15_2 __MAC_15_2

#endif /* #if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || defined(_DARWIN_C_SOURCE) */

Expand Down