Skip to content

Commit 101b741

Browse files
committed
Merge pull request #99036 from bruvzg/propkey_rename
[Windows] Rename `PKEY_Device_FriendlyName` to avoid duplicate symbols with newer MinGW SDKs.
2 parents a702b69 + c363e13 commit 101b741

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/wasapi/audio_driver_wasapi.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,15 @@ __CRT_UUID_DECL(IAudioClient3, 0x7ED4EE07, 0x8E67, 0x4CD4, 0x8C, 0x1A, 0x2B, 0x7
9292

9393
#endif // __MINGW32__ || __MINGW64__
9494

95-
#ifndef PKEY_Device_FriendlyName
95+
#ifndef PKEY_Device_FriendlyNameGodot
9696

9797
#undef DEFINE_PROPERTYKEY
9898
/* clang-format off */
9999
#define DEFINE_PROPERTYKEY(id, a, b, c, d, e, f, g, h, i, j, k, l) \
100100
const PROPERTYKEY id = { { a, b, c, { d, e, f, g, h, i, j, k, } }, l };
101101
/* clang-format on */
102102

103-
DEFINE_PROPERTYKEY(PKEY_Device_FriendlyName, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 14);
103+
DEFINE_PROPERTYKEY(PKEY_Device_FriendlyNameGodot, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 14);
104104
#endif
105105

106106
const CLSID CLSID_MMDeviceEnumerator = __uuidof(MMDeviceEnumerator);
@@ -234,7 +234,7 @@ Error AudioDriverWASAPI::audio_device_init(AudioDeviceWASAPI *p_device, bool p_i
234234
PROPVARIANT propvar;
235235
PropVariantInit(&propvar);
236236

237-
hr = props->GetValue(PKEY_Device_FriendlyName, &propvar);
237+
hr = props->GetValue(PKEY_Device_FriendlyNameGodot, &propvar);
238238
ERR_BREAK(hr != S_OK);
239239

240240
if (p_device->device_name == String(propvar.pwszVal)) {
@@ -597,7 +597,7 @@ PackedStringArray AudioDriverWASAPI::audio_device_get_list(bool p_input) {
597597
PROPVARIANT propvar;
598598
PropVariantInit(&propvar);
599599

600-
hr = props->GetValue(PKEY_Device_FriendlyName, &propvar);
600+
hr = props->GetValue(PKEY_Device_FriendlyNameGodot, &propvar);
601601
ERR_BREAK(hr != S_OK);
602602

603603
list.push_back(String(propvar.pwszVal));

0 commit comments

Comments
 (0)