Add support for compiling rxcpp with -fno-exceptions#456
Merged
kirkshoop merged 8 commits intoReactiveX:masterfrom Oct 27, 2018
Merged
Add support for compiling rxcpp with -fno-exceptions#456kirkshoop merged 8 commits intoReactiveX:masterfrom
kirkshoop merged 8 commits intoReactiveX:masterfrom
Conversation
Change-Id: Id623455d32e9323355744a240c2813d0411d1dac
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
Member
|
looks great! the CI builds seem to need some minor changes. vc will need |
Contributor
Author
|
That sounds straightforward enough to fix. Clarifying questions:
(Note that I am unfamiliar with CMake best practices, so I would be glad to hear of a specific suggestion if you have one in mind). |
Member
|
Good points. Regressions will be much less likely is there is a cmake option and a ci pass for this. I’ll add something for those if you don’t get to it first. :) I am certainly not a cmake proficient but I did recently add some cmake options to change compiler flags in the facebookresearch/pushmi repo that could be a start. |
Member
|
Thank you so much for this @iam! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Shall we continue our discussion on how we can upstream this now that I have rebased everything to tip-of-tree ?