Files

36 lines
1.4 KiB
C++
Raw Permalink Normal View History

2018-06-12 15:37:28 +02:00
/*
* nextpnr -- Next Generation Place and Route
*
2021-06-09 13:09:08 +01:00
* Copyright (C) 2018 Claire Xenia Wolf <[email protected]>
2018-06-12 15:37:28 +02:00
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/
2020-05-23 19:50:09 +00:00
#if defined(__wasm)
2021-03-16 05:52:41 +00:00
#include <exception>
2021-03-18 13:30:37 -07:00
#include <typeinfo>
2021-03-16 05:52:41 +00:00
#include "log.h"
2020-05-23 19:50:09 +00:00
extern "C" {
2020-06-12 16:19:14 +01:00
// 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 *)) { std::terminate(); }
2020-05-23 19:50:09 +00:00
}
namespace boost {
2020-06-12 16:19:14 +01:00
void throw_exception(std::exception const &e) { NEXTPNR_NAMESPACE::log_error("boost::exception(): %s\n", e.what()); }
} // namespace boost
2020-05-23 19:50:09 +00:00
#endif