Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r50055 - in trunk/boost/math: special_functions tools
From: john_at_[hidden]
Date: 2008-12-01 08:31:40


Author: johnmaddock
Date: 2008-12-01 08:31:39 EST (Mon, 01 Dec 2008)
New Revision: 50055
URL: http://svn.boost.org/trac/boost/changeset/50055

Log:
Adjust usage logic of log1pl and expm1l.
Text files modified:
   trunk/boost/math/special_functions/expm1.hpp | 2 +-
   trunk/boost/math/special_functions/fpclassify.hpp | 4 +++-
   trunk/boost/math/special_functions/log1p.hpp | 4 +---
   trunk/boost/math/tools/config.hpp | 14 +++++++++++++-
   4 files changed, 18 insertions(+), 6 deletions(-)

Modified: trunk/boost/math/special_functions/expm1.hpp
==============================================================================
--- trunk/boost/math/special_functions/expm1.hpp (original)
+++ trunk/boost/math/special_functions/expm1.hpp 2008-12-01 08:31:39 EST (Mon, 01 Dec 2008)
@@ -233,7 +233,7 @@
 #endif
 
 #if defined(BOOST_HAS_EXPM1) && !(defined(__osf__) && defined(__DECCXX_VER))
-# if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901)
+# ifdef BOOST_MATH_USE_C99
 inline float expm1(float x, const policies::policy<>&){ return ::expm1f(x); }
 inline long double expm1(long double x, const policies::policy<>&){ return ::expm1l(x); }
 #else

Modified: trunk/boost/math/special_functions/fpclassify.hpp
==============================================================================
--- trunk/boost/math/special_functions/fpclassify.hpp (original)
+++ trunk/boost/math/special_functions/fpclassify.hpp 2008-12-01 08:31:39 EST (Mon, 01 Dec 2008)
@@ -165,7 +165,9 @@
 {
    return BOOST_FPCLASSIFY_PREFIX fpclassify(t);
 }
-#if !defined(__CYGWIN__) && !defined(__HP_aCC) && !defined(BOOST_INTEL) && !defined(BOOST_NO_NATIVE_LONG_DOUBLE_FP_CLASSIFY)
+#if !defined(__CYGWIN__) && !defined(__HP_aCC) && !defined(BOOST_INTEL) \
+ && !defined(BOOST_NO_NATIVE_LONG_DOUBLE_FP_CLASSIFY)
+ && !(defined(__GNUC__) && !defined(BOOST_MATH_USE_C99))
 // The native fpclassify broken for long doubles with aCC
 // use portable one instead....
 inline int fpclassify BOOST_NO_MACRO_EXPAND(long double t)

Modified: trunk/boost/math/special_functions/log1p.hpp
==============================================================================
--- trunk/boost/math/special_functions/log1p.hpp (original)
+++ trunk/boost/math/special_functions/log1p.hpp 2008-12-01 08:31:39 EST (Mon, 01 Dec 2008)
@@ -316,9 +316,7 @@
 #endif
 
 #if defined(BOOST_HAS_LOG1P) && !(defined(__osf__) && defined(__DECCXX_VER))
-# if (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901)) \
- || ((defined(linux) || defined(__linux) || defined(__linux__)) && !defined(__SUNPRO_CC)) \
- || (defined(__hpux) && !defined(__hppa))
+# ifdef BOOST_MATH_USE_C99
 template <class Policy>
 inline float log1p(float x, const Policy& pol)
 {

Modified: trunk/boost/math/tools/config.hpp
==============================================================================
--- trunk/boost/math/tools/config.hpp (original)
+++ trunk/boost/math/tools/config.hpp 2008-12-01 08:31:39 EST (Mon, 01 Dec 2008)
@@ -70,6 +70,18 @@
 # define BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS
 #endif
 
+#if (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901))
+# define BOOST_MATH_USE_C99
+#endif
+
+#if (defined(__hpux) && !defined(__hppa))
+# define BOOST_MATH_USE_C99
+#endif
+
+#if defined(__GNUC__) && defined(_GLIBCXX_USE_C99)
+# define BOOST_MATH_USE_C99
+#endif
+
 #if defined(BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS) || BOOST_WORKAROUND(__SUNPRO_CC, <= 0x590)
 
 # include "boost/type.hpp"
@@ -219,7 +231,7 @@
 } // namespace tools
 }} // namespace boost namespace math
 
-#ifdef __linux__
+#if defined(__linux__) || defined(__QNX__) || defined(__IBMCPP__)
 
    #include <fenv.h>
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk