$NetBSD: patch-ah,v 1.1 2006/09/24 15:20:28 joerg Exp $

--- tme/generic/float.h.orig	2006-09-24 16:50:59.000000000 +0000
+++ tme/generic/float.h
@@ -334,6 +334,27 @@ tme_float_assert_formats(_tme_const stru
    | (x)->tme_float_value_ieee754_quad.tme_float_ieee754_quad_lo.tme_value64_uint32_lo)
 
 /* this evaluates to nonzero if the float is a NaN: */
+#if defined(isnan) && defined(__DragonFly__)
+#define tme_float_is_nan(x, formats) \
+  (tme_float_assert_formats(x, formats) \
+   && (tme_float_is_format(x, formats, TME_FLOAT_FORMAT_IEEE754_SINGLE) \
+       ? (tme_float_value_ieee754_exponent_single(x) == 0xff \
+	  && tme_float_value_ieee754_fracor_single(x) != 0) \
+       : tme_float_is_format(x, formats, TME_FLOAT_FORMAT_IEEE754_DOUBLE) \
+       ? (tme_float_value_ieee754_exponent_double(x) == 0x7ff \
+	  && tme_float_value_ieee754_fracor_double(x) != 0) \
+       : tme_float_is_format(x, formats, TME_FLOAT_FORMAT_IEEE754_EXTENDED80) \
+       ? (tme_float_value_ieee754_exponent_extended80(x) == 0x7fff \
+	  && tme_float_value_ieee754_fracor_extended80(x) != 0) \
+       : tme_float_is_format(x, formats, TME_FLOAT_FORMAT_IEEE754_QUAD) \
+       ? (tme_float_value_ieee754_exponent_quad(x) == 0x7fff \
+	  && tme_float_value_ieee754_fracor_quad(x) != 0) \
+       : tme_float_is_format(x, formats, TME_FLOAT_FORMAT_FLOAT) \
+       ? isnan((x)->tme_float_value_float) \
+       : tme_float_is_format(x, formats, TME_FLOAT_FORMAT_DOUBLE) \
+       ? isnan((x)->tme_float_value_double) \
+       : TME_FLOAT_IF_LONG_DOUBLE(isnan((x)->tme_float_value_long_double) ||) FALSE))
+#else
 #define tme_float_is_nan(x, formats) \
   (tme_float_assert_formats(x, formats) \
    && (tme_float_is_format(x, formats, TME_FLOAT_FORMAT_IEEE754_SINGLE) \
@@ -353,8 +374,30 @@ tme_float_assert_formats(_tme_const stru
        : tme_float_is_format(x, formats, TME_FLOAT_FORMAT_DOUBLE) \
        ? isnan((x)->tme_float_value_double) \
        : TME_FLOAT_IF_LONG_DOUBLE(isnan((x)->tme_float_value_long_double) ||) FALSE))
+#endif
 
 /* this evaluates to nonzero if the float is an infinity: */
+#if defined(isinf) && defined(__DragonFly__)
+#define tme_float_is_inf(x, formats) \
+  (tme_float_assert_formats(x, formats) \
+   && (tme_float_is_format(x, formats, TME_FLOAT_FORMAT_IEEE754_SINGLE) \
+       ? (tme_float_value_ieee754_exponent_single(x) == 0xff \
+	  && tme_float_value_ieee754_fracor_single(x) == 0) \
+       : tme_float_is_format(x, formats, TME_FLOAT_FORMAT_IEEE754_DOUBLE) \
+       ? (tme_float_value_ieee754_exponent_double(x) == 0x7ff \
+	  && tme_float_value_ieee754_fracor_double(x) == 0) \
+       : tme_float_is_format(x, formats, TME_FLOAT_FORMAT_IEEE754_EXTENDED80) \
+       ? (tme_float_value_ieee754_exponent_extended80(x) == 0x7fff \
+	  && tme_float_value_ieee754_fracor_extended80(x) == 0) \
+       : tme_float_is_format(x, formats, TME_FLOAT_FORMAT_IEEE754_QUAD) \
+       ? (tme_float_value_ieee754_exponent_quad(x) == 0x7fff \
+	  && tme_float_value_ieee754_fracor_quad(x) == 0) \
+       : tme_float_is_format(x, formats, TME_FLOAT_FORMAT_FLOAT) \
+       ? isinf((x)->tme_float_value_float) \
+       : tme_float_is_format(x, formats, TME_FLOAT_FORMAT_DOUBLE) \
+       ? isinf((x)->tme_float_value_double) \
+       : TME_FLOAT_IF_LONG_DOUBLE(isinf((x)->tme_float_value_long_double) ||) FALSE))
+#else
 #define tme_float_is_inf(x, formats) \
   (tme_float_assert_formats(x, formats) \
    && (tme_float_is_format(x, formats, TME_FLOAT_FORMAT_IEEE754_SINGLE) \
@@ -374,6 +417,7 @@ tme_float_assert_formats(_tme_const stru
        : tme_float_is_format(x, formats, TME_FLOAT_FORMAT_DOUBLE) \
        ? isinf((x)->tme_float_value_double) \
        : TME_FLOAT_IF_LONG_DOUBLE(isinf((x)->tme_float_value_long_double) ||) FALSE))
+#endif
 
 /* this evaluates to nonzero if the float is a zero: */
 #define tme_float_is_zero(x, formats) \
