Check errno after calling frexp - this is pretty slow and unecessary on most platforms, but this close to release it seems better to be over cautious.

[SVN r29255]
This commit is contained in:
Daniel James
2005-05-28 12:10:33 +00:00
parent 85593ea401
commit b96ed7b984

View File

@@ -20,6 +20,7 @@
#include <cmath> #include <cmath>
#include <string> #include <string>
#include <functional> #include <functional>
#include <errno.h>
#include <boost/limits.hpp> #include <boost/limits.hpp>
#include <boost/functional/detail/float_functions.hpp> #include <boost/functional/detail/float_functions.hpp>
#include <boost/detail/workaround.hpp> #include <boost/detail/workaround.hpp>
@@ -264,7 +265,9 @@ namespace boost
inline std::size_t float_hash_value(T v) inline std::size_t float_hash_value(T v)
{ {
int exp = 0; int exp = 0;
errno = 0;
v = boost::hash_detail::call_frexp(v, &exp); v = boost::hash_detail::call_frexp(v, &exp);
if(errno) return 0;
std::size_t seed = 0; std::size_t seed = 0;