diff liboctave/numeric/lo-mappers.cc @ 21232:b8cf410b5c88

eliminate feature tests from lo-mappers.h * lo-mappers.h, lo-mappers.cc (xisinf, xisnan, xfinite): Move feature tests inside functions in lo-mappers.cc.
author John W. Eaton <jwe@octave.org>
date Tue, 09 Feb 2016 04:55:29 -0500
parents 5f318c8ec634
children 40de9f8f23a6
line wrap: on
line diff
--- a/liboctave/numeric/lo-mappers.cc	Tue Feb 09 04:15:50 2016 -0500
+++ b/liboctave/numeric/lo-mappers.cc	Tue Feb 09 04:55:29 2016 -0500
@@ -139,29 +139,35 @@
 
 // double -> bool mappers.
 
-#if ! defined (HAVE_CMATH_ISNAN)
 bool
 xisnan (double x)
 {
+#if defined (HAVE_CMATH_ISNAN)
+  return std::isnan (x);
+#else
   return lo_ieee_isnan (x);
-}
 #endif
+}
 
-#if ! defined (HAVE_CMATH_ISFINITE)
 bool
 xfinite (double x)
 {
+#if defined (HAVE_CMATH_ISFINITE)
+  return std::isfinite (x);
+#else
   return lo_ieee_finite (x);
-}
 #endif
+}
 
-#if ! defined (HAVE_CMATH_ISINF)
 bool
 xisinf (double x)
 {
+#if defined (HAVE_CMATH_ISINF)
+  return std::isinf (x);
+#else
   return lo_ieee_isinf (x);
+#endif
 }
-#endif
 
 bool
 octave_is_NA (double x)
@@ -358,29 +364,35 @@
 
 // float -> bool mappers.
 
-#if ! defined (HAVE_CMATH_ISNANF)
 bool
 xisnan (float x)
 {
+#if defined (HAVE_CMATH_ISNANF)
+  return std::isnan (x);
+#else
   return lo_ieee_isnan (x);
-}
 #endif
+}
 
-#if ! defined (HAVE_CMATH_ISFINITEF)
 bool
 xfinite (float x)
 {
+#if defined (HAVE_CMATH_ISFINITEF)
+  return std::isfinite (x);
+#else
   return lo_ieee_finite (x);
-}
 #endif
+}
 
-#if ! defined (HAVE_CMATH_ISINFF)
 bool
 xisinf (float x)
 {
+#if defined (HAVE_CMATH_ISINFF)
+  return std::isinf (x);
+#else
   return lo_ieee_isinf (x);
+#endif
 }
-#endif
 
 bool
 octave_is_NA (float x)