From fece71fa0a54d61235b39d0aef4e5bd7daaee5dd Mon Sep 17 00:00:00 2001 From: Ray Molenkamp Date: Fri, 20 Oct 2023 10:44:34 -0600 Subject: [PATCH] Fix: Build error on windows winstuff.c got converted to .cc recently, and a merge was done of #113674 from 4.0 which still was using C style code. Small update in code style was required here. --- source/blender/blenlib/CMakeLists.txt | 1 - source/blender/blenlib/intern/winstuff.cc | 18 ++++++++---------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/source/blender/blenlib/CMakeLists.txt b/source/blender/blenlib/CMakeLists.txt index 49cc426b43f..315a49679a4 100644 --- a/source/blender/blenlib/CMakeLists.txt +++ b/source/blender/blenlib/CMakeLists.txt @@ -445,7 +445,6 @@ if(WIN32) ) list(APPEND LIB bf_intern_utfconv - dxguid dxgi ) list(APPEND SRC diff --git a/source/blender/blenlib/intern/winstuff.cc b/source/blender/blenlib/intern/winstuff.cc index ee3e1ca72af..777799d148d 100644 --- a/source/blender/blenlib/intern/winstuff.cc +++ b/source/blender/blenlib/intern/winstuff.cc @@ -458,27 +458,25 @@ bool BLI_windows_get_directx_driver_version(const wchar_t *deviceSubString, { IDXGIFactory *pFactory = NULL; IDXGIAdapter *pAdapter = NULL; - if (CreateDXGIFactory(&IID_IDXGIFactory, (void **)&pFactory) == S_OK) { - for (UINT i = 0; IDXGIFactory_EnumAdapters(pFactory, i, &pAdapter) != DXGI_ERROR_NOT_FOUND; - ++i) { + if (CreateDXGIFactory(__uuidof(IDXGIFactory), (void **)&pFactory) == S_OK) { + for (UINT i = 0; pFactory->EnumAdapters(i, &pAdapter) != DXGI_ERROR_NOT_FOUND; ++i) { LARGE_INTEGER version; - if (IDXGIAdapter_CheckInterfaceSupport(pAdapter, &IID_IDXGIDevice, &version) == S_OK) { + if (pAdapter->CheckInterfaceSupport(__uuidof(IDXGIDevice), &version) == S_OK) { DXGI_ADAPTER_DESC desc; - if (IDXGIAdapter_GetDesc(pAdapter, &desc) == S_OK) { + if (pAdapter->GetDesc(&desc) == S_OK) { if (wcsstr(desc.Description, deviceSubString)) { *r_driverVersion = version.QuadPart; - IDXGIAdapter_Release(pAdapter); - IDXGIFactory_Release(pFactory); + pAdapter->Release(); + pFactory->Release(); return true; } } } - IDXGIAdapter_Release(pAdapter); + pAdapter->Release(); } - - IDXGIFactory_Release(pFactory); + pFactory->Release(); } return false;