On Thu, Feb 25, 2010 at 08:45:15AM +0000, 
[email protected] wrote:
> From: "little.max" <[email protected]>
> 
> Hi Wt-Community!
> 
> I just builded wt-3.1.1b with msvc++ 2008 and got an compile error because
> of the use of std::max at a few places.
> I think it is because of including 'windows.h' in WtRandom.c and 
> random_device.c.
> 
> I defined NOMINMAX in the two projects 'wt' and 'wtext' and everything 
> worked fine!
> 
> best regards
> Max Quatember

Yup, the Win32 min/max macros always remain a namespace pollution
(well, macro pollution) problem.


One should probably add a manual
#define NOMINMAX 1
in Wt right before including any windows headers in the few places that
need them in this healthy software.
And probably also
#define WIN32_LEAN_AND_MEAN
in order to keep damage from inclusion of bloated, unspecific Win32 headers
to a minimum.


If in Windows API, always prefer using __min/__max macros to min/max,
to at least reduce the problem from this side.
And define NOMINMAX in your Win32 projects when possible
(although attempts to include the min/max-using MFC afxtempl.h
pose a problem then)


Thanks for the heads-up!

Andreas Mohr

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to