Commit Graph

430 Commits

Author SHA1 Message Date
Saleem Abdulrasool
4084f7a5a6 Platform: add dxgi1_6 to the Direct3D module
There is no usermode header which has the DXGI1.6 interfaces included
unfortunately.  This adds the interfaces to the module which is required
for IDXGIAdapter4 interface.
2021-01-23 12:41:20 -08:00
Saleem Abdulrasool
e508b1ab14 Platform: extend the D3D v10 module
Add the extensions for the Direct3D v10 API to enable access to the
newer DXGISwapChain interfaces.  Additionally, correct the linking to
ensure that we pick up the v10 version of the import library.
2021-01-21 08:46:47 -08:00
Saleem Abdulrasool
86a8b1b4dc Platform: add Direct3D11 module
This adds the Direct3D v11 module for Windows.  This is required to gain
access to the DXGI interfaces, which homes the DXGISwapChain interface.
2021-01-20 15:28:27 -08:00
martinboehme
c5b7e7fb9c Fix two issues with the SwiftGlibc module map (#32404)
* Fix two issues with the SwiftGlibc module map.

The issues are:

- Today, some submodules in `SwiftGlibc` fail to provide definitions that
  they should contain. As a consequence, Swift fails to import some code
  that compiles correctly with standalone Clang. As just one example,
  including `signal.h` should make the type `pid_t` available, but it
  currently does not.

- `SwiftGlibc` is not compatible with the libc++ module map. Trying to
  include libc++ headers in a C++ module imported into Swift results in an
  error message about cyclic dependencies.

This change fixes both of these issues by making it so that `SwiftGlibc`
no actually longer defines a module map for the glibc headers but merely makes
all of the symbols from those headers available in a module that can be
imported into Swift. C / Objective-C / C++ code, on the other hand, will now
include the glibc headers texually.

For more context on the two issues and this fix, see this forum
discussion:

https://forums.swift.org/t/problems-with-swiftglibc-and-proposed-fix/37594

This change only modifies `glibc.modulemap.gyb` for the time being but
leaves `bionic.modulemap.gyb` and `libc-openbsd.modulemap.gyb` unchanged. The
intent is to fix these in the same way, but it will be easier to do this
in separate PRs that can be tested individually.

Co-authored-by: zoecarver <z.zoelec2@gmail.com>
Co-authored-by: Marcel Hlopko <hlopko@google.com>
2021-01-11 14:25:41 +01:00
Saleem Abdulrasool
fc8cd455d0 Platform: add ActiveX module
Add the ActiveX module to the Windows SDK.  This is needed for the
IPropBag2 interface.
2021-01-09 15:18:16 -08:00
Saleem Abdulrasool
5bfbaadb43 WinSDK: use xinput instead of xinputuap
The UAP variant is included into the WinSDK module which then fails to
run.  Adjust the linkage.
2021-01-08 17:27:26 -08:00
Saleem Abdulrasool
715d81cf26 Platform: add a cplusplus requirement to XAudio
In some cases when building the `XAudio` module, we would end up going
down C++ paths:

```
C:\Program Files (x86)\Windows Kits\10\/Include/10.0.17763.0/um/xaudio2.h:61:26: error: 'uuid' attribute is not supported in C
    interface __declspec(uuid("2B02E3CF-2E0B-4ec3-BE45-1B2A3FE7210D")) IXAudio2;
                             ^
<module-includes>:29:10: note: in file included from <module-includes>:29:
         ^
```

Although this works with newer SDKs, it does not work with older SDKs.
Filter out the module for the time being with a requirement on `C++`.
This should be possible to use with `-enable-cxx-interop`.
2021-01-05 14:47:02 -08:00
Saleem Abdulrasool
96b6760276 Merge pull request #35249 from egorzhdan/winsdk-xaml
WinSDK: add XAML hosting submodule
2021-01-05 08:49:24 -08:00
Egor Zhdan
6970054b63 WinSDK: add XAML hosting submodule
This exposes `IDesktopWindowXamlSourceNative` interface, which is used for embedding WinUI XAML controls into Win32 apps
2021-01-02 17:04:14 +03:00
Saleem Abdulrasool
c5bc227ac7 Platform: add DirectX mappings
Add the module definitions for:
- Direct3D v12
- XAudio 2.9
- XInput 1.4

Additionally, add the following, unusable modules:
- DXCore

DXCore requires C++ Support (C++11 or newer to be precise) and is not
yet available until C++ interop can be made to work fully.
2021-01-01 10:41:24 -08:00
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