2004-09-29 Matthias Clasen <mclasen@redhat.com>
+ * glib/glib.symbols: Add g_assert_warning.
+
+ * glib/gmessages.h:
+ * glib/gmessages.c (g_assert_warning): Treat g_assert
+ in the same way as g_return_if_fail and move the string
+ constants into a helper function, which also takes
+ care of removing the "IA__" prefix from internal aliases.
+
* glib/gmessages.h: Move the declaration of
g_return_if_fail_warning() out of the ifdefs, so that
building with G_DISABLE_ASSERT works.
2004-09-29 Matthias Clasen <mclasen@redhat.com>
+ * glib/glib.symbols: Add g_assert_warning.
+
+ * glib/gmessages.h:
+ * glib/gmessages.c (g_assert_warning): Treat g_assert
+ in the same way as g_return_if_fail and move the string
+ constants into a helper function, which also takes
+ care of removing the "IA__" prefix from internal aliases.
+
* glib/gmessages.h: Move the declaration of
g_return_if_fail_warning() out of the ifdefs, so that
building with G_DISABLE_ASSERT works.
2004-09-29 Matthias Clasen <mclasen@redhat.com>
+ * glib/glib.symbols: Add g_assert_warning.
+
+ * glib/gmessages.h:
+ * glib/gmessages.c (g_assert_warning): Treat g_assert
+ in the same way as g_return_if_fail and move the string
+ constants into a helper function, which also takes
+ care of removing the "IA__" prefix from internal aliases.
+
* glib/gmessages.h: Move the declaration of
g_return_if_fail_warning() out of the ifdefs, so that
building with G_DISABLE_ASSERT works.
2004-09-29 Matthias Clasen <mclasen@redhat.com>
+ * glib/glib.symbols: Add g_assert_warning.
+
+ * glib/gmessages.h:
+ * glib/gmessages.c (g_assert_warning): Treat g_assert
+ in the same way as g_return_if_fail and move the string
+ constants into a helper function, which also takes
+ care of removing the "IA__" prefix from internal aliases.
+
* glib/gmessages.h: Move the declaration of
g_return_if_fail_warning() out of the ifdefs, so that
building with G_DISABLE_ASSERT works.
2004-09-29 Matthias Clasen <mclasen@redhat.com>
+ * glib/glib.symbols: Add g_assert_warning.
+
+ * glib/gmessages.h:
+ * glib/gmessages.c (g_assert_warning): Treat g_assert
+ in the same way as g_return_if_fail and move the string
+ constants into a helper function, which also takes
+ care of removing the "IA__" prefix from internal aliases.
+
* glib/gmessages.h: Move the declaration of
g_return_if_fail_warning() out of the ifdefs, so that
building with G_DISABLE_ASSERT works.
g_ascii_tolower
g_ascii_toupper
g_ascii_xdigit_value
+g_assert_warning
g_async_queue_length
g_async_queue_length_unlocked
g_async_queue_lock
expression);
}
+void
+g_assert_warning (const char *log_domain,
+ const char *file,
+ const int line,
+ const char *pretty_function,
+ const char *expression)
+{
+ /*
+ * Omit the prefix used by the PLT-reduction
+ * technique used in GTK+.
+ */
+ if (g_str_has_prefix (pretty_function, "IA__"))
+ pretty_function += 4;
+ 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);
+}
+
#define CHAR_IS_SAFE(wc) (!((wc < 0x20 && wc != '\t' && wc != '\n' && wc != '\r') || \
(wc == 0x7f) || \
(wc >= 0x80 && wc < 0xa0)))
const gchar *message,
gpointer unused_data) G_GNUC_INTERNAL;
-/* Internal function, used to implement the following macros */
+/* Internal functions, used to implement the following macros */
void g_return_if_fail_warning (const char *log_domain,
const char *pretty_function,
const char *expression);
+void g_assert_warning (const char *log_domain,
+ const char *file,
+ const int line,
+ const char *pretty_function,
+ const char *expression);
#ifndef G_LOG_DOMAIN
#define g_assert(expr) G_STMT_START{ \
if G_LIKELY(expr) { } else \
- g_log (G_LOG_DOMAIN, \
- G_LOG_LEVEL_ERROR, \
- "file %s: line %d (%s): assertion failed: (%s)", \
- __FILE__, \
- __LINE__, \
- __PRETTY_FUNCTION__, \
- #expr); }G_STMT_END
+ g_assert_warning (G_LOG_DOMAIN, \
+ __FILE__, \
+ __LINE__, \
+ __PRETTY_FUNCTION__, \
+ #expr); }G_STMT_END
#define g_assert_not_reached() G_STMT_START{ \
- g_log (G_LOG_DOMAIN, \
- G_LOG_LEVEL_ERROR, \
- "file %s: line %d (%s): should not be reached", \
- __FILE__, \
- __LINE__, \
- __PRETTY_FUNCTION__); }G_STMT_END
+ g_assert_warning (G_LOG_DOMAIN, \
+ __FILE__, \
+ __LINE__, \
+ __PRETTY_FUNCTION__, \
+ NULL); }G_STMT_END
#else /* !__GNUC__ */