Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WinSDK import fails with Windows SDK 10.0.17763.0 #73502

Open
SlugFiller opened this issue May 8, 2024 · 3 comments
Open

WinSDK import fails with Windows SDK 10.0.17763.0 #73502

SlugFiller opened this issue May 8, 2024 · 3 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. SDKOverlay Windows Platform: Windows

Comments

@SlugFiller
Copy link

Description

Caused by #70195.

Produces such error messages as:

C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\um/xaudio2fx.h:29:1: error: unknown type name 'class'
class __declspec(uuid("4FC3B166-972A-40CF-BC37-7DB03DB2FBA3")) AudioVolumeMeter;
^

or

C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\um/xaudio2fx.h:265:8: error: unknown type name 'bool'
    ,  bool sevenDotOneReverb = true
       ^

I don't know which version of xaudio29fx.h is a C header. But the one obtainable via winget install --id=Microsoft.WindowsSDK.10.0.17763 -e or choco install windows-sdk-10-version-1809-all is very clearly a C++ header.

If this version of the Windows SDK is intentionally unsupported, then the documentation should include instructions for installing a supported version.

Reproduction

import WinSDK

Expected behavior

Should build without errors

Environment

Swift version 5.10 (swift-5.10-RELEASE)
Target: x86_64-unknown-windows-msvc

Additional information

No response

@SlugFiller SlugFiller added bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. triage needed This issue needs more specific labels labels May 8, 2024
@compnerd compnerd added Windows Platform: Windows SDKOverlay and removed triage needed This issue needs more specific labels labels May 9, 2024
@compnerd
Copy link
Collaborator

compnerd commented May 9, 2024

CC: @STREGA

@STREGA
Copy link
Contributor

STREGA commented May 9, 2024

I have not yet had a chance to do my own XAudio implementation.

Looks like xaudio2.h is okay for C but xaudio2fx.h is C++ only.

XAudio2FX appears to contain a small number of pre made nodes. It could probably be its own C++ only module.

For reference: This was the example that made me believe C should be doable. The example doesn't use the fx header.

@SlugFiller
Copy link
Author

I actually have issues with xaudio.h too. Sample:

<module-includes>:39:10: note: in file included from <module-includes>:39:
#include "xaudio2.h"
         ^
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>:39:10: note: in file included from <module-includes>:39:
#include "xaudio2.h"
         ^
C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\um/xaudio2.h:1202:1: error: expected identifier or '('
XAUDIO2_STDAPI XAudio2CreateWithVersionInfo(_Outptr_ IXAudio2** ppXAudio2,
^
C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\um/xaudio2.h:1198:35: note: expanded from macro 'XAUDIO2_STDAPI'
    #define XAUDIO2_STDAPI extern "C" __declspec(dllimport) HRESULT __stdcall
                                  ^
<module-includes>:39:10: note: in file included from <module-includes>:39:
#include "xaudio2.h"
         ^
C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\um/xaudio2.h:1216:36: error: use of undeclared identifier 'nullptr'
    static HMODULE s_dllInstance = nullptr;
                                   ^

Doesn't seem to be C-compatible.

Reverting #70195 seems to fix this cleanly. I wonder what the disadvantages are.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. SDKOverlay Windows Platform: Windows
Projects
None yet
Development

No branches or pull requests

3 participants