mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-02 07:36:17 +01:00
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:
parent
ea01de53fe
commit
f43458e3a2
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user