fix windows unit test build

This commit is contained in:
Arvid Norberg 2012-04-28 18:49:53 +00:00
parent f031bfa176
commit acff091cad
1 changed files with 8 additions and 0 deletions

View File

@ -51,11 +51,15 @@ void sig_handler(int sig)
{ {
#define SIG(x) case x: sig_name = #x; break #define SIG(x) case x: sig_name = #x; break
SIG(SIGSEGV); SIG(SIGSEGV);
#ifdef SIGBUS
SIG(SIGBUS); SIG(SIGBUS);
#endif
SIG(SIGILL); SIG(SIGILL);
SIG(SIGABRT); SIG(SIGABRT);
SIG(SIGFPE); SIG(SIGFPE);
#ifdef SIGSYS
SIG(SIGSYS); SIG(SIGSYS);
#endif
#undef SIG #undef SIG
}; };
fprintf(stderr, "signal: %s caught:\n%s\n", sig_name, stack_text); fprintf(stderr, "signal: %s caught:\n%s\n", sig_name, stack_text);
@ -75,11 +79,15 @@ int main()
#endif #endif
signal(SIGSEGV, &sig_handler); signal(SIGSEGV, &sig_handler);
#ifdef SIGBUS
signal(SIGBUS, &sig_handler); signal(SIGBUS, &sig_handler);
#endif
signal(SIGILL, &sig_handler); signal(SIGILL, &sig_handler);
signal(SIGABRT, &sig_handler); signal(SIGABRT, &sig_handler);
signal(SIGFPE, &sig_handler); signal(SIGFPE, &sig_handler);
#ifdef SIGSYS
signal(SIGSYS, &sig_handler); signal(SIGSYS, &sig_handler);
#endif
#ifndef BOOST_NO_EXCEPTIONS #ifndef BOOST_NO_EXCEPTIONS
try try