pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pkg/41170: pkgsrc/x11/xplanet build fails on solaris (patch included)



The following reply was made to PR pkg/41170; it has been noted by GNATS.

From: Joerg Sonnenberger <joerg%britannica.bec.de@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: pkg/41170: pkgsrc/x11/xplanet build fails on solaris (patch
        included)
Date: Wed, 8 Apr 2009 12:08:09 +0200

 On Wed, Apr 08, 2009 at 02:05:00AM +0000, tez%netbsd.org@localhost wrote:
 > +#ifndef signbit
 > +#define signbit(x) \
 > +  (sizeof(x) == sizeof(float) \
 > +     ? ({ union { float f; unsigned int i[1]; } __s; \
 > +        __s.f = (x); __s.i[0] >> 31; }) \
 > +     : sizeof(x) == sizeof(long double) \
 > +       ? ({ union { long double f; unsigned int i[4]; } __s; \
 > +          __s.f = (x); __s.i[0] >> 31; }) \
 > +       : ({ union { double f; unsigned int i[2]; } __s; \
 > +          __s.f = (x); __s.i[0] >> 31; }))
 > +#endif /* signbit */
 > +
 
 Why not simply
 #ifndef signbit
 #define signbit(x) (x < 0 ? 1 : 0)
 #endif
 If you have to deal with NaNs at that point, add an explicit check.
 
 Joerg
 


Home | Main Index | Thread Index | Old Index