Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 09:58:02

0001 ///////////////////////////////////////////////////////////////////////////////
0002 //  Copyright 2004 - 2021 Pavel Vozenilek.
0003 //  Copyright 2021 Matt Borland. Distributed under the Boost
0004 //  Software License, Version 1.0. (See accompanying file
0005 //  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0006 
0007 #ifndef BOOST_MP_DETAIL_NO_EXCEPTIONS_SUPPORT_HPP
0008 #define BOOST_MP_DETAIL_NO_EXCEPTIONS_SUPPORT_HPP
0009 
0010 #include <boost/multiprecision/detail/standalone_config.hpp>
0011 
0012 #ifdef BOOST_MP_STANDALONE
0013 
0014 #ifndef BOOST_NO_EXCEPTIONS
0015 #   define BOOST_MP_TRY { try
0016 #   define BOOST_MP_CATCH(x) catch(x)
0017 #   define BOOST_MP_RETHROW throw;
0018 #   define BOOST_MP_CATCH_END }
0019 #   define BOOST_MP_THROW_EXCEPTION(x) throw (x);
0020 #else
0021 #   if !defined(BOOST_MSVC) || BOOST_MSVC >= 1900
0022 #       define BOOST_MP_TRY { if (true)
0023 #       define BOOST_MP_CATCH(x) else if (false)
0024 #   else
0025         // warning C4127: conditional expression is constant
0026 #       define BOOST_MP_TRY { \
0027             __pragma(warning(push)) \
0028             __pragma(warning(disable: 4127)) \
0029             if (true) \
0030             __pragma(warning(pop))
0031 #       define BOOST_MP_CATCH(x) else \
0032             __pragma(warning(push)) \
0033             __pragma(warning(disable: 4127)) \
0034             if (false) \
0035             __pragma(warning(pop))
0036 #   endif
0037 #   define BOOST_MP_RETHROW
0038 #   define BOOST_MP_CATCH_END }
0039 #   define BOOST_MP_THROW_EXCEPTION(x) {static_cast<void>(x);}
0040 #endif
0041 
0042 #else // Not standalone mode
0043 
0044 #   include <boost/core/no_exceptions_support.hpp>
0045 #   include <boost/throw_exception.hpp>
0046 
0047 #   define BOOST_MP_TRY BOOST_TRY
0048 #   define BOOST_MP_CATCH(x) BOOST_CATCH(x)
0049 #   define BOOST_MP_RETHROW BOOST_RETHROW
0050 #   define BOOST_MP_CATCH_END BOOST_CATCH_END
0051 #   define BOOST_MP_THROW_EXCEPTION(x) BOOST_THROW_EXCEPTION(x)
0052 
0053 #endif // BOOST_MP_STANDALONE
0054 
0055 #endif // BOOST_MP_DETAIL_NO_EXCEPTIONS_SUPPORT_HPP