Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-18 09:04:06

0001 // Copyright 2008-2024 Emil Dotchevski and Reverge Studios, Inc.
0002 // Distributed under the Boost Software License, Version 1.0. (See accompanying
0003 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0004 
0005 #ifndef BOOST_QVM_THROW_EXCEPTION
0006 
0007 #   define BOOST_QVM_THROW_EXCEPTION ::boost::qvm::throw_exception
0008 
0009 #   include <exception>
0010 
0011 #   ifndef BOOST_QVM_NO_EXCEPTIONS
0012 #       if defined(__clang__) && !defined(__ibmxl__) // Clang C++ emulates GCC, so it has to appear early.
0013 #           if !__has_feature(cxx_exceptions)
0014 #               define BOOST_QVM_NO_EXCEPTIONS
0015 #           endif
0016 #       elif defined(__DMC__) // Digital Mars C++
0017 #           if !defined(_CPPUNWIND)
0018 #               define BOOST_QVM_NO_EXCEPTIONS
0019 #           endif
0020 #       elif defined(__GNUC__) && !defined(__ibmxl__) // GNU C++:
0021 #           if !defined(__EXCEPTIONS)
0022 #               define BOOST_QVM_NO_EXCEPTIONS
0023 #           endif
0024 #       elif defined(__KCC) // Kai C++
0025 #           if !defined(_EXCEPTIONS)
0026 #               define BOOST_QVM_NO_EXCEPTIONS
0027 #           endif
0028 #       elif defined(__CODEGEARC__) // CodeGear - must be checked for before Borland
0029 #           if !defined(_CPPUNWIND) && !defined(__EXCEPTIONS)
0030 #               define BOOST_QVM_NO_EXCEPTIONS
0031 #           endif
0032 #       elif defined(__BORLANDC__) // Borland
0033 #           if !defined(_CPPUNWIND) && !defined(__EXCEPTIONS)
0034 #               define BOOST_QVM_NO_EXCEPTIONS
0035 #           endif
0036 #       elif defined(__MWERKS__) // Metrowerks CodeWarrior
0037 #           if !__option(exceptions)
0038 #               define BOOST_QVM_NO_EXCEPTIONS
0039 #           endif
0040 #       elif defined(__IBMCPP__) && defined(__COMPILER_VER__) && defined(__MVS__) // IBM z/OS XL C/C++
0041 #           if !defined(_CPPUNWIND) && !defined(__EXCEPTIONS)
0042 #           define BOOST_QVM_NO_EXCEPTIONS
0043 #           endif
0044 #       elif defined(__ibmxl__) // IBM XL C/C++ for Linux (Little Endian)
0045 #           if !__has_feature(cxx_exceptions)
0046 #               define BOOST_QVM_NO_EXCEPTIONS
0047 #           endif
0048 #       elif defined(_MSC_VER) // Microsoft Visual C++
0049             // Must remain the last #elif since some other vendors (Metrowerks, for
0050             // example) also #define _MSC_VER
0051 #           if !defined(_CPPUNWIND)
0052 #               define BOOST_QVM_NO_EXCEPTIONS
0053 #           endif
0054 #       endif
0055 #   endif
0056 
0057 ////////////////////////////////////////
0058 
0059 #   ifdef BOOST_NORETURN
0060 #       define BOOST_QVM_NORETURN BOOST_NORETURN
0061 #   else
0062 #       if defined(_MSC_VER)
0063 #           define BOOST_QVM_NORETURN __declspec(noreturn)
0064 #       elif defined(__GNUC__)
0065 #           define BOOST_QVM_NORETURN __attribute__ ((__noreturn__))
0066 #       elif defined(__has_attribute) && defined(__SUNPRO_CC) && (__SUNPRO_CC > 0x5130)
0067 #           if __has_attribute(noreturn)
0068 #               define BOOST_QVM_NORETURN [[noreturn]]
0069 #           endif
0070 #       elif defined(__has_cpp_attribute)
0071 #           if __has_cpp_attribute(noreturn)
0072 #               define BOOST_QVM_NORETURN [[noreturn]]
0073 #           endif
0074 #       endif
0075 #   endif
0076 
0077 #   if !defined(BOOST_QVM_NORETURN)
0078 #       define BOOST_QVM_NORETURN
0079 #   endif
0080 
0081 ////////////////////////////////////////
0082 
0083 #   ifdef BOOST_QVM_NO_EXCEPTIONS
0084 
0085 namespace boost
0086 {
0087     BOOST_QVM_NORETURN void throw_exception( std::exception const & ); // user defined
0088 }
0089 
0090 namespace boost { namespace qvm {
0091 
0092     template <class T>
0093     BOOST_QVM_NORETURN void throw_exception( T const & e )
0094     {
0095         ::boost::throw_exception(e);
0096     }
0097 
0098 } }
0099 
0100 #   else
0101 
0102 namespace boost { namespace qvm {
0103 
0104     template <class T>
0105     BOOST_QVM_NORETURN void throw_exception( T const & e )
0106     {
0107         throw e;
0108     }
0109 
0110 } }
0111 
0112 #   endif
0113 
0114 #endif