From: Ivan Maidanski Date: Thu, 1 Feb 2018 22:21:57 +0000 (+0300) Subject: Define ABORT() using _CrtDbgBreak (if available) on Windows host X-Git-Tag: v8.0.0~381 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=da69b00beac11e4770e5590f18da4eb9d0702778;p=platform%2Fupstream%2Flibgc.git Define ABORT() using _CrtDbgBreak (if available) on Windows host Issue #173 (bdwgc). * include/private/gc_priv.h [!CPPCHECK && !PCR && !NO_DEBUGGING && (MSWIN32 || MSWINCE)] (ABORT): Use _CrtDbgBreak() instead of DebugBreak() if _CrtDbgBreak, _DEBUG and _MSC_VER macros are defined. --- diff --git a/include/private/gc_priv.h b/include/private/gc_priv.h index 333969f..00bd3ea 100644 --- a/include/private/gc_priv.h +++ b/include/private/gc_priv.h @@ -563,10 +563,15 @@ typedef char * ptr_t; /* A generic pointer to which we can add */ # elif defined(MSWINCE) && defined(NO_DEBUGGING) # define ABORT(msg) (GC_on_abort(msg), ExitProcess(-1)) # elif defined(MSWIN32) || defined(MSWINCE) -# define ABORT(msg) { GC_on_abort(msg); DebugBreak(); } +# if defined(_CrtDbgBreak) && defined(_DEBUG) && defined(_MSC_VER) +# define ABORT(msg) { GC_on_abort(msg); \ + _CrtDbgBreak() /* __debugbreak() */; } +# else +# define ABORT(msg) { GC_on_abort(msg); DebugBreak(); } /* Note that: on a WinCE box, this could be silently */ /* ignored (i.e., the program is not aborted); */ /* DebugBreak is a statement in some toolchains. */ +# endif # else # define ABORT(msg) (GC_on_abort(msg), abort()) # endif /* !MSWIN32 */