diff options
author | Daniel Lemire <lemire@gmail.com> | 2020-05-29 01:30:35 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-29 01:30:35 +0300 |
commit | 794c975287355de48158d9a80ed502d26b20a472 (patch) | |
tree | 52906fede7826ceea1167427774776e22965edf5 | |
parent | 12bc8d78e778b65bec357760bbe26b734abdf0e7 (diff) |
Exit instead of abort (#233)
Uses std::exit instead of abort to terminate when exceptions are disabled.
-rw-r--r-- | include/cxxopts.hpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/include/cxxopts.hpp b/include/cxxopts.hpp index 3dd5f52..e47cb81 100644 --- a/include/cxxopts.hpp +++ b/include/cxxopts.hpp @@ -480,11 +480,10 @@ namespace cxxopts throw T{text}; #else // Otherwise manually instantiate the exception, print what() to stderr, - // and abort + // and exit T exception{text}; std::cerr << exception.what() << std::endl; - std::cerr << "Aborting (exceptions disabled)..." << std::endl; - std::abort(); + std::exit(EXIT_FAILURE); #endif } |