X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FStdMeshers%2FStdMeshers_NumberOfSegments.cxx;h=f4819f92c0fd0ec66996ad502700954cdc1c6ba9;hp=76cd67965ccfda360d1dfd8f9ab4c64f322a2e8a;hb=31282d88869470e2076e06357535c486971a8248;hpb=0ef2b313da77bf984725fb6ae9af82c73dbd077c diff --git a/src/StdMeshers/StdMeshers_NumberOfSegments.cxx b/src/StdMeshers/StdMeshers_NumberOfSegments.cxx index 76cd67965..f4819f92c 100644 --- a/src/StdMeshers/StdMeshers_NumberOfSegments.cxx +++ b/src/StdMeshers/StdMeshers_NumberOfSegments.cxx @@ -33,8 +33,6 @@ #include "SMESHDS_SubMesh.hxx" #include "SMESH_Mesh.hxx" -#include "CASCatch.hxx" - #include #include #include @@ -43,6 +41,18 @@ #include #include +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 +#define NO_CAS_CATCH +#endif + +#include + +#ifdef NO_CAS_CATCH +#include +#else +#include "CASCatch.hxx" +#endif + using namespace std; const double PRECISION = 1e-7; @@ -218,12 +228,18 @@ void StdMeshers_NumberOfSegments::SetTableFunction(const std::vector& ta double val = table[i*2+1]; if( _convMode==0 ) { - CASCatch_TRY - { +#ifdef NO_CAS_CATCH + try { + OCC_CATCH_SIGNALS; +#else + CASCatch_TRY { +#endif val = pow( 10.0, val ); - } - CASCatch_CATCH(Standard_Failure) - { +#ifdef NO_CAS_CATCH + } catch(Standard_Failure) { +#else + } CASCatch_CATCH(Standard_Failure) { +#endif Handle(Standard_Failure) aFail = Standard_Failure::Caught(); throw SALOME_Exception( LOCALIZED( "invalid value")); return; @@ -312,13 +328,19 @@ bool process( const TCollection_AsciiString& str, int convMode, { bool parsed_ok = true; Handle( ExprIntrp_GenExp ) myExpr; - CASCatch_TRY - { +#ifdef NO_CAS_CATCH + try { + OCC_CATCH_SIGNALS; +#else + CASCatch_TRY { +#endif myExpr = ExprIntrp_GenExp::Create(); myExpr->Process( str.ToCString() ); - } - CASCatch_CATCH(Standard_Failure) - { +#ifdef NO_CAS_CATCH + } catch(Standard_Failure) { +#else + } CASCatch_CATCH(Standard_Failure) { +#endif Handle(Standard_Failure) aFail = Standard_Failure::Caught(); parsed_ok = false; }