Files
swift-mirror/test/Interpreter/Inputs/availability_host_os.h
Jordan Rose 23f25e1de7 In immediate mode, detect the host OS version on Apple platforms.
This allows script mode to pick up the current version of macOS
instead of defaulting to 10.9, making it unnecessary to write #available.
A -target flag can still override this if you're trying to write a
portable script.

The logic is a little tortured to avoid having to actually link to
Foundation.framework or libobjc.

Finishes rdar://problem/29433205.
2016-12-22 17:01:33 -08:00

7 lines
302 B
C

__attribute__((availability(macosx,introduced=10.9)))
static inline int mavericks() { return 9; }
__attribute__((availability(macosx,introduced=10.10)))
static inline int yosemite() { return 10; }
__attribute__((availability(macosx,introduced=10.99)))
static inline int todosSantos() { return 99; }