]> git.lyx.org Git - features.git/blobdiff - boost/boost/functional/hash/detail/hash_float.hpp
boost: add eol property
[features.git] / boost / boost / functional / hash / detail / hash_float.hpp
index 8108f4650ccd6a2cdb34136d28fb410ab6e17670..ea1bc25f483a1a8aacc0de0fa75f4af61d12cc34 100644 (file)
-\r
-// Copyright 2005-2009 Daniel James.\r
-// Distributed under the Boost Software License, Version 1.0. (See accompanying\r
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)\r
-\r
-#if !defined(BOOST_FUNCTIONAL_HASH_DETAIL_HASH_FLOAT_HEADER)\r
-#define BOOST_FUNCTIONAL_HASH_DETAIL_HASH_FLOAT_HEADER\r
-\r
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)\r
-# pragma once\r
-#endif\r
-\r
-#include <boost/config.hpp>\r
-#include <boost/functional/hash/detail/float_functions.hpp>\r
-#include <boost/functional/hash/detail/limits.hpp>\r
-#include <boost/integer/static_log2.hpp>\r
-#include <boost/cstdint.hpp>\r
-#include <boost/assert.hpp>\r
-\r
-// Include hash implementation for the current platform.\r
-\r
-// Cygwn\r
-#if defined(__CYGWIN__)\r
-#  if defined(__i386__) || defined(_M_IX86)\r
-#    include <boost/functional/hash/detail/hash_float_x86.hpp>\r
-#  else\r
-#    include <boost/functional/hash/detail/hash_float_generic.hpp>\r
-#  endif\r
-#else\r
-#  include <boost/functional/hash/detail/hash_float_generic.hpp>\r
-#endif\r
-\r
-// Can we use fpclassify?\r
-\r
-// STLport\r
-#if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)\r
-#define BOOST_HASH_USE_FPCLASSIFY 0\r
-\r
-// GNU libstdc++ 3\r
-#elif defined(__GLIBCPP__) || defined(__GLIBCXX__)\r
-#  if (defined(__USE_ISOC99) || defined(_GLIBCXX_USE_C99_MATH)) && \\r
-      !(defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__))\r
-#    define BOOST_HASH_USE_FPCLASSIFY 1\r
-#  else\r
-#    define BOOST_HASH_USE_FPCLASSIFY 0\r
-#  endif\r
-\r
-// Everything else\r
-#else\r
-#  define BOOST_HASH_USE_FPCLASSIFY 0\r
-#endif\r
-\r
-#if BOOST_HASH_USE_FPCLASSIFY\r
-\r
-#include <boost/config/no_tr1/cmath.hpp>\r
-\r
-namespace boost\r
-{\r
-    namespace hash_detail\r
-    {\r
-        template <class T>\r
-        inline std::size_t float_hash_value(T v)\r
-        {\r
-            using namespace std;\r
-            switch (fpclassify(v)) {\r
-            case FP_ZERO:\r
-                return 0;\r
-            case FP_INFINITE:\r
-                return (std::size_t)(v > 0 ? -1 : -2);\r
-            case FP_NAN:\r
-                return (std::size_t)(-3);\r
-            case FP_NORMAL:\r
-            case FP_SUBNORMAL:\r
-                return float_hash_impl(v);\r
-            default:\r
-                BOOST_ASSERT(0);\r
-                return 0;\r
-            }\r
-        }\r
-    }\r
-}\r
-\r
-#else // !BOOST_HASH_USE_FPCLASSIFY\r
-\r
-namespace boost\r
-{\r
-    namespace hash_detail\r
-    {\r
-        template <class T>\r
-        inline std::size_t float_hash_value(T v)\r
-        {\r
-            return v == 0 ? 0 : float_hash_impl(v);\r
-        }\r
-    }\r
-}\r
-\r
-#endif // BOOST_HASH_USE_FPCLASSIFY\r
-\r
-#undef BOOST_HASH_USE_FPCLASSIFY\r
-\r
-#endif\r
+
+// Copyright 2005-2009 Daniel James.
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+#if !defined(BOOST_FUNCTIONAL_HASH_DETAIL_HASH_FLOAT_HEADER)
+#define BOOST_FUNCTIONAL_HASH_DETAIL_HASH_FLOAT_HEADER
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+#include <boost/config.hpp>
+#include <boost/functional/hash/detail/float_functions.hpp>
+#include <boost/functional/hash/detail/limits.hpp>
+#include <boost/integer/static_log2.hpp>
+#include <boost/cstdint.hpp>
+#include <boost/assert.hpp>
+
+// Include hash implementation for the current platform.
+
+// Cygwn
+#if defined(__CYGWIN__)
+#  if defined(__i386__) || defined(_M_IX86)
+#    include <boost/functional/hash/detail/hash_float_x86.hpp>
+#  else
+#    include <boost/functional/hash/detail/hash_float_generic.hpp>
+#  endif
+#else
+#  include <boost/functional/hash/detail/hash_float_generic.hpp>
+#endif
+
+// Can we use fpclassify?
+
+// STLport
+#if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
+#define BOOST_HASH_USE_FPCLASSIFY 0
+
+// GNU libstdc++ 3
+#elif defined(__GLIBCPP__) || defined(__GLIBCXX__)
+#  if (defined(__USE_ISOC99) || defined(_GLIBCXX_USE_C99_MATH)) && \
+      !(defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__))
+#    define BOOST_HASH_USE_FPCLASSIFY 1
+#  else
+#    define BOOST_HASH_USE_FPCLASSIFY 0
+#  endif
+
+// Everything else
+#else
+#  define BOOST_HASH_USE_FPCLASSIFY 0
+#endif
+
+#if BOOST_HASH_USE_FPCLASSIFY
+
+#include <boost/config/no_tr1/cmath.hpp>
+
+namespace boost
+{
+    namespace hash_detail
+    {
+        template <class T>
+        inline std::size_t float_hash_value(T v)
+        {
+            using namespace std;
+            switch (fpclassify(v)) {
+            case FP_ZERO:
+                return 0;
+            case FP_INFINITE:
+                return (std::size_t)(v > 0 ? -1 : -2);
+            case FP_NAN:
+                return (std::size_t)(-3);
+            case FP_NORMAL:
+            case FP_SUBNORMAL:
+                return float_hash_impl(v);
+            default:
+                BOOST_ASSERT(0);
+                return 0;
+            }
+        }
+    }
+}
+
+#else // !BOOST_HASH_USE_FPCLASSIFY
+
+namespace boost
+{
+    namespace hash_detail
+    {
+        template <class T>
+        inline std::size_t float_hash_value(T v)
+        {
+            return v == 0 ? 0 : float_hash_impl(v);
+        }
+    }
+}
+
+#endif // BOOST_HASH_USE_FPCLASSIFY
+
+#undef BOOST_HASH_USE_FPCLASSIFY
+
+#endif