Commit Graph

270 Commits

Author SHA1 Message Date
stevapple
281ae3c2a6 Add WinSDK.WinSafer 2020-12-21 22:44:28 +08:00
Saleem Abdulrasool
21542b74d2 Merge pull request #34572 from egorzhdan/visualc
VisualC: remove unnecessary submodule
2020-11-17 08:45:00 -08:00
Saleem Abdulrasool
760a4e4951 Platform: add SensorsAPI to the WinSDK modulemap
The SensorsAPI headers are not part of the Windows umbrella header and
do not get pulled into the module through some transitive set.
Explicitly list the SensorsAPIs contract into the WinSDK modulemap to
allow use of the api contract from Swift.
2020-11-11 08:27:02 -08:00
Saleem Abdulrasool
67aef95f62 platform: add WIC (Windows Imaging Component) to the SDK
The Windows Imaging Component does not get included by any of the other
headers.  Explicitly add a submodule for the component.
2020-11-05 10:23:12 -08:00
Egor Zhdan
d93bf20283 VisualC: remove unnecessary submodule
`vadefs.h` is provided by clang, there should be no need to have it in visualc as well
2020-11-03 23:14:49 +03:00
Saleem Abdulrasool
62d788c08d stdlib: add AppNotify.h to the Shell module
This header is a standalone header part of the shell subsystem which
allows application to get notification related to application
suspension.
2020-11-02 22:24:53 -08:00
Kuba (Brecka) Mracek
d7dfa3e942 Bring up tests + validation tests for the 'freestanding' build and the standalone_minimal preset (#34386) 2020-10-26 16:32:36 -07:00
Egor Zhdan
246fe46aa7 Merge pull request #34422 from egorzhdan/winsdk
WinSDK: prevent windows.h from hijacking imm.h
2020-10-24 22:38:00 +03:00
Saleem Abdulrasool
74144e4788 Platform: extract WLANAPI module on Windows
The WLAN APIs are used for the native WiFi implementation and is not as
generally useful.  Extract it into a submodule.
2020-10-21 11:33:15 -07:00
Saleem Abdulrasool
09fc82aac3 Merge pull request #34299 from compnerd/i-dont-visual-c-you
stdlib: remove `swiftMSVCRT`, replace with `swiftCRT` on Windows
2020-10-20 11:05:03 -07:00
Egor Zhdan
a4a1ff6442 WinSDK: prevent windows.h from hijacking imm.h
Both `immdev.h` & `windows.h` include `imm.h`, and sometimes this header gets assigned to the module containing `windows.h` (currently `WinSDK.WinSock2`) instead of the Internationalization submodule
2020-10-18 15:14:09 +03:00
Saleem Abdulrasool
a757d7bd5c Merge pull request #34344 from egorzhdan/winsdk
WinSDK: extract System.MCX submodule
2020-10-17 18:25:07 -07:00
Egor Zhdan
e893ecfaf0 WinSDK: extract System.MCX submodule
Currently this header gets included into `WinSDK.WinSock2` via `windows.h`
2020-10-17 18:08:24 +03:00
Saleem Abdulrasool
2fc5cbdc14 stdlib: remove swiftMSVCRT, replace with swiftCRT on Windows
This replaces swiftMSVCRT with swiftCRT.  The big difference here is
that the `visualc` module is no longer imported nor exported.  The
`visualc` module remains in use for a singular test wrt availability,
but this should effectively remove the need for the `visualc` module.

The difference between the MSVCRT and ucrt module was not well
understood by most.  MSVCRT provided ucrt AND visualc, combining pieces
of the old MSVCRT and the newer ucrt.  The ucrt module is what you
really wanted most of the time, however, would need to use MSVCRT for
the convenience aliases for type-generic math and the deprecated math
constants.

Unfortunately, we cannot shadow the `ucrt` module and create a Swift SDK
overlay for ucrt as that seems to result in circular dependencies when
processing the `_Concurrency` module.

Although this makes using the C library easier for most people, it has a
more important subtle change: it cleaves the dependency on visualc.
This means that this enables use of Swift without Visual Studio for the
singular purpose of providing 3 header files.  Additionally, it removes
the need for the installation of 2 of the 4 support files.  This greatly
simplifies the deployment process on Windows.
2020-10-15 16:02:01 -07:00
Saleem Abdulrasool
78bc6aae36 Platform: link against Pathcch.lib when using pathcch.h
The MSDN documentation indicates that you should link against the
`Pathcch.lib` import library when using functions from `pathcch.h` which
can also be verified by use functions failing to link due to unresolved
symbols.  Add the missing linking to enable autolinking for `WinSDK`.
2020-10-14 14:34:33 -07:00
Egor Zhdan
681805ddca WinSDK: extract Networking submodule
Currently winnetwk.h gets included via windows.h
2020-10-11 16:59:11 +03:00
Egor Zhdan
ec9f5a2311 WinSDK: extract WinNT into a separate submodule 2020-10-10 18:57:56 +03:00
Egor Zhdan
3708e7bbd5 WinSDK: extract Security submodule with winscard.h
Currently this header gets included into `WinSDK.WinSock2` via windows.h
2020-10-07 14:13:05 +03:00
Egor Zhdan
6a431085de Merge pull request #34147 from egorzhdan/winsdk-ioctl
WinSDK: extract System submodule
2020-10-03 19:52:42 +03:00
Egor Zhdan
ae9715ac03 WinSDK: extract System submodule with winioctl.h
Currently this header gets included into `WinSDK.WinSock2` via windows.h & winscard.h
2020-10-02 20:38:17 +03:00
Egor Zhdan
f158e6afce Merge pull request #34085 from egorzhdan/winsdk-version
WinSDK: extract version into a separate submodule
2020-09-26 12:41:37 +03:00
Egor Zhdan
70a6d2c7c5 WinSDK: extract version into a separate submodule
Currently winver.h gets included into `WinSDK.WinSock2`, however its usages might not be related to sockets, and it requires linking against `Version.Lib`
2020-09-25 22:07:37 +03:00
Egor Zhdan
30f7b9ecef WinSDK: extract Performance submodule
Currently some of the headers get included into `WinSDK.WinSock2` via windows.h
2020-09-24 15:05:08 +03:00
Saleem Abdulrasool
846f522b22 Merge pull request #34032 from egorzhdan/winsdk-printing
WinSDK: extract Printing submodule
2020-09-23 18:11:20 -07:00
Saleem Abdulrasool
5405585cf9 Merge pull request #34034 from egorzhdan/winsdk-media
WinSDK: extract Multimedia submodule
2020-09-23 18:10:54 -07:00
Egor Zhdan
42dcb6948b WinSDK: extract Multimedia submodule
Some of the headers in the Multimedia subsystem were not included in any other submodule of WinSDK. This change adds them to WinSDK.
2020-09-22 22:22:43 +03:00
Egor Zhdan
7ba7d9b5c1 WinSDK: extract Printing submodule
Currently winspool.h gets included into `WinSDK.WinSock2` via windows.h
2020-09-22 21:51:20 +03:00
Egor Zhdan
c1e43c7768 WinSDK: add console API headers
`WinSDK.core.console` only specified `consoleapi.h` header, while `consoleapi2.h` & `consoleapi3.h` were included in the WinSock2 submodule since these headers are included by `windows.h`
2020-09-20 18:26:24 +03:00
3405691582
5f1f37e74a [stdlib] Fix the OpenBSD modulemap.
stdint.h is missing; this repairs a number of unit tests.
2020-09-17 19:48:10 -04:00
Saleem Abdulrasool
d18ed438c1 Platform: correct linked import library name
When linking on a case sensitive file system, the import library must be
named with the matching case.  The import library is named
`ComDlg32.Lib` in the SDK, adjust the case.
2020-09-16 11:05:10 -07:00
Egor Zhdan
37349a3401 Merge pull request #33958 from egorzhdan/winsdk-controls
WinSDK: extract Controls submodule
2020-09-16 11:39:43 +03:00
Egor Zhdan
62b56f3adc WinSDK: extract Controls submodule
Currently commdlg.h gets included into `WinSDK.WinSock2`, however its usages might not be related to sockets
2020-09-14 22:23:41 +03:00
Egor Zhdan
b63dbbc3f0 WinSDK: extract Internationalization submodule
Currently winnls.h & imm.h get included into `WinSDK.WinSock2`, however their usages might not be related to sockets
2020-09-13 23:02:31 +03:00
Shoaib Meenai
b8e96841b5 [stdlib] Correct shell32 casing
This allows links to succeed on a case-sensitive file system.
2020-09-10 12:16:18 -07:00
Daniel Duan
3fe7abee19 WinSDK: add Shell32 (#33849)
This header and .lib features useful APIs such as [SHFileOperation](https://docs.microsoft.com/en-us/windows/win32/api/shellapi/nf-shellapi-shfileoperationw), which seems to be the preferred way to manipulate file systems for certain things.
2020-09-09 22:52:20 -07:00
Saleem Abdulrasool
fbdd1ebf46 Platform: improve WinSDK modulemap to repair build
The WinSDK module failed to expose WinBase properly for reuse, which the
newer clang seems to object to (via an assertion).  Add a separate
module for WinBase which allows reuse of the definitions without causing
conflicts.  This caused some additional fallout requiring the creation
of the WinSVC submodule (service handling, part of security and
identity) and splitting up the legacy WinSock header from the WinSock2
module.  This allows building Foundation again on Windows.
2020-09-04 21:58:58 -07:00
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
Dario Rexin
41176b14d4 Fix glibc.modulemap generation 2020-08-04 20:36:19 -07:00
Dario Rexin
7e60a73335 Merge pull request #33168 from drexin/wip-fix-resource-folder
Properly compute resource folder when linking statically
2020-08-04 12:52:38 -07:00
Saleem Abdulrasool
133554c19b Windows: add DWMAPI to modulemap
Add an entry for the DWM API to the WinSDK headers.  Without this the
DWM APIs are not available.
2020-08-02 15:57:50 -07:00
Dario Rexin
0850436d9f Properly compute resource folder when linking statically
- deduplicate the logic to compute the resource folder
- install headers and module files in shared and static resource folders
- forward -static flag when calling swiftc with -print-target-info
2020-07-30 15:07:03 -07:00
Varun Gandhi
cacfb01f97 Revert subset of "[Gardening] Clean Up OS-Test Patterns Across The Codebase"
Removes usage of #canImport(Darwin) from stdlib/public.

This reverts a subset of commit cddf73ecdb.
2020-07-01 15:47:18 -07:00
Robert Widmann
cddf73ecdb [Gardening] Clean Up OS-Test Patterns Across The Codebase
Clean up a few general patterns that are now obviated by canImport

This aligns more generally with the cleanup that the Swift Package
Manager has already done in their automated XCTest-plumbing tool in
apple/swift-package-manager#1826.
2020-06-30 22:55:58 -07:00
3405691582
9cc07c7a4a [test][stdlib] Define stdio stubs for OpenBSD.
These are macros on OpenBSD, which don't get imported to an equivalent
symbol in Swift.
2020-06-11 20:17:35 -04:00
Saleem Abdulrasool
bf9ae4bb25 Platform: add RichEdit to modulemap
Add RichEdit to the module map file for WinSDK.
2020-05-25 18:26:53 -07:00
Robert Widmann
7e00f7e6c6 Merge pull request #31853 from 3405691582/Semaphore_Typealias_OpenBSD
[stdlib] sem_t is a nullable pointer on OpenBSD.
2020-05-18 13:05:37 -07:00
3405691582
f1ca2e97cf [stdlib] sem_t is a nullable pointer on OpenBSD.
Platform defines sem_open in Swift that calls through to the underlying
platform functions because sem_open is variadic. However, the
definitions here assume sem_t is non-nullable, but this assumption only
holds when the platform has nullability annotations on the semaphore
type, or the semaphore type on the platform is not an opaque pointer.

On OpenBSD specifically, the semaphore type is an opaque pointer without
any nullability annotations. This means that the type gets inferred as
UnsafeMutablePointer<sem_t?>? instead of UnsafeMutablePointer<sem_t>?.
To make sure the pointer values returned and their types match, we
introduce a conditional typealias.

The other option is to coerce everything to UnsafeMutablePointer<sem_t>?
but this would be a rather blunt instrument. While sem_open is public in
stdlib, it is not so much codified stdlib API, so this is a slightly
nicer approach.
2020-05-17 22:24:06 -04:00
Saleem Abdulrasool
904f6aa1ec Windows: add combase to the WinSDK.core module
Ensure that this header properly gets modularized into its own module.
2020-04-29 18:42:11 -07:00
Saleem Abdulrasool
15ce9a8c6b WinSDK: extract WinRPC into a module
Add a module representing RpcRT4.  This is needed for interfacing with
certain COM interfaces.
2020-04-26 10:25:41 -07:00
Saleem Abdulrasool
6bad5a7bb3 Windows: add a WinGDI submodule
Extract the WinGDI into a submodule to handle the Gdi32 autolinking
requirement as well as to isolate the types.
2020-04-18 10:39:02 -07:00