gmessages: make g_assert_warning compiler friendly

https://bugzilla.gnome.org/show_bug.cgi?id=720708
This commit is contained in:
Patrick Welche 2014-01-04 17:42:23 +00:00 committed by Matthias Clasen
parent dce88768dc
commit ab9f63fadd

View File

@ -1119,15 +1119,21 @@ g_assert_warning (const char *log_domain,
const char *pretty_function,
const char *expression)
{
g_log (log_domain,
G_LOG_LEVEL_ERROR,
expression
? "file %s: line %d (%s): assertion failed: (%s)"
: "file %s: line %d (%s): should not be reached",
file,
line,
pretty_function,
expression);
if (expression)
g_log (log_domain,
G_LOG_LEVEL_ERROR,
"file %s: line %d (%s): assertion failed: (%s)",
file,
line,
pretty_function,
expression);
else
g_log (log_domain,
G_LOG_LEVEL_ERROR,
"file %s: line %d (%s): should not be reached",
file,
line,
pretty_function);
_g_log_abort (FALSE);
abort ();
}