Skip to content

Commit

Permalink
2010-05-15 Zoltan Varga <vargaz@gmail.com>
Browse files Browse the repository at this point in the history
	* src/glib.h (g_error): Add a for (;;) after the call to tell GCC this doesn't
	return, fixing some warnings.

svn path=/trunk/mono/; revision=157386
  • Loading branch information
vargaz committed May 15, 2010
1 parent f9bea41 commit abb3ba2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions eglib/ChangeLog
@@ -1,3 +1,8 @@
2010-05-15 Zoltan Varga <vargaz@gmail.com>

* src/glib.h (g_error): Add a for (;;) after the call to tell GCC this doesn't
return, fixing some warnings.

2010-05-13 Alan McGovern <amcgovern@novell.com>

* src/gstring.c: Put in some null guards for the ctors
Expand Down
5 changes: 3 additions & 2 deletions eglib/src/glib.h
Expand Up @@ -522,13 +522,14 @@ void g_log (const gchar *log_domain, GLogLevelFlags l
void g_assertion_message (const gchar *format, ...) G_GNUC_NORETURN;

#ifdef HAVE_C99_SUPPORT
#define g_error(format, ...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, format, __VA_ARGS__)
/* The for (;;) tells gc thats g_error () doesn't return, avoiding warnings */
#define g_error(format, ...) do { g_log (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, format, __VA_ARGS__); for (;;); } while (0)
#define g_critical(format, ...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL, format, __VA_ARGS__)
#define g_warning(format, ...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_WARNING, format, __VA_ARGS__)
#define g_message(format, ...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE, format, __VA_ARGS__)
#define g_debug(format, ...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, format, __VA_ARGS__)
#else /* HAVE_C99_SUPPORT */
#define g_error(...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, __VA_ARGS__)
#define g_error(...) do { g_log (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, __VA_ARGS__); for (;;); } while (0)
#define g_critical(...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL, __VA_ARGS__)
#define g_warning(...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_WARNING, __VA_ARGS__)
#define g_message(...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE, __VA_ARGS__)
Expand Down

0 comments on commit abb3ba2

Please sign in to comment.