applied patch from Darin Adler <darin@eazel.com> which supplies

Wed Jul 26 00:46:03 2000  Tim Janik  <timj@gtk.org>

        * glib.h: applied patch from Darin Adler <darin@eazel.com> which
        supplies g_return_if_reached(), g_return_val_if_reached() and
        g_critical().
This commit is contained in:
Tim Janik 2000-07-25 22:48:09 +00:00 committed by Tim Janik
parent 18ac8965f8
commit 623efc182c
10 changed files with 156 additions and 12 deletions

View File

@ -1,3 +1,9 @@
Wed Jul 26 00:46:03 2000 Tim Janik <timj@gtk.org>
* glib.h: applied patch from Darin Adler <darin@eazel.com> which
supplies g_return_if_reached(), g_return_val_if_reached() and
g_critical().
2000-07-22 Tor Lillqvist <tml@iki.fi>
* build-dll: Fix resource handling, the resource file got left out

View File

@ -1,3 +1,9 @@
Wed Jul 26 00:46:03 2000 Tim Janik <timj@gtk.org>
* glib.h: applied patch from Darin Adler <darin@eazel.com> which
supplies g_return_if_reached(), g_return_val_if_reached() and
g_critical().
2000-07-22 Tor Lillqvist <tml@iki.fi>
* build-dll: Fix resource handling, the resource file got left out

View File

@ -1,3 +1,9 @@
Wed Jul 26 00:46:03 2000 Tim Janik <timj@gtk.org>
* glib.h: applied patch from Darin Adler <darin@eazel.com> which
supplies g_return_if_reached(), g_return_val_if_reached() and
g_critical().
2000-07-22 Tor Lillqvist <tml@iki.fi>
* build-dll: Fix resource handling, the resource file got left out

View File

@ -1,3 +1,9 @@
Wed Jul 26 00:46:03 2000 Tim Janik <timj@gtk.org>
* glib.h: applied patch from Darin Adler <darin@eazel.com> which
supplies g_return_if_reached(), g_return_val_if_reached() and
g_critical().
2000-07-22 Tor Lillqvist <tml@iki.fi>
* build-dll: Fix resource handling, the resource file got left out

View File

@ -1,3 +1,9 @@
Wed Jul 26 00:46:03 2000 Tim Janik <timj@gtk.org>
* glib.h: applied patch from Darin Adler <darin@eazel.com> which
supplies g_return_if_reached(), g_return_val_if_reached() and
g_critical().
2000-07-22 Tor Lillqvist <tml@iki.fi>
* build-dll: Fix resource handling, the resource file got left out

View File

@ -1,3 +1,9 @@
Wed Jul 26 00:46:03 2000 Tim Janik <timj@gtk.org>
* glib.h: applied patch from Darin Adler <darin@eazel.com> which
supplies g_return_if_reached(), g_return_val_if_reached() and
g_critical().
2000-07-22 Tor Lillqvist <tml@iki.fi>
* build-dll: Fix resource handling, the resource file got left out

View File

@ -1,3 +1,9 @@
Wed Jul 26 00:46:03 2000 Tim Janik <timj@gtk.org>
* glib.h: applied patch from Darin Adler <darin@eazel.com> which
supplies g_return_if_reached(), g_return_val_if_reached() and
g_critical().
2000-07-22 Tor Lillqvist <tml@iki.fi>
* build-dll: Fix resource handling, the resource file got left out

View File

@ -1,3 +1,9 @@
Wed Jul 26 00:46:03 2000 Tim Janik <timj@gtk.org>
* glib.h: applied patch from Darin Adler <darin@eazel.com> which
supplies g_return_if_reached(), g_return_val_if_reached() and
g_critical().
2000-07-22 Tor Lillqvist <tml@iki.fi>
* build-dll: Fix resource handling, the resource file got left out

60
glib.h
View File

