[glib] Fix variadic macro syntax
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] Fix variadic macro syntax
- Date: Sun, 17 Jul 2016 06:06:13 +0000 (UTC)
commit 17f48d7144cbb891355421916cad090480343734
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Jul 17 02:05:07 2016 -0400
Fix variadic macro syntax
It turns out that the macros looked fine in the header, but made
gcc fall over on first use. __VA_ARGS__ is only allowed in the
replacement text.
glib/gmessages.h | 24 ++++++++++++------------
1 files changed, 12 insertions(+), 12 deletions(-)
---
diff --git a/glib/gmessages.h b/glib/gmessages.h
index 83abb93..b16076a 100644
--- a/glib/gmessages.h
+++ b/glib/gmessages.h
@@ -258,9 +258,9 @@ GLogWriterOutput g_log_writer_default (GLogLevelFlags log_level,
*
* Since: 2.50
*/
-#define g_debug_structured(format, __va_args__) \
+#define g_debug_structured(format, ...) \
g_log_structured (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, \
- format, ##__va_args__, \
+ format, __VA_ARGS__, \
"CODE_FILE", G_STRINGIFY (__FILE__), \
"CODE_LINE", G_STRINGIFY (__LINE__), \
"CODE_FUNC", G_STRINGIFY (__FUNC__), \
@@ -280,9 +280,9 @@ GLogWriterOutput g_log_writer_default (GLogLevelFlags log_level,
*
* Since: 2.50
*/
-#define g_info_structured(format, __va_args__) \
+#define g_info_structured(format, ...) \
g_log_structured (G_LOG_DOMAIN, G_LOG_LEVEL_INFO, \
- format, ##__va_args__, \
+ format, __VA_ARGS__, \
"CODE_FILE", G_STRINGIFY (__FILE__), \
"CODE_LINE", G_STRINGIFY (__LINE__), \
"CODE_FUNC", G_STRINGIFY (__FUNC__), \
@@ -302,9 +302,9 @@ GLogWriterOutput g_log_writer_default (GLogLevelFlags log_level,
*
* Since: 2.50
*/
-#define g_message_structured(format, __va_args__) \
+#define g_message_structured(format, ...) \
g_log_structured (G_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE, \
- format, ##__va_args__, \
+ format, __VA_ARGS__, \
"CODE_FILE", G_STRINGIFY (__FILE__), \
"CODE_LINE", G_STRINGIFY (__LINE__), \
"CODE_FUNC", G_STRINGIFY (__FUNC__), \
@@ -325,9 +325,9 @@ GLogWriterOutput g_log_writer_default (GLogLevelFlags log_level,
*
* Since: 2.50
*/
-#define g_warning_structured(format, __va_args__) \
+#define g_warning_structured(format, ...) \
g_log_structured (G_LOG_DOMAIN, G_LOG_LEVEL_WARNING, \
- format, ##__va_args__, \
+ format, __VA_ARGS__, \
"CODE_FILE", G_STRINGIFY (__FILE__), \
"CODE_LINE", G_STRINGIFY (__LINE__), \
"CODE_FUNC", G_STRINGIFY (__FUNC__), \
@@ -347,9 +347,9 @@ GLogWriterOutput g_log_writer_default (GLogLevelFlags log_level,
*
* Since: 2.50
*/
-#define g_critical_structured(format, __va_args__) \
+#define g_critical_structured(format, ...) \
g_log_structured (G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL, \
- format, ##__va_args__, \
+ format, __VA_ARGS__, \
"CODE_FILE", G_STRINGIFY (__FILE__), \
"CODE_LINE", G_STRINGIFY (__LINE__), \
"CODE_FUNC", G_STRINGIFY (__FUNC__), \
@@ -369,9 +369,9 @@ GLogWriterOutput g_log_writer_default (GLogLevelFlags log_level,
*
* Since: 2.50
*/
-#define g_error_structured(format, __va_args__) \
+#define g_error_structured(format, ...) \
g_log_structured (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, \
- format, ##__va_args__, \
+ format, __VA_ARGS__, \
"CODE_FILE", G_STRINGIFY (__FILE__), \
"CODE_LINE", G_STRINGIFY (__LINE__), \
"CODE_FUNC", G_STRINGIFY (__FUNC__), \
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]