mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-13 14:05:05 +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
|
static void
|
||||||
_g_log_abort (gboolean breakpoint)
|
_g_log_abort (gboolean breakpoint)
|
||||||
{
|
{
|
||||||
|
gboolean debugger_present;
|
||||||
|
|
||||||
if (g_test_subprocess ())
|
if (g_test_subprocess ())
|
||||||
{
|
{
|
||||||
/* If this is a test case subprocess then it probably caused
|
/* If this is a test case subprocess then it probably caused
|
||||||
@ -321,7 +323,14 @@ _g_log_abort (gboolean breakpoint)
|
|||||||
_exit (1);
|
_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 ();
|
G_BREAKPOINT ();
|
||||||
else
|
else
|
||||||
g_abort ();
|
g_abort ();
|
||||||
@ -1075,10 +1084,9 @@ g_logv (const gchar *log_domain,
|
|||||||
MessageBox (NULL, locale_msg, NULL,
|
MessageBox (NULL, locale_msg, NULL,
|
||||||
MB_ICONERROR|MB_SETFOREGROUND);
|
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 */
|
#endif /* !G_OS_WIN32 */
|
||||||
|
|
||||||
|
_g_log_abort (!(test_level & G_LOG_FLAG_RECURSION));
|
||||||
}
|
}
|
||||||
|
|
||||||
depth--;
|
depth--;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user