Chris@16: /* Boost interval/hw_rounding.hpp template implementation file Chris@16: * Chris@16: * Copyright 2002 Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion Chris@16: * Copyright 2005 Guillaume Melquiond Chris@16: * Chris@16: * Distributed under the Boost Software License, Version 1.0. Chris@16: * (See accompanying file LICENSE_1_0.txt or Chris@16: * copy at http://www.boost.org/LICENSE_1_0.txt) Chris@16: */ Chris@16: Chris@16: #ifndef BOOST_NUMERIC_INTERVAL_HW_ROUNDING_HPP Chris@16: #define BOOST_NUMERIC_INTERVAL_HW_ROUNDING_HPP Chris@16: Chris@16: #include Chris@16: #include Chris@16: Chris@16: #define BOOST_NUMERIC_INTERVAL_NO_HARDWARE Chris@16: Chris@16: // define appropriate specialization of rounding_control for built-in types Chris@16: #if defined(__x86_64__) && (defined(__USE_ISOC99) || defined(__APPLE__)) Chris@16: # include Chris@16: #elif defined(__i386__) || defined(_M_IX86) || defined(__BORLANDC__) || defined(_M_X64) Chris@16: # include Chris@16: #elif defined(powerpc) || defined(__powerpc__) || defined(__ppc__) Chris@16: # include Chris@16: #elif defined(sparc) || defined(__sparc__) Chris@16: # include Chris@16: #elif defined(alpha) || defined(__alpha__) Chris@16: # include Chris@16: #elif defined(ia64) || defined(__ia64) || defined(__ia64__) Chris@16: # include Chris@16: #endif Chris@16: Chris@16: #if defined(BOOST_NUMERIC_INTERVAL_NO_HARDWARE) && (defined(__USE_ISOC99) || defined(__MSL__)) Chris@16: # include Chris@16: #endif Chris@16: Chris@16: #if defined(BOOST_NUMERIC_INTERVAL_NO_HARDWARE) Chris@16: # undef BOOST_NUMERIC_INTERVAL_NO_HARDWARE Chris@16: # error Boost.Numeric.Interval: Please specify rounding control mechanism. Chris@16: #endif Chris@16: Chris@16: namespace boost { Chris@16: namespace numeric { Chris@16: namespace interval_lib { Chris@16: Chris@16: /* Chris@16: * Three specializations of rounded_math Chris@16: */ Chris@16: Chris@16: template<> Chris@16: struct rounded_math Chris@16: : save_state > Chris@16: {}; Chris@16: Chris@16: template<> Chris@16: struct rounded_math Chris@16: : save_state > Chris@16: {}; Chris@16: Chris@16: template<> Chris@16: struct rounded_math Chris@16: : save_state > Chris@16: {}; Chris@16: Chris@16: } // namespace interval_lib Chris@16: } // namespace numeric Chris@16: } // namespace boost Chris@16: Chris@16: #endif // BOOST_NUMERIC_INTERVAL_HW_ROUNDING_HPP