command/Error: workaround for gcc 4.x rethrow_exception(exception_ptr)

This commit is contained in:
Max Kellermann 2015-12-29 12:39:28 +01:00
parent 37862f0f20
commit 3843972b05

View File

@ -170,9 +170,19 @@ ToAck(std::exception_ptr ep)
return ToAck(pe.GetCode());
} catch (const std::system_error &e) {
return ACK_ERROR_SYSTEM;
#if defined(__GLIBCXX__) && __GLIBCXX__ < 20151204
} catch (const std::exception &e) {
#else
} catch (...) {
#endif
try {
#if defined(__GLIBCXX__) && __GLIBCXX__ < 20151204
/* workaround for g++ 4.x: no overload for
rethrow_exception(exception_ptr) */
std::rethrow_if_nested(e);
#else
std::rethrow_if_nested(ep);
#endif
return ACK_ERROR_UNKNOWN;
} catch (...) {
return ToAck(std::current_exception());