From: abn Date: Mon, 28 Nov 2016 08:52:44 +0000 (+0100) Subject: Fix for FED24 compilation. Mix up between C++11 and C++98 exception. X-Git-Tag: V8_2_0rc1~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ca72cca457f5f1afedb420aa1e1fb197812f3c48;p=tools%2Fmedcoupling.git Fix for FED24 compilation. Mix up between C++11 and C++98 exception. --- diff --git a/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DQuadraticPolygon.cxx b/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DQuadraticPolygon.cxx index bc7016198..9cfb34075 100644 --- a/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DQuadraticPolygon.cxx +++ b/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DQuadraticPolygon.cxx @@ -60,9 +60,24 @@ QuadraticPolygon::QuadraticPolygon(const char *file) } while(1); } - catch(std::ifstream::failure&) + catch(const std::ifstream::failure&) { } + catch(const std::exception & ex) + { + // Some code before this catch throws the C++98 version of the exception (mangled + // name is " NSt8ios_base7failureE"), but FED24 compilation of the current version of the code + // tries to catch the C++11 version of it (mangled name "NSt8ios_base7failureB5cxx11E"). + // So we have this nasty hack to catch both versions ... + + // TODO: the below should be replaced by a better handling avoiding exception throwing. + if (std::string(ex.what()) == "basic_ios::clear") + { + //std::cout << "std::ios_base::failure C++11\n"; + } + else + throw ex; + } front()->changeStartNodeWith(back()->getEndNode()); }