diff options
author | Paul Betts <paul@paulbetts.org> | 2011-10-27 11:48:58 +0200 |
---|---|---|
committer | Martin Sustrik <sustrik@250bpm.com> | 2011-10-27 11:48:58 +0200 |
commit | 1b706ac02858aee4c960331dc7100f8c14312848 (patch) | |
tree | dd494e2d5308e74704ba1545e567931f9f7d91c3 /src/err.cpp | |
parent | b3cda2ad6091096264f777a95907050edfdd3ffe (diff) |
Enable exceptions raising on assert on Win32
This patch changes the Win32 version to call RaiseException instead of abort
(which eventually calls TerminateProcess). This allows crash dumps to be sent
correctly instead of the process disappearing.
Signed-off-by: Paul Betts <paul@paulbetts.org>
Diffstat (limited to 'src/err.cpp')
-rw-r--r-- | src/err.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/err.cpp b/src/err.cpp index f374de9..ff81e03 100644 --- a/src/err.cpp +++ b/src/err.cpp @@ -62,6 +62,19 @@ const char *zmq::errno_to_string (int errno_) } } +void zmq::zmq_abort(const char *errmsg_) +{ +#if defined ZMQ_HAVE_WINDOWS + + // Raise STATUS_FATAL_APP_EXIT. + ULONG_PTR extra_info [1]; + extra_info [0] = (ULONG_PTR) errmsg_; + RaiseException (0x40000015, EXCEPTION_NONCONTINUABLE, 1, extra_info); +#else + abort (); +#endif +} + #ifdef ZMQ_HAVE_WINDOWS const char *zmq::wsa_error() |