had to give up on [[noreturn]]
This commit is contained in:
parent
84ff17dfa6
commit
e080c467ea
@ -72,23 +72,21 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
FMT_BEGIN_NAMESPACE
|
FMT_BEGIN_NAMESPACE
|
||||||
// terror == terminating error
|
//
|
||||||
[[noreturn]] inline void terror(const char msg_[BUFSIZ]) {
|
[[noreturn]] inline void fail_fast(const char msg_[BUFSIZ]) {
|
||||||
::puts("\n\n\nFast exit on {fmt} error with message: ");
|
::puts("\n\n\nFast exit on {fmt} error with message: ");
|
||||||
::puts(msg_);
|
::puts(msg_);
|
||||||
::perror("\nPOSIX error message: ");
|
::perror("\nPOSIX error message: ");
|
||||||
std::exit(EXIT_FAILURE);
|
std::exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
namespace internal {
|
namespace internal {
|
||||||
template <typename Exception>
|
template <typename Exception>
|
||||||
#ifndef FMT_EXCEPTIONS
|
inline void do_throw(const Exception& x) {
|
||||||
[[noreturn]]
|
|
||||||
#endif
|
|
||||||
inline void do_throw(const Exception& x) {
|
|
||||||
#if FMT_EXCEPTIONS
|
#if FMT_EXCEPTIONS
|
||||||
throw x;
|
volatile bool b = true ;
|
||||||
|
if (b) throw x;
|
||||||
#else
|
#else
|
||||||
terror(x.what());
|
fail_fast(x.what());
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user