Jacek Caban <[EMAIL PROTECTED]> writes:

> +#include <math.h>
> +#include "basetsd.h"
> +
> +#ifndef NAN
> +
> +#ifdef __GNUC__
> +
> +# define NAN \
> +  (__extension__                                                             
>  \
> +   ((union { unsigned __l __attribute__ ((__mode__ (__SI__))); float __d; }) 
>  \
> +    { __l: 0x7fc00000UL }).__d)
> +
> +#else /* __GNUC__ */
> +
> +#ifdef WORDS_BIGENDIAN
> +#  define __nan_bytes           { 0x7f, 0xc0, 0, 0 }
> +#else
> +#  define __nan_bytes           { 0, 0, 0xc0, 0x7f }
> +#endif
> +
> +static union { unsigned char __c[4]; float __d; } __nan_union
> +    __attribute_used__ = { __nan_bytes };
> +# define NAN    (__nan_union.__d)
> +
> +#endif  /* __GNUC__  */
> +
> +#endif /* NAN */

I'd suggest to take advantage of the variant union instead of copying
all these glibc definitions. Something like

#ifdef NAN
    V_R8(&vt) = NAN;
#else
    V_I8(&vt) = nan_magic_pattern;
#endif

-- 
Alexandre Julliard
[EMAIL PROTECTED]


Reply via email to