[swift-evolution] Idea: Support #if os(Darwin) as shorthand for os(iOS) || os(OSX) || os(watchOS) || os(tvOS)

Joe Groff jgroff at apple.com
Fri Feb 19 15:00:51 CST 2016


> On Feb 19, 2016, at 11:53 AM, Jordan Rose via swift-evolution <swift-evolution at swift.org> wrote:
> 
> I agree that we need something here, but I really like the property we have today that all of the "os" options are mutually exclusive. (Compare: TARGET_OS_IPHONE and TARGET_OS_IOS in <TargetConditionals.h>.) I'd be happy to invent a new predicate for this, though.

Yeah, I agree this should be a distinct predicate.
> 
> Other considerations:
> - Different Linux distros?
> - Common ground across BSDs?
> - Unixy? (vs. Windows)
> 
> And for other platform conditions:
> - Architecture subtypes?
> - Architecture families? ("32-bit" is a good one.)

For appley platforms, "Mac" vs "simulator" vs "device" also comes up as a common categorization.

-Joe


More information about the swift-evolution mailing list