Commit da539631 authored by Igor Murashkin's avatar Igor Murashkin
Browse files

Rx: Add support for compiling code without exceptions (-fno-exceptions)

std::exception_ptr usage is replaced with rxcpp::util::error_ptr
which will typedef to std::exception_ptr when exceptions are enabled.

When exceptions are disabled this will typedef to an internal error
type that can retain the "what" error message.

Additionally std::current_exception() and similar usages are replaced
with rxu::current_exception which uses error_ptr instead.

Lastly all try/catch/throw keywords are replaced with either
RXCPP_TRY, RXCPP_CATCH, rxu::throw_exception or similar.

Note that try/catch/throw keywords cause a compilation error with
-fno-exceptions. Trying to access most of the std::*exception* functions
will call std::terminate at runtime.

Tests using exceptions must be disabled by passing --nothrow to the
check2 test runner.

Change-Id: I0b95ae2e323653a17c3b733d165ecf87a014c315
parent 122c10b4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment