diff options
author | Owen Taylor <otaylor@redhat.com> | 2000-08-21 18:46:52 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 2000-08-21 18:46:52 +0000 |
commit | 33df64519d53b29731b889772ed1eff39cbf5215 (patch) | |
tree | 0387e6ded5bcdbaf30d36ea78e0050bafe47f321 /glib | |
parent | 4010a5acb2be1747e60a0e844a508dbf0f55a149 (diff) | |
download | glib-33df64519d53b29731b889772ed1eff39cbf5215.tar.gz |
Fix a couple of trivial bugs that were causing warnings.
Mon Aug 21 14:46:23 2000 Owen Taylor <otaylor@redhat.com>
* tests/gio-test.c: Fix a couple of trivial bugs that
were causing warnings.
Mon Aug 21 14:39:36 2000 Owen Taylor <otaylor@redhat.com>
* glib.h: Use C99 varargs macros where possible
(check __STDC_VERSION__), otherwise, on gcc, use an alternate
form of gcc varargs which is more likely
to be supported going forward. (Based on some code
from Raja Harinath)
Diffstat (limited to 'glib')
-rw-r--r-- | glib/glib.h | 39 |
1 files changed, 26 insertions, 13 deletions
diff --git a/glib/glib.h b/glib/glib.h index 72ccbfba6..726dea527 100644 --- a/glib/glib.h +++ b/glib/glib.h @@ -1470,19 +1470,32 @@ GLogLevelFlags g_log_set_always_fatal (GLogLevelFlags fatal_mask); #ifndef G_LOG_DOMAIN #define G_LOG_DOMAIN ((gchar*) 0) #endif /* G_LOG_DOMAIN */ -#ifdef __GNUC__ -#define g_error(format, args...) g_log (G_LOG_DOMAIN, \ - G_LOG_LEVEL_ERROR, \ - format, ##args) -#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) +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +#define g_error(...) g_log (G_LOG_DOMAIN, \ + G_LOG_LEVEL_ERROR, \ + __VA_ARGS__) +#define g_message(...) g_log (G_LOG_DOMAIN, \ + G_LOG_LEVEL_MESSAGE, \ + __VA_ARGS__) +#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__) +#elif defined (__GNUC__) +#define g_error(format...) g_log (G_LOG_DOMAIN, \ + G_LOG_LEVEL_ERROR, \ + format) +#define g_message(format...) g_log (G_LOG_DOMAIN, \ + G_LOG_LEVEL_MESSAGE, \ + format) +#define g_critical(format...) g_log (G_LOG_DOMAIN, \ + G_LOG_LEVEL_CRITICAL, \ + format) +#define g_warning(format...) g_log (G_LOG_DOMAIN, \ + G_LOG_LEVEL_WARNING, \ + format) #else /* !__GNUC__ */ static void g_error (const gchar *format, |