From 26dc8abf250378f6b83a92cb944907059da648e8 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Fri, 12 Oct 2007 11:58:34 +0000 Subject: [PATCH] Fix my botched attempt at supporting function pointers on Sun's compilers. Also, now only applies the workaround to function pointers, non-function pointers are treated as before. I might need to apply the special case to member function pointers as well. [SVN r39960] --- include/boost/functional/hash/hash.hpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/include/boost/functional/hash/hash.hpp b/include/boost/functional/hash/hash.hpp index 4927a01..1ffbc24 100644 --- a/include/boost/functional/hash/hash.hpp +++ b/include/boost/functional/hash/hash.hpp @@ -28,6 +28,10 @@ #include #endif +#if BOOST_WORKAROUND(__SUNPRO_CC, <= 0x590) +#include +#endif + namespace boost { std::size_t hash_value(bool); @@ -214,7 +218,9 @@ namespace boost reinterpret_cast(v)); #else std::size_t x = static_cast( - reinterpret_cast(v)); + boost::is_function::value ? + reinterpret_cast((void*) v) : + reinterpret_cast(v)); #endif return x + (x >> 3); }