X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FUtils%2FUtils_ExceptHandlers.hxx;h=8d9077cfdcf031a9bacc6bdcde7733e9d027efb4;hb=f874f9e8af85d546b42fe661e423286f7fe203a3;hp=7996ae9221bb70665e17e3c354a4d7c1eca4f0dd;hpb=788659d329f8451bd9c2197748003d2dd69b2e85;p=modules%2Fkernel.git diff --git a/src/Utils/Utils_ExceptHandlers.hxx b/src/Utils/Utils_ExceptHandlers.hxx index 7996ae922..8d9077cfd 100644 --- a/src/Utils/Utils_ExceptHandlers.hxx +++ b/src/Utils/Utils_ExceptHandlers.hxx @@ -29,25 +29,39 @@ #ifndef Utils_ExceptHandlers_HeaderFile #define Utils_ExceptHandlers_HeaderFile +#include + #include typedef void (*PVF)(); -class Unexpect { //save / retrieve unexpected exceptions treatment +class UTILS_EXPORT Unexpect { //save / retrieve unexpected exceptions treatment PVF old; public : +#ifndef WNT Unexpect( PVF f ) { old = std::set_unexpected(f); } ~Unexpect() { std::set_unexpected(old); } +#else + Unexpect( PVF f ) + { old = ::set_unexpected(f); } + ~Unexpect() { ::set_unexpected(old); } +#endif }; -class Terminate {//save / retrieve terminate function +class UTILS_EXPORT Terminate {//save / retrieve terminate function PVF old; public : +#ifndef WNT Terminate( PVF f ) { old = std::set_terminate(f); } ~Terminate() { std::set_terminate(old); } +#else + Terminate( PVF f ) + { old = ::set_terminate(f); } + ~Terminate() { ::set_terminate(old); } +#endif }; #define UNEXPECT_CATCH(FuncName, ExceptionConstructor) \ @@ -69,7 +83,7 @@ inline void FuncName () {\ //Definitions : -extern void SalomeException(); -extern void SALOME_SalomeException(); +UTILS_EXPORT extern void SalomeException(); +UTILS_EXPORT extern void SALOME_SalomeException(); #endif