Commit Graph

10 Commits

Author SHA1 Message Date
Saleem Abdulrasool
7cee2bf487 Windows: include direct.h in sys.stat module
On Unicies `sys/stat.h` will provide `mkdir`.  Windows provides the
POSIX requirement through the portable name `_mkdir` which is declared
in the `direct.h` header.  This adds the additional header to the `ucrt`
module to allow access to this function.
2020-08-10 16:25:42 -07:00
Saleem Abdulrasool
c826deadb4 stdlib: link against legacy_stdio_definitions on Windows
Because Microsoft inlines the definitions of the printf family of
functions, we end up with undefined references to them.  Add an explicit
request to link against the `legacy_stdio_definitions` library when
`ucrt.C.stdio` is used which provides out-of-line definitions for them.
This fixes the building of the `stdlib/VarArgs' test.
2019-03-01 14:50:46 -08:00
Saleem Abdulrasool
04a5d84575 Platform: make MSVCRT more Unix-libc like
Since `stdin`, `stdout`, and `stderr` are defined via macros, we cannot see them
on the swift side.  Replicate these by hand.  Expose `STDIN_FILENO`,
`STDOUT_FILENO`, and `STDERR_FILENO` for compatibility with other libc
implementations.  This reduces the need for changing the codebase unnecessarily
for MSVCRT.
2018-12-13 16:01:42 -08:00
Saleem Abdulrasool
29dc89bd9b stdlib: broaden ucrt module
Add `process` to the ucrt module as this is used in the Foundation port
for Windows.
2018-11-24 20:57:46 -08:00
Saleem Abdulrasool
a990013847 Platform: MSVCRT provides POSIX.fcntl
Add the missing module declaration for the POSIX interfaces.  This is
needed to access the permission mode macros.
2018-06-05 13:20:44 -07:00
Saleem Abdulrasool
a0fea45957 Windows: further improve module maps
Further enhance the modulemaps.  This is needed to support the use of
the ucrt for the builtins as used in the ClangImporter unit tests.
2018-04-30 12:08:36 -07:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01:00
Saleem Abdulrasool
96974a2179 Windows: add a ucrt.io module
This module covers the ucrt corecrt_io.h header.  We can further refine
the module if necessary later.
2016-12-17 16:37:41 -08:00
practicalswift
797b80765f [gardening] Use the correct base URL (https://swift.org) in references to the Swift website
Remove all references to the old non-TLS enabled base URL (http://swift.org)
2016-11-20 17:36:03 +01:00
Saleem Abdulrasool
a05fd17b64 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.
2016-07-12 17:31:06 -07:00