Closed YaaZ closed 4 months ago
You're right, defining NOMINMAX
before including windows.h
is the right thing to do.
Unfortunately, windows.h
is a bit too aggressive here and bites every program that's using std::min
or std::max
.
But that's a thing we cannot always control. What if one manually includes vulkan.h
without NOMINMAX
before vulkan.hpp
? Or even worse, manually including windows.h
?
Idk, maybe we could do something like this?
#push_macro("min")
#undef min
...
#pop_macro("min")
Was this a recent change? I'm seeing a similar build failure in our Vulkan Samples repo, which stops me from updating to a recent header version.
Yes, it seems there slipped some std::min or std::max into one of the generated headers lately... Will be fixed with #1906.
I started getting the following compilation errors on MSVC:
The token it complains about is
min
:Workaround: define
NOMINMAX
before includingwindows.h
invulkan.h
.