+ //! Note that in order to handle signals as C++ exceptions on Linux and under
+ //! MinGW on Windows it is necessary to compile both OCCT and application with
+ //! OCC_CONVERT_SIGNALS macro, and use macro OCC_CATCH_SIGNALS within each try{}
+ //! block that has to catch this kind of exceptions.
+ //!
+ //! Refer to documentation of Standard_ErrorHandler.hxx for details.
+ Standard_EXPORT static void SetSignal (OSD_SignalMode theSignalMode,
+ Standard_Boolean theFloatingSignal);
+
+ //! Sets signal and FPE handlers.
+ //! Short-cut for OSD::SetSignal (OSD_SignalMode_Set, theFloatingSignal).
+ static void SetSignal (const Standard_Boolean theFloatingSignal = Standard_True)
+ {
+ SetSignal (OSD_SignalMode_Set, theFloatingSignal);
+ }
+
+ //! Initializes thread-local signal handlers.
+ //! This includes _set_se_translator() on Windows platform, and SetFloatingSignal().
+ //! The main purpose of this method is initializing handlers for newly created threads
+ //! without overriding global handlers (set by application or by OSD::SetSignal()).
+ Standard_EXPORT static void SetThreadLocalSignal (OSD_SignalMode theSignalMode,
+ Standard_Boolean theFloatingSignal);
+
+ //! Enables / disables generation of C signal on floating point exceptions (FPE).
+ //! This call does NOT register a handler for signal raised in case of FPE -
+ //! SetSignal() should be called beforehand for complete setup.
+ //! Note that FPE setting is thread-local, new threads inherit it from parent.
+ Standard_EXPORT static void SetFloatingSignal (Standard_Boolean theFloatingSignal);
+
+ //! Returns signal mode set by the last call to SetSignal().
+ //! By default, returns OSD_SignalMode_AsIs.
+ Standard_EXPORT static OSD_SignalMode SignalMode();