From bc81adbd3fae66133ae5bc8128e9930674c9228a Mon Sep 17 00:00:00 2001 From: Jordan Bayles Date: Sun, 8 Nov 2020 21:40:01 -0800 Subject: [PATCH] add version checks around BOOST_NORETURN --- include/valijson/utils/property_tree_utils.hpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/include/valijson/utils/property_tree_utils.hpp b/include/valijson/utils/property_tree_utils.hpp index c4d49d2..2317f12 100644 --- a/include/valijson/utils/property_tree_utils.hpp +++ b/include/valijson/utils/property_tree_utils.hpp @@ -30,12 +30,18 @@ namespace boost { // Boost requires used-defined exception throwers when exceptions are // disabled. -BOOST_NORETURN void throw_exception(std::exception const & e ) { +// NOTE: BOOST_NORETURN attribute was added in 1.71. +#if (BOOST_VERSION >= 107100) +BOOST_NORETURN +#endif +void throw_exception(std::exception const & e ) { valijson::throwRuntimeError(e.what()); } -#if (BOOST_VERSION > 107300) -BOOST_NORETURN void throw_exception(std::exception const & e, boost::source_location const & loc ) { +// Source location override was added in 1.73. +#if (BOOST_VERSION >= 107300) +BOOST_NORETURN +void throw_exception(std::exception const & e, boost::source_location const & loc ) { valijson::throwRuntimeError(e.what()); } #endif