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 *pretty_function,
const char *expression) const char *expression)
{ {
g_log (log_domain, if (expression)
G_LOG_LEVEL_ERROR, g_log (log_domain,
expression G_LOG_LEVEL_ERROR,
? "file %s: line %d (%s): assertion failed: (%s)" "file %s: line %d (%s): assertion failed: (%s)",
: "file %s: line %d (%s): should not be reached", file,
file, line,
line, pretty_function,
pretty_function, expression);
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); _g_log_abort (FALSE);
abort (); abort ();
} }