From 3843972b05ac70805d1ea5ad303809161756c8c2 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 29 Dec 2015 12:39:28 +0100 Subject: [PATCH] command/Error: workaround for gcc 4.x rethrow_exception(exception_ptr) --- src/command/CommandError.cxx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/command/CommandError.cxx b/src/command/CommandError.cxx index 42e622727..dd7826366 100644 --- a/src/command/CommandError.cxx +++ b/src/command/CommandError.cxx @@ -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());