From dc735381707cdf409f955bf42a385cf5d75e1bbd Mon Sep 17 00:00:00 2001 From: Martchus Date: Thu, 19 Jan 2017 21:57:55 +0100 Subject: [PATCH] Adjust ios_base::failure workaround for GCC 7 * Use new ABI under GCC >= 7 * See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66145 --- io/catchiofailure.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/io/catchiofailure.cpp b/io/catchiofailure.cpp index 060cc6b..cd0435f 100644 --- a/io/catchiofailure.cpp +++ b/io/catchiofailure.cpp @@ -1,6 +1,12 @@ -// ensure the old ABI is used -// TODO: add condition for GCC version if GCC Bug 66145 is fixed +// ensure the old ABI is used under libstd++ < 7 and the new ABI under libstd++ >= 7 +#ifdef _GLIBCXX_RELEASE +#include +#if _GLIBCXX_RELEASE >= 7 +#define _GLIBCXX_USE_CXX11_ABI 1 +#else #define _GLIBCXX_USE_CXX11_ABI 0 +#endif +#endif #include "./catchiofailure.h"