Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r54025 - trunk/boost/functional/hash/detail
From: daniel_james_at_[hidden]
Date: 2009-06-17 17:23:42


Author: danieljames
Date: 2009-06-17 17:23:42 EDT (Wed, 17 Jun 2009)
New Revision: 54025
URL: http://svn.boost.org/trac/boost/changeset/54025

Log:
Try to avoid using special macro handling code.
Text files modified:
   trunk/boost/functional/hash/detail/float_functions.hpp | 38 ++------------------------------------
   1 files changed, 2 insertions(+), 36 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-06-17 17:23:42 EDT (Wed, 17 Jun 2009)
@@ -100,7 +100,8 @@
 #define BOOST_HASH_CALL_FLOAT_FUNC(cpp_func, c99_func, type1, type2) \
 namespace BOOST_HASH_DETECT_FLOAT_FUNCTIONS { \
     template <class Float> \
- boost::hash_detail::not_found c99_func(Float, type2); \
+ boost::hash_detail::not_found c99_func \
+ BOOST_PREVENT_MACRO_SUBSTITUTION (Float, type2); \
 } \
                                                                         \
 namespace boost { \
@@ -163,48 +164,13 @@
     } \
 }
 
-#define BOOST_HASH_CALL_FLOAT_MACRO(cpp_func, c99_func, type1, type2) \
-namespace boost { \
- namespace hash_detail { \
- \
- template <> \
- struct call_##cpp_func<type1> { \
- typedef type1 float_type; \
- inline type1 operator()(type1 x, type2 y) const { \
- return c99_func(x, y); \
- } \
- }; \
- } \
-}
-
-#if defined(ldexpf)
-BOOST_HASH_CALL_FLOAT_MACRO(ldexp, ldexpf, float, int)
-#else
 BOOST_HASH_CALL_FLOAT_FUNC(ldexp, ldexpf, float, int)
-#endif
-
-#if defined(ldexpl)
-BOOST_HASH_CALL_FLOAT_MACRO(ldexp, ldexpl, long double, int)
-#else
 BOOST_HASH_CALL_FLOAT_FUNC(ldexp, ldexpl, long double, int)
-#endif
-
-#if defined(frexpf)
-BOOST_HASH_CALL_FLOAT_MACRO(frexp, frexpf, float, int*)
-#else
 BOOST_HASH_CALL_FLOAT_FUNC(frexp, frexpf, float, int*)
-#endif
-
-#if defined(frexpl)
-BOOST_HASH_CALL_FLOAT_MACRO(frexp, frexpl, long double, int*)
-#else
 BOOST_HASH_CALL_FLOAT_FUNC(frexp, frexpl, long double, int*)
-#endif
 
-#undef BOOST_HASH_CALL_FLOAT_MACRO
 #undef BOOST_HASH_CALL_FLOAT_FUNC
 
-
 namespace boost
 {
     namespace hash_detail


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