The only really general solution is to not include windows.h in the headers .
This header is a killer and does everything it can to make your code explode. It will not compile without the MSVC language extension extension, and this is the worst example of macro abuse I have ever seen.
Include it in a single .cpp file, and then put the wrappers in a header that the rest of your code can use. If windows.h is not displayed, it cannot conflict with your names.
For the min / max case, you can #define NOMINMAX before enabling windows.h. Then it will not define these specific macros.
jalf Sep 08 '09 at 2:00 p.m. 2009-09-08 14:00
source share