[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freedesktop-poppler
Subject:    Re: [poppler] Followup Bug 32349 & Poppler: More shading fun ;-)
From:       jaham () gmx ! net
Date:       2011-01-25 18:16:07
Message-ID: 201101251916.08560.jaham () gmx ! net
[Download RAW message or body]

On Tuesday 25 January 2011 11:42:49 Pino Toscano wrote:
> Alle marted́ 25 gennaio 2011, Thomas Freitag ha scritto:
> > I had only a small problem compiling it with visual studio under
> > windows: the c-compiler has a problem with using std::min or
> > std::max, s. i.e.
> > http://heifner.blogspot.com/2008/02/stdmin-and-stdmax.html, so I
> > defined
> > 
> > #undef MIN
> > #define MIN(a, b) ((a) < (b) ? (a) : (b))
> > #undef MAX
> > #define MAX(a, b) ((a) > (b) ? (a) : (b))
> > 
> > and used MIN and MAX instead of std::min and std::max.
> 
> Please not: other being ugly, they are potentially dangerous (think
> about doing "MAX(i++, j)" with those macros).
> What I did in poppler-cpp is "foo = (std::min)(i, j)", which works
> correctly with any compiler.

Or just do "foo = std::min<int>(i, j);" which should work too and is even more 
explicit regarding the type.

Ciao Jan
_______________________________________________
poppler mailing list
poppler@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/poppler

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic