diff --git a/src/c_regex_traits.cpp b/src/c_regex_traits.cpp index 4e252e36..6557f750 100644 --- a/src/c_regex_traits.cpp +++ b/src/c_regex_traits.cpp @@ -375,15 +375,12 @@ void BOOST_REGEX_CALL re_message_update() if(*boost::re_detail::c_traits_base::get_catalogue()) { message_cat = catopen(boost::re_detail::c_traits_base::get_catalogue(), 0); -#ifndef BOOST_NO_EXCEPTIONS if(message_cat == (nl_catd)-1) { std::string m("Unable to open message catalog: "); - throw std::runtime_error(m + boost::re_detail::c_traits_base::get_catalogue()); + std::runtime_error err(m + boost::re_detail::c_traits_base::get_catalogue()); + boost::throw_exception(err); } -#else - BOOST_REGEX_NOEH_ASSERT(message_cat != (nl_catd)-1); -#endif } #endif for(int i = 0; i < boost::REG_E_UNKNOWN; ++i) diff --git a/src/cpp_regex_traits.cpp b/src/cpp_regex_traits.cpp index 6003bb46..db9d39bb 100644 --- a/src/cpp_regex_traits.cpp +++ b/src/cpp_regex_traits.cpp @@ -205,15 +205,12 @@ message_data::message_data(const std::locale& l, std::string regex_message { pm = &BOOST_USE_FACET(std::messages, l); cat = pm->open(regex_message_catalogue, l); -#ifndef BOOST_NO_EXCEPTIONS if(cat < 0) { std::string m("Unable to open message catalog: "); - throw std::runtime_error(m + regex_message_catalogue); + std::runtime_error err(m + regex_message_catalogue); + boost::throw_exception(err); } -#else - BOOST_REGEX_NOEH_ASSERT(cat >= 0); -#endif } #endif std::memset(syntax_map, cpp_regex_traits::syntax_char, 256); @@ -613,15 +610,12 @@ message_data::message_data(const std::locale& l, const std::string& reg if(regex_message_catalogue.size()) { cat = msgs.open(regex_message_catalogue, l); -#ifndef BOOST_NO_EXCEPTIONS if(cat < 0) { std::string m("Unable to open message catalog: "); - throw std::runtime_error(m + regex_message_catalogue); + std::runtime_error err(m + regex_message_catalogue); + boost::throw_exception(err); } -#else - BOOST_REGEX_NOEH_ASSERT(cat >= 0); -#endif } #endif scoped_array a; diff --git a/src/fileiter.cpp b/src/fileiter.cpp index ed0f80fe..af4c2346 100644 --- a/src/fileiter.cpp +++ b/src/fileiter.cpp @@ -83,11 +83,8 @@ void mapfile::open(const char* file) CloseHandle(hfile); hmap = 0; hfile = 0; -#ifndef BOOST_NO_EXCEPTIONS - throw std::runtime_error("Unable to create file mapping."); -#else - BOOST_REGEX_NOEH_ASSERT(hmap != INVALID_HANDLE_VALUE); -#endif + std::runtime_error err("Unable to create file mapping."); + boost::throw_exception(err); } _first = static_cast(MapViewOfFile(hmap, FILE_MAP_READ, 0, 0, 0)); if(_first == 0) @@ -96,11 +93,7 @@ void mapfile::open(const char* file) CloseHandle(hfile); hmap = 0; hfile = 0; -#ifndef BOOST_NO_EXCEPTIONS - throw std::runtime_error("Unable to create file mapping."); -#else - BOOST_REGEX_NOEH_ASSERT(_first != 0); -#endif + std::runtime_error err("Unable to create file mapping."); } _last = _first + GetFileSize(hfile, 0); } @@ -322,11 +315,7 @@ void mapfile::open(const char* file) } else { -#ifndef BOOST_NO_EXCEPTIONS - throw std::runtime_error("Unable to open file."); -#else - BOOST_REGEX_NOEH_ASSERT(hfile != 0); -#endif + std::runtime_error err("Unable to open file."); } #ifndef BOOST_NO_EXCEPTIONS }catch(...) diff --git a/src/w32_regex_traits.cpp b/src/w32_regex_traits.cpp index 5dac2c36..277e6a3b 100644 --- a/src/w32_regex_traits.cpp +++ b/src/w32_regex_traits.cpp @@ -236,15 +236,12 @@ void BOOST_REGEX_CALL w32_traits_base::do_init() if(*regex_message_catalogue) { hresmod = LoadLibraryA(regex_message_catalogue); -#ifndef BOOST_NO_EXCEPTIONS if(hresmod == NULL) { std::string s("Unable to open dll: "); - throw std::runtime_error(s + regex_message_catalogue); + std::runtime_error err(s + regex_message_catalogue); + boost::throw_exception(err); } -#else - BOOST_REGEX_NOEH_ASSERT(hresmod != NULL); -#endif } unsigned int i; for(i = 0; i < REG_E_UNKNOWN; ++i)