OS/Environment check in Swift


(Muhammad Mominul Huque) #1

I'd like to add two more conditional proposal:

osTarget(MSVC)

//or

osEnvironment(Mingw)

I have some comments about following conditionals

os(Windows, target: MSVC)

// or

os(Windows, environment: MSVC)

I don't like these two conditionals. Because these two conditionals will
not fit in for Apple platforms. If we consider those two:

os(Apple, target: macOS)
// or
os(Apple, environment: iOS)

So we would have to use Apple as main platform and macOS, iOS etc. as its
'environments' or as 'tagets' if we consider that two.

As far now we have these conditionals or I proposed:

environment(_)
//or
target(_)
//or
osEnvironment(_)
//or
osTarget(_)
//or
os(_, environment: )
//or
os(_, target: )

Thanks!