[swift-evolution] [META] Re-invigorating the compiler directive discussion
jgroff at apple.com
Mon Mar 14 12:28:11 CDT 2016
> On Mar 12, 2016, at 7:56 PM, Erica Sadun via swift-evolution <swift-evolution at swift.org> wrote:
> #if platform(Apple) tests for platform families, including Apple, Linux, Unix, Windows
> #if imports(UIKit) tests for framework support, differentiating, for example, Mac code from iOS and tvOS code.
> #if target(simulator) and #if target(device) represent a common categorization requirement, such as Metal, Keychain, and AVFoundation Camera code.
> #if target(32bit) and #if target(64bit) tests for 32 and 64 bit architecture families.
> #if target(bigendian) and #if target(littleendian) tests for big and little endianness.
> #if config(debug) tests for debug builds.
I agree that expanding our repertoire here is badly needed. I think it'd be better to have a specific #if foo(...) name for each combination of independent choices. It's a nice property of our current design that, when you see #if foo(X) || foo(Y), you know foo(X) and foo(Y) are mutually exclusive. You'd lose that if you had both target(32bit) and target(bigendian).
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution