Remove Wasm exception handling workarounds.
This commit is contained in:
parent
4670d6ef4c
commit
5d519e380d
|
|
@ -34,19 +34,8 @@ else()
|
|||
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
|
||||
endif()
|
||||
endif()
|
||||
if (WASI)
|
||||
add_definitions(
|
||||
-DBOOST_EXCEPTION_DISABLE
|
||||
-DBOOST_NO_EXCEPTIONS
|
||||
-DBOOST_SP_NO_ATOMIC_ACCESS
|
||||
-DBOOST_AC_DISABLE_THREADS
|
||||
-DBOOST_NO_CXX11_HDR_MUTEX
|
||||
-DBOOST_NO_CXX11_HDR_ATOMIC
|
||||
)
|
||||
endif()
|
||||
set(boost_libs program_options)
|
||||
|
||||
find_package(Boost REQUIRED COMPONENTS ${boost_libs})
|
||||
find_package(Boost REQUIRED COMPONENTS program_options)
|
||||
|
||||
find_package(Git)
|
||||
|
||||
|
|
@ -135,4 +124,4 @@ add_custom_target(
|
|||
-style=file
|
||||
-i
|
||||
${CLANGFORMAT_FILES}
|
||||
)
|
||||
)
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@
|
|||
#include <iostream>
|
||||
#include <stdexcept>
|
||||
#include <streambuf>
|
||||
#include "wasmexcept.hpp"
|
||||
#include "Bitstream.hpp"
|
||||
#include "Chip.hpp"
|
||||
#include "ChipConfig.hpp"
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@
|
|||
#include <iostream>
|
||||
#include <stdexcept>
|
||||
#include <streambuf>
|
||||
#include "wasmexcept.hpp"
|
||||
#include "Bitstream.hpp"
|
||||
#include "Chip.hpp"
|
||||
#include "ChipConfig.hpp"
|
||||
|
|
|
|||
|
|
@ -1,25 +0,0 @@
|
|||
#if defined(__wasm)
|
||||
|
||||
#include <cstdint>
|
||||
#include <iostream>
|
||||
|
||||
extern "C" {
|
||||
// FIXME: WASI does not currently support exceptions.
|
||||
void *__cxa_allocate_exception(size_t thrown_size) throw() { return malloc(thrown_size); }
|
||||
bool __cxa_uncaught_exception() throw();
|
||||
void __cxa_throw(void *thrown_exception, struct std::type_info *tinfo, void (*dest)(void *)) { (void)thrown_exception; (void)tinfo; (void)dest; std::terminate(); }
|
||||
}
|
||||
|
||||
namespace boost {
|
||||
struct source_location;
|
||||
void throw_exception(std::exception const &e) {
|
||||
std::cerr << "boost::exception(): " << e.what() << std::endl;
|
||||
exit(1);
|
||||
}
|
||||
void throw_exception(std::exception const &e, boost::source_location const &) {
|
||||
std::cerr << "boost::exception(): " << e.what() << std::endl;
|
||||
exit(1);
|
||||
}
|
||||
} // namespace boost
|
||||
|
||||
#endif
|
||||
Loading…
Reference in New Issue