From 48876d11762be01b393a2b08a90d854cbba1a985 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Wed, 10 Oct 2012 12:21:16 +0000 Subject: [PATCH] Fix for build failure when there are no long double functions. Fixes #7485. [SVN r80932] --- src/tr1/nexttoward.cpp | 4 ++++ src/tr1/nexttowardf.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/tr1/nexttoward.cpp b/src/tr1/nexttoward.cpp index 853b9e10e..7ce4e0abf 100644 --- a/src/tr1/nexttoward.cpp +++ b/src/tr1/nexttoward.cpp @@ -15,7 +15,11 @@ namespace boost{ namespace math{ namespace tr1{ extern "C" double BOOST_MATH_TR1_DECL boost_nexttoward BOOST_PREVENT_MACRO_SUBSTITUTION(double x, long double y) BOOST_MATH_C99_THROW_SPEC { +#ifdef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS + return c_policies::nextafter BOOST_PREVENT_MACRO_SUBSTITUTION(x, (double)y); +#else return (double)c_policies::nextafter BOOST_PREVENT_MACRO_SUBSTITUTION((long double)x, y); +#endif } }}} diff --git a/src/tr1/nexttowardf.cpp b/src/tr1/nexttowardf.cpp index a7da11ee0..ea7b83c5b 100644 --- a/src/tr1/nexttowardf.cpp +++ b/src/tr1/nexttowardf.cpp @@ -15,7 +15,11 @@ namespace boost{ namespace math{ namespace tr1{ extern "C" float BOOST_MATH_TR1_DECL boost_nexttowardf BOOST_PREVENT_MACRO_SUBSTITUTION(float x, long double y) BOOST_MATH_C99_THROW_SPEC { +#ifdef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS + return (float)c_policies::nextafter BOOST_PREVENT_MACRO_SUBSTITUTION((double)x, (double)y); +#else return (float)c_policies::nextafter BOOST_PREVENT_MACRO_SUBSTITUTION((long double)x, y); +#endif } }}}