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};
|
throw T{text};
|
||||||
#else
|
#else
|
||||||
// Otherwise manually instantiate the exception, print what() to stderr,
|
// Otherwise manually instantiate the exception, print what() to stderr,
|
||||||
// and abort
|
// and exit
|
||||||
T exception{text};
|
T exception{text};
|
||||||
std::cerr << exception.what() << std::endl;
|
std::cerr << exception.what() << std::endl;
|
||||||
std::cerr << "Aborting (exceptions disabled)..." << std::endl;
|
std::exit(EXIT_FAILURE);
|
||||||
std::abort();
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user