fix for failing tests with exception-handling=off

This commit is contained in:
Hans Dembinski 2019-12-15 17:30:29 +01:00 committed by GitHub
parent e415be10cd
commit 1540c4e94a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View File

@ -6,7 +6,7 @@
cmake_minimum_required(VERSION 3.6)
project(BoostHistogram VERSION 1.72.0 LANGUAGES CXX)
project(BoostHistogram VERSION 1.73.0 LANGUAGES CXX)
add_library(boost_histogram INTERFACE)
set_property(TARGET boost_histogram PROPERTY EXPORT_NAME histogram)

View File

@ -6,16 +6,20 @@
#ifdef BOOST_NO_EXCEPTIONS
#include <boost/assert/source_location.hpp>
#include <cstdlib> // std::abort
#include <exception>
#include <iostream>
namespace boost {
// dummy implementation for user-defined function from boost/throw_exception.hpp
inline void throw_exception(std::exception const& e) {
std::cerr << e.what() << std::endl;
inline void throw_exception(std::exception const& e, boost::source_location const& l) {
std::cerr << l.file_name() << ":" << l.line() << ":" << l.column() << ": exception in '"
<< l.function_name() << " \"" << e.what() << "\"" << std::endl;
std::abort();
}
} // namespace boost
#endif