# HG changeset patch # User John W. Eaton # Date 1455011729 18000 # Node ID b8cf410b5c889f3c41e31e53511b9e0b942fc19f # Parent 5f318c8ec6345f4d9478656db00395661ce9b023 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. diff -r 5f318c8ec634 -r b8cf410b5c88 liboctave/numeric/lo-mappers.cc --- 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) diff -r 5f318c8ec634 -r b8cf410b5c88 liboctave/numeric/lo-mappers.h --- a/liboctave/numeric/lo-mappers.h Tue Feb 09 04:15:50 2016 -0500 +++ b/liboctave/numeric/lo-mappers.h Tue Feb 09 04:55:29 2016 -0500 @@ -53,24 +53,9 @@ inline bool xisnan (bool) { return false; } inline bool xisnan (char) { return false; } -#if defined (HAVE_CMATH_ISNAN) -inline bool xisnan (double x) -{ return std::isnan (x); } -#else extern OCTAVE_API bool xisnan (double x); -#endif -#if defined (HAVE_CMATH_ISFINITE) -inline bool xfinite (double x) -{ return std::isfinite (x); } -#else extern OCTAVE_API bool xfinite (double x); -#endif -#if defined (HAVE_CMATH_ISINF) -inline bool xisinf (double x) -{ return std::isinf (x); } -#else extern OCTAVE_API bool xisinf (double x); -#endif extern OCTAVE_API bool octave_is_NA (double x); @@ -131,24 +116,9 @@ extern OCTAVE_API FloatComplex xlog2 (const FloatComplex& x, int& exp); extern OCTAVE_API float xexp2 (float x); -#if defined (HAVE_CMATH_ISNANF) -inline bool xisnan (float x) -{ return std::isnan (x); } -#else extern OCTAVE_API bool xisnan (float x); -#endif -#if defined (HAVE_CMATH_ISFINITEF) -inline bool xfinite (float x) -{ return std::isfinite (x); } -#else extern OCTAVE_API bool xfinite (float x); -#endif -#if defined (HAVE_CMATH_ISINFF) -inline bool xisinf (float x) -{ return std::isinf (x); } -#else extern OCTAVE_API bool xisinf (float x); -#endif extern OCTAVE_API bool octave_is_NA (float x);