This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: ACE/TAO under Cygwin (was: ORB)


Tim,

Thank you for your input.  As I have not been following the
development/maturing
of the C/C++ language and standards, I was not aware that this was
standard/common.
This was *exactly* the information I was trying to find out.

My problem/encounter with the log2() macro comes from trying to port the ACE
environment to Cygwin.  As the ACE environment has been ported to *many*
different platform OS's
(over 40 listed at http://www.cs.wustl.edu/~schmidt/ACE-overview.html ).
ACE provides a (properly namespace'd) implementation of log2() without your
recommended (required) "#undef log2" included in the class header file.

I was hesitant to suggest to the ACE development group that they were in
error
based solely (it seemed to me) on problems compiling under Cygwin.

HOWEVER, armed now with the information at hand, I can perhaps suggest to
the ACE development group that such an addition to the header file is in
order.

Thank you.
	-David.
---------------------
David Dawson
david dot w dot dawson at lmco dot com
703-367-3885


>----- Original Message -----
>From: "Timothy C Prince" <tprince at myrealbox dot com>
>To: <david dot w dot dawson at lmco dot com>
>Cc: <cygwin at cygwin dot com>
>Sent: Monday, April 07, 2003 12:36 PM
>Subject: Re: RE: ACE/TAO under Cygwin (was: ORB)
>
>
>
>Did you forget the usual precautions, when implementing your own version of
>a standard intrinsic?
>
># undef log2
>
>double (log2)(double x){}
>
>Using a preprocessor macro for log2() is a usual tactic for ia32.  It's a
>standard function in C99, included in most libraries which implement (even
>partly) gcc's c99 support.  You __must__ use the #undef if you want a
"real"
>log2() according to the current standard, whether you provide it yourself,
>or hope for the library to have it already (cygwin/newlib doesn't).
>
>__________________________________________________
>This wouldn't be the first time C99 made an older program questionably
>compliant by providing a log2() function in the standard list.  I guess
>the worst case would be if an exact int result were expected, but the
>standard log2() happened to present a result which is slightly smaller.
>This shouldn't happen with the glibc macro, because rounding from long
>double to double prior to truncating would take care of it.

>Tim Prince

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]