Index: src/core/model/fatal-impl.cc |
=================================================================== |
--- a/src/core/model/fatal-impl.cc |
+++ b/src/core/model/fatal-impl.cc |
@@ -160,9 +160,14 @@ |
* streams even if one of the stream pointers is bad. |
* The SIGSEGV override should only be active for the |
* duration of this function. */ |
+#ifndef _WIN32 |
struct sigaction hdl; |
hdl.sa_handler=sigHandler; |
sigaction (SIGSEGV, &hdl, 0); |
+#else |
+ typedef void(*SignalHandlerPointer) (int); |
+ SignalHandlerPointer previousHandler = signal(SIGSEGV, sigHandler); |
+#endif |
std::list<std::ostream*> *l = *pl; |
@@ -174,9 +179,14 @@ |
s->flush (); |
} |
+#ifndef _WIN32 |
/* Restore default SIGSEGV handler (Not that it matters anyway) */ |
hdl.sa_handler=SIG_DFL; |
sigaction (SIGSEGV, &hdl, 0); |
+#else |
+ /* Restore default SIGSEGV handler (Not that it matters anyway) */ |
+ signal(SIGSEGV, previousHandler); |
+#endif |
/* Flush all opened FILE* */ |
std::fflush (0); |