From 1b706ac02858aee4c960331dc7100f8c14312848 Mon Sep 17 00:00:00 2001 From: Paul Betts Date: Thu, 27 Oct 2011 11:48:58 +0200 Subject: 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 --- src/err.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/err.cpp') 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() -- cgit v1.2.3