On Feb 25, 2005, at 9:27 PM, Peter Elmer wrote:
>
> Ah, you are right, I see several instances of this in the xrootd
> code:
>
> src/XrdOss/XrdOssConfig.cc:#define max(a,b) (a < b ? b : a)
>
> and
>
> src/XrdClient/XrdClientReadCache.hh:#define min(a, b) (a < b ? a : b)
>
> So this isn't a compiler bug, but redefinition of a keyword. We can
> change
> them to "xrdmax" and "xrdmin". I'll do that (since I'm fixing a bunch
> of
> other stupid things) unless somebody complains soon.
Peter,
You were too quick for me. Why not just change them to std::min and
std::max and let the standard library do its work for you? The only
time this would be a problem is when the types of "a" and "b" are
different, and you probably want to catch that at compile time, anyway.
No?
--
Gregory J. Sharp email: [log in to unmask]
Wilson Synchrotron Laboratory url:
http://www.lepp.cornell.edu/~gregor
Dryden Rd ph: +1 607 255 4882
Ithaca, NY 14853 fax: +1 607 255 8062
|