1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-03 11:50:27 +00:00

[Windows] Rename PKEY_Device_FriendlyName to avoid duplicate symbols with newer MinGW SDKs.

(cherry picked from commit c363e13051)
This commit is contained in:
Pāvels Nadtočajevs
2024-11-10 21:45:32 +02:00
committed by Rémi Verschelde
parent 92cb553949
commit 8ec5e74eab

View File

@@ -37,7 +37,7 @@
#include <functiondiscoverykeys.h>
#ifndef PKEY_Device_FriendlyName
#ifndef PKEY_Device_FriendlyNameGodot
#undef DEFINE_PROPERTYKEY
/* clang-format off */
@@ -45,7 +45,7 @@
const PROPERTYKEY id = { { a, b, c, { d, e, f, g, h, i, j, k, } }, l };
/* clang-format on */
DEFINE_PROPERTYKEY(PKEY_Device_FriendlyName, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 14);
DEFINE_PROPERTYKEY(PKEY_Device_FriendlyNameGodot, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 14);
#endif
const CLSID CLSID_MMDeviceEnumerator = __uuidof(MMDeviceEnumerator);
@@ -178,7 +178,7 @@ Error AudioDriverWASAPI::audio_device_init(AudioDeviceWASAPI *p_device, bool p_c
PROPVARIANT propvar;
PropVariantInit(&propvar);
hr = props->GetValue(PKEY_Device_FriendlyName, &propvar);
hr = props->GetValue(PKEY_Device_FriendlyNameGodot, &propvar);
ERR_BREAK(hr != S_OK);
if (p_device->device_name == String(propvar.pwszVal)) {
@@ -449,7 +449,7 @@ Array AudioDriverWASAPI::audio_device_get_list(bool p_capture) {
PROPVARIANT propvar;
PropVariantInit(&propvar);
hr = props->GetValue(PKEY_Device_FriendlyName, &propvar);
hr = props->GetValue(PKEY_Device_FriendlyNameGodot, &propvar);
ERR_BREAK(hr != S_OK);
list.push_back(String(propvar.pwszVal));