__ios_failure(const char* s) : failure(s)
{ __construct_ios_failure(buf, runtime_error::what()); }
- __ios_failure(const char* s, int e) : failure(s, to_error_code(e))
+ __ios_failure(const char* s, const error_code& e) : failure(s, e)
{ __construct_ios_failure(buf, runtime_error::what()); }
~__ios_failure()
// There are assertions in src/c++98/ios_failure.cc to ensure the size
// and alignment assumptions are valid.
alignas(runtime_error) unsigned char buf[sizeof(runtime_error)];
-
- static error_code
- to_error_code(int e)
- { return e ? error_code(e, system_category()) : io_errc::stream; }
};
// Custom type info for __ios_failure.
void
__throw_ios_failure(const char* str __attribute__((unused)),
int err __attribute__((unused)))
- { _GLIBCXX_THROW_OR_ABORT(__ios_failure(_(str), err)); }
+ {
+ _GLIBCXX_THROW_OR_ABORT(__ios_failure(_(str),
+ err ? error_code(err, generic_category()) : io_errc::stream));
+ }
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace