Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r53205 - trunk/boost/functional/hash/detail
From: daniel_james_at_[hidden]
Date: 2009-05-23 11:21:39


Author: danieljames
Date: 2009-05-23 11:21:38 EDT (Sat, 23 May 2009)
New Revision: 53205
URL: http://svn.boost.org/trac/boost/changeset/53205

Log:
Try to deal with macros for frexpl and ldexpl.

The error message for msvc-9.0~wm5~stlport5.2 suggests that frexpl and ldexpl
are macros.
Text files modified:
   trunk/boost/functional/hash/detail/float_functions.hpp | 48 ++++++++++++++++++++++++++++++++++++++-
   1 files changed, 46 insertions(+), 2 deletions(-)

Modified: trunk/boost/functional/hash/detail/float_functions.hpp
==============================================================================
--- trunk/boost/functional/hash/detail/float_functions.hpp (original)
+++ trunk/boost/functional/hash/detail/float_functions.hpp 2009-05-23 11:21:38 EDT (Sat, 23 May 2009)
@@ -10,7 +10,6 @@
 #include <boost/config/no_tr1/cmath.hpp>
 #include <boost/type_traits/ice.hpp>
 #include <boost/detail/select_type.hpp>
-//#include <boost/assert.hpp>
 
 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
 # pragma once
@@ -33,10 +32,18 @@
 
     struct none {};
 
+#if !defined(ldexpf)
     none ldexpf(int, int);
+#endif
+#if !defined(ldexpl)
     none ldexpl(int, int);
+#endif
+#if !defined(frexpf)
     none frexpf(int, int*);
+#endif
+#if !defined(frexpl)
     none frexpl(int, int*);
+#endif
 
     template <class Float> none ldexp(Float, int);
     template <class Float> none frexp(Float, int*);
@@ -80,11 +87,48 @@
                 }; \
             }
 
+#define BOOST_HASH_CALL_FLOAT_MACRO(func, type, type2) \
+ struct func##_access { \
+ template <typename Float> \
+ struct check { \
+ BOOST_STATIC_CONSTANT(bool, value = true); \
+ }; \
+ \
+ template <typename Float> \
+ struct call \
+ { \
+ Float operator()(Float a, type2 b) const \
+ { \
+ return func(a, b); \
+ } \
+ }; \
+ }
+
+#if defined(ldexpf)
+ BOOST_HASH_CALL_FLOAT_MACRO(ldexpf, float, int);
+#else
             BOOST_HASH_CALL_FLOAT_FUNC(ldexpf, int);
+#endif
+
+#if defined(ldexpl)
+ BOOST_HASH_CALL_FLOAT_MACRO(ldexpl, long double, int);
+#else
             BOOST_HASH_CALL_FLOAT_FUNC(ldexpl, int);
- BOOST_HASH_CALL_FLOAT_FUNC(ldexp, int);
+#endif
+
+#if defined(frexpf)
+ BOOST_HASH_CALL_FLOAT_MACRO(frexpf, float, int*);
+#else
             BOOST_HASH_CALL_FLOAT_FUNC(frexpf, int*);
+#endif
+
+#if defined(frexpl)
+ BOOST_HASH_CALL_FLOAT_MACRO(frexpl, long double, int*);
+#else
             BOOST_HASH_CALL_FLOAT_FUNC(frexpl, int*);
+#endif
+
+ BOOST_HASH_CALL_FLOAT_FUNC(ldexp, int);
             BOOST_HASH_CALL_FLOAT_FUNC(frexp, int*);
             
 #undef BOOST_CALL_HAS_FLOAT_FUNC


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