Use a helper function to reduce code size; omit FILE/LINE when we have

Thu Sep  9 10:37:41 2004  Owen Taylor  <otaylor@redhat.com>

        * glib/gmessages.h (g_return_[val_]if_fail): Use
        a helper function to reduce code size; omit FILE/LINE
        when we have __PRETTY_FUNCTION__.
This commit is contained in:
Owen Taylor 2004-09-09 14:42:00 +00:00 committed by Owen Taylor
parent ea01de53fe
commit f43458e3a2
6 changed files with 41 additions and 14 deletions

View File

@ -1,3 +1,9 @@
Thu Sep 9 10:37:41 2004 Owen Taylor <otaylor@redhat.com>
* glib/gmessages.h (g_return_[val_]if_fail): Use
a helper function to reduce code size; omit FILE/LINE
when we have __PRETTY_FUNCTION__.
2004-09-09 Matthias Clasen <mclasen@redhat.com>
* glib/gutils.c (g_get_home_dir): Remove a misleading comment.

View File

@ -1,3 +1,9 @@
Thu Sep 9 10:37:41 2004 Owen Taylor <otaylor@redhat.com>
* glib/gmessages.h (g_return_[val_]if_fail): Use
a helper function to reduce code size; omit FILE/LINE
when we have __PRETTY_FUNCTION__.
2004-09-09 Matthias Clasen <mclasen@redhat.com>
* glib/gutils.c (g_get_home_dir): Remove a misleading comment.

View File

@ -1,3 +1,9 @@
Thu Sep 9 10:37:41 2004 Owen Taylor <otaylor@redhat.com>
* glib/gmessages.h (g_return_[val_]if_fail): Use
a helper function to reduce code size; omit FILE/LINE
when we have __PRETTY_FUNCTION__.
2004-09-09 Matthias Clasen <mclasen@redhat.com>
* glib/gutils.c (g_get_home_dir): Remove a misleading comment.

View File

@ -1,3 +1,9 @@
Thu Sep 9 10:37:41 2004 Owen Taylor <otaylor@redhat.com>
* glib/gmessages.h (g_return_[val_]if_fail): Use
a helper function to reduce code size; omit FILE/LINE
when we have __PRETTY_FUNCTION__.
2004-09-09 Matthias Clasen <mclasen@redhat.com>
* glib/gutils.c (g_get_home_dir): Remove a misleading comment.

View File

@ -1,3 +1,9 @@
Thu Sep 9 10:37:41 2004 Owen Taylor <otaylor@redhat.com>
* glib/gmessages.h (g_return_[val_]if_fail): Use
a helper function to reduce code size; omit FILE/LINE
when we have __PRETTY_FUNCTION__.
2004-09-09 Matthias Clasen <mclasen@redhat.com>
* glib/gutils.c (g_get_home_dir): Remove a misleading comment.

View File

@ -269,29 +269,26 @@ GPrintFunc g_set_printerr_handler (GPrintFunc func);
#ifdef __GNUC__
/* Internal function, used to implement following macros */
void g_return_if_fail_warning (const char *log_domain,
const char *pretty_function,
const char *expression);
#define g_return_if_fail(expr) G_STMT_START{ \
if G_LIKELY(expr) { } else \
{ \
g_log (G_LOG_DOMAIN, \
G_LOG_LEVEL_CRITICAL, \
"file %s: line %d (%s): assertion `%s' failed", \
__FILE__, \
__LINE__, \
__PRETTY_FUNCTION__, \
#expr); \
g_return_if_fail_warning (G_LOG_DOMAIN, \
__PRETTY_FUNCTION__, \
#expr); \
return; \
}; }G_STMT_END
#define g_return_val_if_fail(expr,val) G_STMT_START{ \
if G_LIKELY(expr) { } else \
{ \
g_log (G_LOG_DOMAIN, \
G_LOG_LEVEL_CRITICAL, \
"file %s: line %d (%s): assertion `%s' failed", \
__FILE__, \
__LINE__, \
__PRETTY_FUNCTION__, \
#expr); \
g_return_if_fail_warning (G_LOG_DOMAIN, \
__PRETTY_FUNCTION__, \
#expr); \
return (val); \
}; }G_STMT_END