[glib] Another variadic macro fix
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] Another variadic macro fix
- Date: Sun, 17 Jul 2016 06:32:53 +0000 (UTC)
commit 42725fb17d532a8c5903a6c849f7ca3ae01faee7
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Jul 17 02:31:37 2016 -0400
Another variadic macro fix
It turns out that g_info_structured (format, ...) makes
g_info_structured ("Hey!") not work, since it requires at
least one argument after the format string. So shorten
the argument list to just ...
glib/gmessages.h | 48 ++++++++++++++++++++++++------------------------
1 files changed, 24 insertions(+), 24 deletions(-)
---
diff --git a/glib/gmessages.h b/glib/gmessages.h
index b16076a..4256e0e 100644
--- a/glib/gmessages.h
+++ b/glib/gmessages.h
@@ -258,12 +258,12 @@ GLogWriterOutput g_log_writer_default (GLogLevelFlags log_level,
*
* Since: 2.50
*/
-#define g_debug_structured(format, ...) \
+#define g_debug_structured(...) \
g_log_structured (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, \
- format, __VA_ARGS__, \
- "CODE_FILE", G_STRINGIFY (__FILE__), \
+ __VA_ARGS__, \
+ "CODE_FILE", __FILE__, \
"CODE_LINE", G_STRINGIFY (__LINE__), \
- "CODE_FUNC", G_STRINGIFY (__FUNC__), \
+ "CODE_FUNC", __func__, \
NULL)
/**
@@ -280,12 +280,12 @@ GLogWriterOutput g_log_writer_default (GLogLevelFlags log_level,
*
* Since: 2.50
*/
-#define g_info_structured(format, ...) \
+#define g_info_structured(...) \
g_log_structured (G_LOG_DOMAIN, G_LOG_LEVEL_INFO, \
- format, __VA_ARGS__, \
- "CODE_FILE", G_STRINGIFY (__FILE__), \
+ __VA_ARGS__, \
+ "CODE_FILE", __FILE__, \
"CODE_LINE", G_STRINGIFY (__LINE__), \
- "CODE_FUNC", G_STRINGIFY (__FUNC__), \
+ "CODE_FUNC", __func__, \
NULL)
/**
@@ -302,12 +302,12 @@ GLogWriterOutput g_log_writer_default (GLogLevelFlags log_level,
*
* Since: 2.50
*/
-#define g_message_structured(format, ...) \
+#define g_message_structured(...) \
g_log_structured (G_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE, \
- format, __VA_ARGS__, \
- "CODE_FILE", G_STRINGIFY (__FILE__), \
+ __VA_ARGS__, \
+ "CODE_FILE", __FILE__, \
"CODE_LINE", G_STRINGIFY (__LINE__), \
- "CODE_FUNC", G_STRINGIFY (__FUNC__), \
+ "CODE_FUNC", __func__, \
NULL)
@@ -325,12 +325,12 @@ GLogWriterOutput g_log_writer_default (GLogLevelFlags log_level,
*
* Since: 2.50
*/
-#define g_warning_structured(format, ...) \
+#define g_warning_structured(...) \
g_log_structured (G_LOG_DOMAIN, G_LOG_LEVEL_WARNING, \
- format, __VA_ARGS__, \
- "CODE_FILE", G_STRINGIFY (__FILE__), \
+ __VA_ARGS__, \
+ "CODE_FILE", __FILE__, \
"CODE_LINE", G_STRINGIFY (__LINE__), \
- "CODE_FUNC", G_STRINGIFY (__FUNC__), \
+ "CODE_FUNC", __func__, \
NULL)
/**
@@ -347,12 +347,12 @@ GLogWriterOutput g_log_writer_default (GLogLevelFlags log_level,
*
* Since: 2.50
*/
-#define g_critical_structured(format, ...) \
+#define g_critical_structured(...) \
g_log_structured (G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL, \
- format, __VA_ARGS__, \
- "CODE_FILE", G_STRINGIFY (__FILE__), \
+ __VA_ARGS__, \
+ "CODE_FILE", __FILE__, \
"CODE_LINE", G_STRINGIFY (__LINE__), \
- "CODE_FUNC", G_STRINGIFY (__FUNC__), \
+ "CODE_FUNC", __func__, \
NULL)
/**
@@ -369,12 +369,12 @@ GLogWriterOutput g_log_writer_default (GLogLevelFlags log_level,
*
* Since: 2.50
*/
-#define g_error_structured(format, ...) \
+#define g_error_structured(...) \
g_log_structured (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, \
- format, __VA_ARGS__, \
- "CODE_FILE", G_STRINGIFY (__FILE__), \
+ __VA_ARGS__, \
+ "CODE_FILE", __FILE__, \
"CODE_LINE", G_STRINGIFY (__LINE__), \
- "CODE_FUNC", G_STRINGIFY (__FUNC__), \
+ "CODE_FUNC", __func__, \
NULL)
/* internal */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]