Hacker News new | ask | show | jobs
by Night_Thastus 1088 days ago
We've had to use this at my work a couple times. I forget the exact reasoning, but IIRC if you're using including parts of the Win32 API, you get some things that would stomp on C or C++ names, which is bad. Macros like that one prevent loading things you don't want.

One example was min and max - Win32 includes those which messes with trying to use std::min and std::max.

3 comments

There's NOMINMAX, NOGDI, etc. for that.
not only min, max, other "fun" ones to debug are "near", "far", "small"
I think we had to use that when importing FDI.h (the CAB-extracting part of winapi) to avoid it bringing more legacy cruft.