Windows min and max macros are undefined by SmartWin, which is bad in many cases.
At least one of the tests does not compile: project "Canvas", file "canvas_all.cpp", when
"#define UseGdiPlus 1"
is uncommented.
The workaround is simple: _never_ undefine min and/or max, but convert code like this:
"std::min(a,b)"
to
"(std::min)(a,b)"
The same applies to std::numeric_limits<...>::min and std::numeric_limits<...>::max.
It is always worth to have a look at boost, you find the same solution to this issue too.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have checked in your solution to the CVS. Canvas now compiles with UseGdiPlus defined.
Min and max are no longer #undef, and I replaced occurrences of std::min( ) with (std::min)( ) etc.
I only checked in the removal of min/max from VCDesktopHeaders.h
I have not removed the max/min undef from the other platform headers yet.
Thanks for the bringing the problem and the solution to our attention.
Andrew
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Windows min and max macros are undefined by SmartWin, which is bad in many cases.
At least one of the tests does not compile: project "Canvas", file "canvas_all.cpp", when
"#define UseGdiPlus 1"
is uncommented.
The workaround is simple: _never_ undefine min and/or max, but convert code like this:
"std::min(a,b)"
to
"(std::min)(a,b)"
The same applies to std::numeric_limits<...>::min and std::numeric_limits<...>::max.
It is always worth to have a look at boost, you find the same solution to this issue too.
I have checked in your solution to the CVS. Canvas now compiles with UseGdiPlus defined.
Min and max are no longer #undef, and I replaced occurrences of std::min( ) with (std::min)( ) etc.
I only checked in the removal of min/max from VCDesktopHeaders.h
I have not removed the max/min undef from the other platform headers yet.
Thanks for the bringing the problem and the solution to our attention.
Andrew