1 #ifndef UNITTEST_SIGNALTRANSLATOR_H
2 #define UNITTEST_SIGNALTRANSLATOR_H
15 static sigjmp_buf* s_jumpTarget;
18 sigjmp_buf m_currentJumpTarget;
19 sigjmp_buf* m_oldJumpTarget;
21 struct sigaction m_old_SIGFPE_action;
22 struct sigaction m_old_SIGTRAP_action;
23 struct sigaction m_old_SIGSEGV_action;
24 struct sigaction m_old_SIGBUS_action;
29 #if !defined (__GNUC__)
30 #define UNITTEST_EXTENSION
32 #define UNITTEST_EXTENSION __extension__
35 #define UNITTEST_THROW_SIGNALS_POSIX_ONLY \
36 UnitTest::SignalTranslator sig; \
37 if (UNITTEST_EXTENSION sigsetjmp(*UnitTest::SignalTranslator::s_jumpTarget, 1) != 0) \
38 { throw ("Unhandled system exception"); }