Exit instead of abort (#233)
Uses std::exit instead of abort to terminate when exceptions are disabled.
This commit is contained in:
parent
12bc8d78e7
commit
794c975287
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user