I think this one is pretty straightforward, but as always feedback is requested and appreciated.
Let me know if you're okay with the names and the approach and whether there are any technical
barriers that need addressing.
Thanks, -- E
Introducing Build Configuration Tests for Platform Conditions
Proposal: SE-00XX
Author(s): Erica Sadun <http://github.com/erica>
Status: TBD
Review manager: TBD
<platformconditions.md · GitHub
This proposal introduces configuration test to differentiate platform conditions.
This proposal was discussed on-list in the Introducing Build Configuration Tests for Platform Conditions <applewebdata://DAF46169-949E-4C76-B744-5D8AB8E633A8>.
<platformconditions.md · GitHub
Testing for platform conditions is a typical developer task. Although some built-in features like CFByteOrderGetCurrentexist, it seems a natural match to Swift to introduce build configurations specific to common platform conditions.
<platformconditions.md · GitHub Design
This proposal adds the following build configuration tests:
#if endian(big)
#if endian(little)
#if bitwidth(32)
#if bitwidth(64)
<platformconditions.md · GitHub Art
Swift currently supports the following configuration tests:
The literals true and false
The os() function that tests for OSX, iOS, watchOS, tvOS, Linux, Windows, and FreeBSD
The arch() function that tests for x86_64, arm, arm64, i386, powerpc64, and powerpc64le
The swift() function that tests for specific Swift language releases, e.g. swift(>=2.2)
<platformconditions.md · GitHub Considered
There are no alternatives considered.