Platform: port to msvcrt, add msvcrt module

This adds the swiftMSVCRT module which is similar in spirit to swiftGlibc and
swiftDarwin, exposing the Microsoft C Runtime library to swift.  Furthermore,
disable pieces of the standard library which are not immediately trivially
portable to Windows.  A lot of this functionality can still be implemented and
exposed to the user, however, this is the quickest means to a PoC for native
windows support.

As a temporary solution, add a -DCYGWIN flag to indicate that we are building
for the cygwin windows target.  This allows us to continue supporting the cygwin
environment whilst making the windows port work natively against the windows
environment (msvc).  Eventually, that will hopefully be replaced with an
environment check in swift.
This commit is contained in:
Saleem Abdulrasool
2016-07-03 14:43:06 -07:00
parent d39ad943d4
commit a05fd17b64
11 changed files with 301 additions and 19 deletions

View File

@@ -18,7 +18,8 @@ import Glibc
#endif
// posix_spawn is not available on Android.
#if !os(Windows) || CYGWIN
// posix_spawn is not available on Android or Windows.
#if !os(Android)
// swift_posix_spawn isn't available in the public watchOS SDK, we sneak by the
// unavailable attribute declaration here of the APIs that we need.
@@ -293,3 +294,5 @@ internal func _getEnviron() -> UnsafeMutablePointer<UnsafeMutablePointer<CChar>?
return __environ
#endif
}
#endif