[glib] gmessages: make g_assert_warning compiler friendly
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] gmessages: make g_assert_warning compiler friendly
- Date: Sat, 28 Jun 2014 17:35:48 +0000 (UTC)
commit ab9f63fadd8f769b2b2ae7c32a8cce42fac01451
Author: Patrick Welche <prlw1 cam ac uk>
Date: Sat Jan 4 17:42:23 2014 +0000
gmessages: make g_assert_warning compiler friendly
https://bugzilla.gnome.org/show_bug.cgi?id=720708
glib/gmessages.c | 24 +++++++++++++++---------
1 files changed, 15 insertions(+), 9 deletions(-)
---
diff --git a/glib/gmessages.c b/glib/gmessages.c
index a3340c2..53728cd 100644
--- a/glib/gmessages.c
+++ b/glib/gmessages.c
@@ -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 ();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]