mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-02 07:36:17 +01:00
gmessages: Simplify _g_log_abort() in gmessages.c a little
https://bugzilla.gnome.org/show_bug.cgi?id=744456
This commit is contained in:
parent
3613b7a366
commit
ae9e72ef61
@ -311,6 +311,8 @@ static void _g_log_abort (gboolean breakpoint);
|
||||
static void
|
||||
_g_log_abort (gboolean breakpoint)
|
||||
{
|
||||
gboolean debugger_present;
|
||||
|
||||
if (g_test_subprocess ())
|
||||
{
|
||||
/* If this is a test case subprocess then it probably caused
|
||||
@ -321,7 +323,14 @@ _g_log_abort (gboolean breakpoint)
|
||||
_exit (1);
|
||||
}
|
||||
|
||||
if (breakpoint)
|
||||
#ifdef G_OS_WIN32
|
||||
debugger_present = IsDebuggerPresent ();
|
||||
#else
|
||||
/* Assume GDB is attached. */
|
||||
debugger_present = TRUE;
|
||||
#endif /* !G_OS_WIN32 */
|
||||
|
||||
if (debugger_present && breakpoint)
|
||||
G_BREAKPOINT ();
|
||||
else
|
||||
g_abort ();
|
||||
@ -1075,10 +1084,9 @@ g_logv (const gchar *log_domain,
|
||||
MessageBox (NULL, locale_msg, NULL,
|
||||
MB_ICONERROR|MB_SETFOREGROUND);
|
||||
}
|
||||
_g_log_abort (IsDebuggerPresent () && !(test_level & G_LOG_FLAG_RECURSION));
|
||||
#else
|
||||
_g_log_abort (!(test_level & G_LOG_FLAG_RECURSION));
|
||||
#endif /* !G_OS_WIN32 */
|
||||
|
||||
_g_log_abort (!(test_level & G_LOG_FLAG_RECURSION));
|
||||
}
|
||||
|
||||
depth--;
|
||||
|
Loading…
Reference in New Issue
Block a user