mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-17 17:52:11 +01:00
[dxgi] Replace MSVC _countof macro with std::size (#231)
* [dxgi] Replace MSVC _countof macro with std::size pro: crosscompiler con: may not work for older clang/gcc/... http://en.cppreference.com/w/cpp/iterator/size For example `Run this code` mode produces errors for GCC-5.2(C++17) and clang-3.8(C++17). Local GCC-7.3 and clang-7 versions are ok. Not tested w/ MinGW64. * [dxgi] Replace MSVC _countof macro with std::size
This commit is contained in:
parent
0582e265f0
commit
e9c7dcfc76
@ -125,7 +125,7 @@ namespace dxvk {
|
||||
}
|
||||
|
||||
std::memset(pDesc->Description, 0, sizeof(pDesc->Description));
|
||||
std::mbstowcs(pDesc->Description, deviceProp.deviceName, _countof(pDesc->Description) - 1);
|
||||
std::mbstowcs(pDesc->Description, deviceProp.deviceName, std::size(pDesc->Description) - 1);
|
||||
|
||||
VkDeviceSize deviceMemory = 0;
|
||||
VkDeviceSize sharedMemory = 0;
|
||||
|
@ -144,7 +144,7 @@ namespace dxvk {
|
||||
}
|
||||
|
||||
std::memset(pDesc->DeviceName, 0, sizeof(pDesc->DeviceName));
|
||||
std::mbstowcs(pDesc->DeviceName, monInfo.szDevice, _countof(pDesc->DeviceName) - 1);
|
||||
std::mbstowcs(pDesc->DeviceName, monInfo.szDevice, std::size(pDesc->DeviceName) - 1);
|
||||
|
||||
pDesc->DesktopCoordinates = monInfo.rcMonitor;
|
||||
pDesc->AttachedToDesktop = 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user