Skip to content

Report crash messages on Windows to the CRT #369

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 20, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ DISPATCH_EXPORT DISPATCH_NOTHROW void dispatch_atfork_child(void);
#endif
#if defined(_WIN32)
#include <io.h>
#include <crtdbg.h>
#endif

#if defined(__GNUC__) || defined(__clang__)
Expand Down Expand Up @@ -876,9 +877,19 @@ _dispatch_ktrace_impl(uint32_t code, uint64_t a, uint64_t b,
#define _dispatch_hardware_crash() \
__asm__(""); __builtin_trap() // <rdar://problem/17464981>

#ifdef _WIN32
#define _dispatch_set_crash_log_cause_and_message(ac, msg) do { \
(void)(ac); \
_dispatch_set_crash_log_message_dynamic((msg)); \
} while (0)
#define _dispatch_set_crash_log_message(msg) \
_dispatch_set_crash_log_message_dynamic((msg))
#define _dispatch_set_crash_log_message_dynamic(msg) _RPTF0(_CRT_ASSERT, (msg))
#else
#define _dispatch_set_crash_log_cause_and_message(ac, msg) ((void)(ac))
#define _dispatch_set_crash_log_message(msg)
#define _dispatch_set_crash_log_message_dynamic(msg)
#endif

#if HAVE_MACH
// MIG_REPLY_MISMATCH means either:
Expand Down