@ -426,6 +426,8 @@ extern "C" {
#define g_return_if_fail(expr)
#define g_return_val_if_fail(expr,val)
#define g_return_if_reached() return
#define g_return_val_if_reached(val) return (val)
#else /* !G_DISABLE_CHECKS */
@ -436,7 +438,7 @@ extern "C" {
{ \
g_log (G_LOG_DOMAIN, \
G_LOG_LEVEL_CRITICAL, \
"file %s: line %d (%s): assertion `%s' failed.", \
"file %s: line %d (%s): assertion `%s' failed", \
__FILE__, \
__LINE__, \
__PRETTY_FUNCTION__, \
@ -449,14 +451,32 @@ extern "C" {
{ \
g_log (G_LOG_DOMAIN, \
G_LOG_LEVEL_CRITICAL, \
"file %s: line %d (%s): assertion `%s' failed.", \
"file %s: line %d (%s): assertion `%s' failed", \
__FILE__, \
__LINE__, \
__PRETTY_FUNCTION__, \
#expr); \
return val; \
return (val); \
}; }G_STMT_END
#define g_return_if_reached() G_STMT_START{ \
g_log (G_LOG_DOMAIN, \
G_LOG_LEVEL_CRITICAL, \
"file %s: line %d (%s): assertion `%s' failed", \
__FILE__, \
__LINE__, \
__PRETTY_FUNCTION__); \
return; }G_STMT_END
#define g_return_val_if_reached(val) G_STMT_START{ \
g_log (G_LOG_DOMAIN, \
G_LOG_LEVEL_CRITICAL, \
"file %s: line %d (%s): should not be reached", \
__FILE__, \
__LINE__, \
__PRETTY_FUNCTION__); \
return (val); }G_STMT_END
#else /* !__GNUC__ */
#define g_return_if_fail(expr) G_STMT_START{ \
@ -464,7 +484,7 @@ extern "C" {
{ \
g_log (G_LOG_DOMAIN, \
G_LOG_LEVEL_CRITICAL, \
"file %s: line %d: assertion `%s' failed.", \
"file %s: line %d: assertion `%s' failed", \
__FILE__, \
__LINE__, \
#expr); \
@ -476,13 +496,29 @@ extern "C" {
{ \
g_log (G_LOG_DOMAIN, \
G_LOG_LEVEL_CRITICAL, \
"file %s: line %d: assertion `%s' failed.", \
"file %s: line %d: assertion `%s' failed", \
__FILE__, \
__LINE__, \
#expr); \
return val; \
return (val); \
}; }G_STMT_END
#define g_return_if_reached() G_STMT_START{ \
g_log (G_LOG_DOMAIN, \
G_LOG_LEVEL_CRITICAL, \
"file %s: line %d: assertion `%s' failed", \
__FILE__, \
__LINE__); \
return; }G_STMT_END
#define g_return_val_if_reached(val) G_STMT_START{ \
g_log (G_LOG_DOMAIN, \
G_LOG_LEVEL_CRITICAL, \
"file %s: line %d: should not be reached", \
__FILE__, \
__LINE__); \
return (val); }G_STMT_END
#endif /* !__GNUC__ */
#endif /* !G_DISABLE_CHECKS */
@ -1442,6 +1478,9 @@ GLogLevelFlags g_log_set_always_fatal (GLogLevelFlags fatal_mask);
#define g_message(format, args...) g_log (G_LOG_DOMAIN, \
G_LOG_LEVEL_MESSAGE, \
format, ##args)
#define g_critical(format, args...) g_log (G_LOG_DOMAIN, \
G_LOG_LEVEL_CRITICAL, \
format, ##args)
#define g_warning(format, args...) g_log (G_LOG_DOMAIN, \
G_LOG_LEVEL_WARNING, \
format, ##args)
@ -1465,6 +1504,15 @@ g_message (const gchar *format,
va_end (args);
}
static void
g_critical (const gchar *format,
...)
{
va_list args;
va_start (args, format);
g_logv (G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL, format, args);
va_end (args);
}
static void
g_warning (const gchar *format,
...)
{

View File

@ -426,6 +426,8 @@ extern "C" {
#define g_return_if_fail(expr)
#define g_return_val_if_fail(expr,val)
#define g_return_if_reached() return
#define g_return_val_if_reached(val) return (val)
#else /* !G_DISABLE_CHECKS */
@ -436,7 +438,7 @@ extern "C" {
{ \
g_log (G_LOG_DOMAIN, \
G_LOG_LEVEL_CRITICAL, \
"file %s: line %d (%s): assertion `%s' failed.", \
"file %s: line %d (%s): assertion `%s' failed", \
__FILE__, \
__LINE__, \
__PRETTY_FUNCTION__, \
@ -449,14 +451,32 @@ extern "C" {
{ \
g_log (G_LOG_DOMAIN, \
G_LOG_LEVEL_CRITICAL, \
"file %s: line %d (%s): assertion `%s' failed.", \
"file %s: line %d (%s): assertion `%s' failed", \
__FILE__, \
__LINE__, \
__PRETTY_FUNCTION__, \
#expr); \
return val; \
return (val); \
}; }G_STMT_END
#define g_return_if_reached() G_STMT_START{ \
g_log (G_LOG_DOMAIN, \
G_LOG_LEVEL_CRITICAL, \
"file %s: line %d (%s): assertion `%s' failed", \
__FILE__, \
__LINE__, \
__PRETTY_FUNCTION__); \
return; }G_STMT_END
#define g_return_val_if_reached(val) G_STMT_START{ \
g_log (G_LOG_DOMAIN, \
G_LOG_LEVEL_CRITICAL, \
"file %s: line %d (%s): should not be reached", \
__FILE__, \
__LINE__, \
__PRETTY_FUNCTION__); \
return (val); }G_STMT_END
#else /* !__GNUC__ */
#define g_return_if_fail(expr) G_STMT_START{ \
@ -464,7 +484,7 @@ extern "C" {
{ \
g_log (G_LOG_DOMAIN, \
G_LOG_LEVEL_CRITICAL, \
"file %s: line %d: assertion `%s' failed.", \
"file %s: line %d: assertion `%s' failed", \
__FILE__, \
__LINE__, \
#expr); \
@ -476,13 +496,29 @@ extern "C" {
{ \
g_log (G_LOG_DOMAIN, \
G_LOG_LEVEL_CRITICAL, \
"file %s: line %d: assertion `%s' failed.", \
"file %s: line %d: assertion `%s' failed", \
__FILE__, \
__LINE__, \
#expr); \
return val; \
return (val); \
}; }G_STMT_END
#define g_return_if_reached() G_STMT_START{ \
g_log (G_LOG_DOMAIN, \
G_LOG_LEVEL_CRITICAL, \
"file %s: line %d: assertion `%s' failed", \
__FILE__, \
__LINE__); \
return; }G_STMT_END
#define g_return_val_if_reached(val) G_STMT_START{ \
g_log (G_LOG_DOMAIN, \
G_LOG_LEVEL_CRITICAL, \
"file %s: line %d: should not be reached", \
__FILE__, \
__LINE__); \
return (val); }G_STMT_END
#endif /* !__GNUC__ */
#endif /* !G_DISABLE_CHECKS */
@ -1442,6 +1478,9 @@ GLogLevelFlags g_log_set_always_fatal (GLogLevelFlags fatal_mask);
#define g_message(format, args...) g_log (G_LOG_DOMAIN, \
G_LOG_LEVEL_MESSAGE, \
format, ##args)
#define g_critical(format, args...) g_log (G_LOG_DOMAIN, \
G_LOG_LEVEL_CRITICAL, \
format, ##args)
#define g_warning(format, args...) g_log (G_LOG_DOMAIN, \
G_LOG_LEVEL_WARNING, \
format, ##args)
@ -1465,6 +1504,15 @@ g_message (const gchar *format,
va_end (args);
}
static void
g_critical (const gchar *format,
...)
{
va_list args;
va_start (args, format);
g_logv (G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL, format, args);
va_end (args);
}
static void
g_warning (const gchar *format,
...)
{