> On Mar 22, 2016, at 3:14 PM, Erica Sadun via swift-evolution > <[email protected]> wrote: > > <https://gist.github.com/erica/b7f4226b8201945602f2#introduction>Introduction > > Expanding the build configuration suite to test for the ability to import > certain modules was first introduced > <http://article.gmane.org/gmane.comp.lang.swift.evolution/7516/match=darwin> > on the Swift-Evolution list by Kevin Ballard. Although his initial idea > (checking for Darwin to differentiate Apple targets from non-Apple targets) > proved problematic, developers warmly greeted the notion of an import-based > configuration test. Dmitri Gribenko wrote, "There's a direction that we want > to move to a unified name for the libc module for all platform, so 'can > import Darwin' might not be a viable long-term strategy." Testing for imports > offers advantages that stand apart from this one use-case: to test for API > availability before use. >
Very interesting proposal. Note that this is directly analogous to the Clang extension “__has_include”. __has_include has been useful, and the C++ committee is discussing standardizing the functionality there. http://clang.llvm.org/docs/LanguageExtensions.html#include-file-checking-macros -Chris
_______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
