Skip to content

Commit b7c4f03

Browse files
LoadEngineDll.h: do not use WinHPreface/WinHPostface as this may break client code
1 parent 0983568 commit b7c4f03

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

Graphics/GraphicsAccessories/interface/GraphicsAccessories.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1052,7 +1052,7 @@ std::string GetDeviceFeaturesString(const FeaturesType& Features,
10521052
FeatureStateStr += GetDeviceFeatureStateString(State);
10531053

10541054
size_t col = FeatureStrings.size() % NumColumns;
1055-
ColWidth[col] = std::max(ColWidth[col], FeatureStateStr.length());
1055+
ColWidth[col] = (std::max)(ColWidth[col], FeatureStateStr.length());
10561056

10571057
FeatureStrings.emplace_back(std::move(FeatureStateStr));
10581058
}

Graphics/GraphicsEngine/interface/LoadEngineDll.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@
3939
# include "../../../Common/interface/StringTools.hpp"
4040
#endif
4141

42-
#include "../../../Platforms/Win32/interface/WinHPreface.h"
42+
// NB: do not use WinHPreface/WinHPostface as this is a public header
43+
// and messing with Windows macros may break client code.
4344
#include <Windows.h>
44-
#include "../../../Platforms/Win32/interface/WinHPostface.h"
4545

4646
DILIGENT_BEGIN_NAMESPACE(Diligent)
4747

Tests/GPUTestFramework/src/GPUTestingEnvironment.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ GPUTestingEnvironment::GPUTestingEnvironment(const CreateInfo& EnvCI, const Swap
263263
EngineCI.AdapterId = FindAdapter(Adapters, EnvCI.AdapterType, EnvCI.AdapterId);
264264
NumDeferredCtx = EnvCI.NumDeferredContexts;
265265
EngineCI.NumDeferredContexts = NumDeferredCtx / 2;
266-
ppContexts.resize(std::max(size_t{1}, ContextCI.size()) + NumDeferredCtx);
266+
ppContexts.resize((std::max)(size_t{1}, ContextCI.size()) + NumDeferredCtx);
267267
pFactoryD3D11->CreateDeviceAndContextsD3D11(EngineCI, &m_pDevice, ppContexts.data());
268268
}
269269
break;
@@ -323,7 +323,7 @@ GPUTestingEnvironment::GPUTestingEnvironment(const CreateInfo& EnvCI, const Swap
323323

324324
NumDeferredCtx = EnvCI.NumDeferredContexts;
325325
EngineCI.NumDeferredContexts = NumDeferredCtx / 2;
326-
ppContexts.resize(std::max(size_t{1}, ContextCI.size()) + NumDeferredCtx);
326+
ppContexts.resize((std::max)(size_t{1}, ContextCI.size()) + NumDeferredCtx);
327327
pFactoryD3D12->CreateDeviceAndContextsD3D12(EngineCI, &m_pDevice, ppContexts.data());
328328
}
329329
break;
@@ -355,7 +355,7 @@ GPUTestingEnvironment::GPUTestingEnvironment(const CreateInfo& EnvCI, const Swap
355355
EngineCI.Window = Window;
356356
EngineCI.Features = EnvCI.Features;
357357
NumDeferredCtx = 0;
358-
ppContexts.resize(std::max(size_t{1}, ContextCI.size()) + NumDeferredCtx);
358+
ppContexts.resize((std::max)(size_t{1}, ContextCI.size()) + NumDeferredCtx);
359359
RefCntAutoPtr<ISwapChain> pSwapChain; // We will use testing swap chain instead
360360
pFactoryOpenGL->CreateDeviceAndSwapChainGL(
361361
EngineCI, &m_pDevice, ppContexts.data(), SCDesc, &pSwapChain);
@@ -416,7 +416,7 @@ GPUTestingEnvironment::GPUTestingEnvironment(const CreateInfo& EnvCI, const Swap
416416

417417
NumDeferredCtx = EnvCI.NumDeferredContexts;
418418
EngineCI.NumDeferredContexts = NumDeferredCtx / 2;
419-
ppContexts.resize(std::max(size_t{1}, ContextCI.size()) + NumDeferredCtx);
419+
ppContexts.resize((std::max)(size_t{1}, ContextCI.size()) + NumDeferredCtx);
420420
pFactoryVk->CreateDeviceAndContextsVk(EngineCI, &m_pDevice, ppContexts.data());
421421
}
422422
break;
@@ -468,7 +468,7 @@ GPUTestingEnvironment::GPUTestingEnvironment(const CreateInfo& EnvCI, const Swap
468468

469469
EngineWebGPUCreateInfo EngineCI{};
470470
EngineCI.Features = EnvCI.Features;
471-
ppContexts.resize(std::max(size_t{1}, ContextCI.size()) + NumDeferredCtx);
471+
ppContexts.resize((std::max)(size_t{1}, ContextCI.size()) + NumDeferredCtx);
472472
pFactoryWGPU->CreateDeviceAndContextsWebGPU(EngineCI, &m_pDevice, ppContexts.data());
473473
}
474474
#endif
@@ -480,7 +480,7 @@ GPUTestingEnvironment::GPUTestingEnvironment(const CreateInfo& EnvCI, const Swap
480480

481481
for (Uint32 ctx = NumDeferredCtx / 2; ctx < NumDeferredCtx; ++ctx)
482482
{
483-
m_pDevice->CreateDeferredContext(&ppContexts[std::max(ContextCI.size(), size_t{1}) + ctx]);
483+
m_pDevice->CreateDeferredContext(&ppContexts[(std::max)(ContextCI.size(), size_t{1}) + ctx]);
484484
}
485485

486486
{
@@ -499,7 +499,7 @@ GPUTestingEnvironment::GPUTestingEnvironment(const CreateInfo& EnvCI, const Swap
499499
}
500500

501501
constexpr Uint8 InvalidQueueId = 64; // MAX_COMMAND_QUEUES
502-
m_NumImmediateContexts = std::max(1u, static_cast<Uint32>(ContextCI.size()));
502+
m_NumImmediateContexts = (std::max)(1u, static_cast<Uint32>(ContextCI.size()));
503503
m_pDeviceContexts.resize(ppContexts.size());
504504
for (size_t i = 0; i < ppContexts.size(); ++i)
505505
{

0 commit comments

Comments
 (0)