OSDN Git Service

2011-09-07 François Dumont <francois.cppdevs@free.fr>
[pf3gnuchains/gcc-fork.git] / libstdc++-v3 / src / hash_c++0x.cc
index df97dff..852498d 100644 (file)
 
 #include <bits/functional_hash.h>
 
-namespace std
+namespace std _GLIBCXX_VISIBILITY(default)
 {
-  /// std::hash specialization for long double.
-  template<>
-    size_t
-    hash<long double>::operator()(long double __val) const
-    {
-      size_t __result = 0;
-
-      int __exponent;
-      __val = __builtin_frexpl(__val, &__exponent);
-      __val = __val < 0.0l ? -(__val + 0.5l) : __val;
-
-      const long double __mult = __SIZE_MAX__ + 1.0l;
-      __val *= __mult;
-
-      // Try to use all the bits of the mantissa (really necessary only
-      // on 32-bit targets, at least for 80-bit floating point formats).
-      const size_t __hibits = (size_t)__val;
-      __val = (__val - (long double)__hibits) * __mult;
-
-      const size_t __coeff = __SIZE_MAX__ / __LDBL_MAX_EXP__;
-
-      __result = __hibits + (size_t)__val + __coeff * __exponent;
-       
-      return __result;
-    }  
+#include "hash-long-double-aux.cc"
 }