mirror of
https://github.com/ziglang/zig.git
synced 2025-12-12 17:23:09 +00:00
See ziglang/fetch-them-macos-headers#2 for more details. The path forward looks like one of the following: * Ony provide headers for the oldest supported macOS (currently 10.13 but soon to be bumped to 10.14). * Provide headers for multiple versions, and select based on the Zig target OS version range minimum. * Don't try to provide macOS headers. If we don't tackle the version problem, we would have to re-introduce the ability to detect and depend on native system headers if we wanted to support C/C++ code that used newer OS definitions. This patch also adds support for `#include <mach/mach_time.h>`. Also related: #5236
121 lines
3.8 KiB
C
121 lines
3.8 KiB
C
#ifndef __XPC_AVAILABILITY_H__
|
|
#define __XPC_AVAILABILITY_H__
|
|
|
|
#include <Availability.h>
|
|
|
|
// Certain parts of the project use all the project's headers but have to build
|
|
// against newer OSX SDKs than ebuild uses -- liblaunch_host being the example.
|
|
// So we need to define these.
|
|
#ifndef __MAC_10_15
|
|
#define __MAC_10_15 101500
|
|
#define __AVAILABILITY_INTERNAL__MAC_10_15 \
|
|
__attribute__((availability(macosx, introduced=10.15)))
|
|
#endif // __MAC_10_15
|
|
|
|
#ifndef __MAC_10_14
|
|
#define __MAC_10_14 101400
|
|
#define __AVAILABILITY_INTERNAL__MAC_10_14 \
|
|
__attribute__((availability(macosx, introduced=10.14)))
|
|
#endif // __MAC_10_14
|
|
|
|
#ifndef __MAC_10_13
|
|
#define __MAC_10_13 101300
|
|
#define __AVAILABILITY_INTERNAL__MAC_10_13 \
|
|
__attribute__((availability(macosx, introduced=10.13)))
|
|
#endif // __MAC_10_13
|
|
|
|
#ifndef __MAC_10_12
|
|
#define __MAC_10_12 101200
|
|
#define __AVAILABILITY_INTERNAL__MAC_10_12 \
|
|
__attribute__((availability(macosx, introduced=10.12)))
|
|
#endif // __MAC_10_12
|
|
|
|
#ifndef __MAC_10_11
|
|
#define __MAC_10_11 101100
|
|
#define __AVAILABILITY_INTERNAL__MAC_10_11 \
|
|
__attribute__((availability(macosx, introduced=10.11)))
|
|
#endif // __MAC_10_11
|
|
|
|
#ifndef __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_11
|
|
#define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_11
|
|
#endif // __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_11
|
|
|
|
#ifndef __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_11
|
|
#define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_11
|
|
#endif // __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_11
|
|
|
|
#ifndef __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_11
|
|
#define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_11
|
|
#endif // __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_11
|
|
|
|
#ifndef __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_11
|
|
#define __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_11
|
|
#endif // __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_11
|
|
|
|
#ifndef __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_11
|
|
#define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_11
|
|
#endif // __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_11
|
|
|
|
#ifndef __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_11
|
|
#define __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_11
|
|
#endif // __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_11
|
|
|
|
#ifndef __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_10_11
|
|
#define __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_10_11
|
|
#endif // __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_10_11
|
|
|
|
#ifndef __AVAILABILITY_INTERNAL__MAC_10_9_DEP__MAC_10_11
|
|
#define __AVAILABILITY_INTERNAL__MAC_10_9_DEP__MAC_10_11
|
|
#endif // __AVAILABILITY_INTERNAL__MAC_10_9_DEP__MAC_10_11
|
|
|
|
#ifndef __AVAILABILITY_INTERNAL__MAC_10_10_DEP__MAC_10_11
|
|
#define __AVAILABILITY_INTERNAL__MAC_10_10_DEP__MAC_10_11
|
|
#endif // __AVAILABILITY_INTERNAL__MAC_10_10_DEP__MAC_10_11
|
|
|
|
#ifndef __AVAILABILITY_INTERNAL__MAC_10_11_DEP__MAC_10_11
|
|
#define __AVAILABILITY_INTERNAL__MAC_10_11_DEP__MAC_10_11
|
|
#endif // __AVAILABILITY_INTERNAL__MAC_10_11_DEP__MAC_10_11
|
|
|
|
#ifndef __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_13
|
|
#define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_13
|
|
#endif // __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_13
|
|
|
|
#if __has_include(<simulator_host.h>)
|
|
#include <simulator_host.h>
|
|
#else // __has_include(<simulator_host.h>)
|
|
#ifndef IPHONE_SIMULATOR_HOST_MIN_VERSION_REQUIRED
|
|
#define IPHONE_SIMULATOR_HOST_MIN_VERSION_REQUIRED 999999
|
|
#endif // IPHONE_SIMULATOR_HOST_MIN_VERSION_REQUIRED
|
|
#endif // __has_include(<simulator_host.h>)
|
|
|
|
#ifndef __WATCHOS_UNAVAILABLE
|
|
#define __WATCHOS_UNAVAILABLE
|
|
#endif
|
|
|
|
#ifndef __TVOS_UNAVAILABLE
|
|
#define __TVOS_UNAVAILABLE
|
|
#endif
|
|
|
|
// simulator host-side bits build against SDKs not having __*_AVAILABLE() yet
|
|
#ifndef __OSX_AVAILABLE
|
|
#define __OSX_AVAILABLE(...)
|
|
#endif
|
|
|
|
#ifndef __IOS_AVAILABLE
|
|
#define __IOS_AVAILABLE(...)
|
|
#endif
|
|
|
|
#ifndef __TVOS_AVAILABLE
|
|
#define __TVOS_AVAILABLE(...)
|
|
#endif
|
|
|
|
#ifndef __WATCHOS_AVAILABLE
|
|
#define __WATCHOS_AVAILABLE(...)
|
|
#endif
|
|
|
|
#ifndef __API_AVAILABLE
|
|
#define __API_AVAILABLE(...)
|
|
#endif
|
|
|
|
#endif // __XPC_AVAILABILITY_H__
|