[glib] gmessages.h: Use G_STRFUNC instead of __func__
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] gmessages.h: Use G_STRFUNC instead of __func__
- Date: Thu, 28 Jul 2016 08:04:22 +0000 (UTC)
commit 7cf037ec1614878d859fb9050311d182aae6e8f5
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Wed Jul 27 16:37:09 2016 +0800
gmessages.h: Use G_STRFUNC instead of __func__
We have G_STRFUNC which takes care of __func__, which may not be available
depending on compiler, so we ought to make use of it.
https://bugzilla.gnome.org/show_bug.cgi?id=744456
glib/gmessages.h | 26 +++++++++++++-------------
1 files changed, 13 insertions(+), 13 deletions(-)
---
diff --git a/glib/gmessages.h b/glib/gmessages.h
index 5cbdad7..a79c1e3 100644
--- a/glib/gmessages.h
+++ b/glib/gmessages.h
@@ -242,7 +242,7 @@ GLogWriterOutput g_log_writer_default (GLogLevelFlags log_level,
g_log_structured (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, \
"CODE_FILE", __FILE__, \
"CODE_LINE", G_STRINGIFY (__LINE__), \
- "CODE_FUNC", __func__, \
+ "CODE_FUNC", G_STRFUNC, \
"MESSAGE", "%" G_GINT64_FORMAT ": %s", \
g_get_monotonic_time (), G_STRLOC)
@@ -281,34 +281,34 @@ void g_assert_warning (const char *log_domain,
g_log_structured (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, \
"CODE_FILE", __FILE__, \
"CODE_LINE", G_STRINGIFY (__LINE__), \
- "CODE_FUNC", __func__, \
+ "CODE_FUNC", G_STRFUNC, \
"MESSAGE", __VA_ARGS__); \
for (;;) ; \
} G_STMT_END
#define g_message(...) g_log_structured (G_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE, \
"CODE_FILE", __FILE__, \
"CODE_LINE", G_STRINGIFY (__LINE__), \
- "CODE_FUNC", __func__, \
+ "CODE_FUNC", G_STRFUNC, \
"MESSAGE", __VA_ARGS__)
#define g_critical(...) g_log_structured (G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL, \
"CODE_FILE", __FILE__, \
"CODE_LINE", G_STRINGIFY (__LINE__), \
- "CODE_FUNC", __func__, \
+ "CODE_FUNC", G_STRFUNC, \
"MESSAGE", __VA_ARGS__)
#define g_warning(...) g_log_structured (G_LOG_DOMAIN, G_LOG_LEVEL_WARNING, \
"CODE_FILE", __FILE__, \
"CODE_LINE", G_STRINGIFY (__LINE__), \
- "CODE_FUNC", __func__, \
+ "CODE_FUNC", G_STRFUNC, \
"MESSAGE", __VA_ARGS__)
#define g_info(...) g_log_structured (G_LOG_DOMAIN, G_LOG_LEVEL_INFO, \
"CODE_FILE", __FILE__, \
"CODE_LINE", G_STRINGIFY (__LINE__), \
- "CODE_FUNC", __func__, \
+ "CODE_FUNC", G_STRFUNC, \
"MESSAGE", __VA_ARGS__)
#define g_debug(...) g_log_structured (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, \
"CODE_FILE", __FILE__, \
"CODE_LINE", G_STRINGIFY (__LINE__), \
- "CODE_FUNC", __func__, \
+ "CODE_FUNC", G_STRFUNC, \
"MESSAGE", __VA_ARGS__)
#else
/* for(;;) ; so that GCC knows that control doesn't go past g_error().
@@ -342,34 +342,34 @@ void g_assert_warning (const char *log_domain,
g_log_structured (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, \
"CODE_FILE", __FILE__, \
"CODE_LINE", G_STRINGIFY (__LINE__), \
- "CODE_FUNC", __func__, \
+ "CODE_FUNC", G_STRFUNC, \
"MESSAGE", format); \
for (;;) ; \
} G_STMT_END
#define g_message(format...) g_log_structured (G_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE, \
"CODE_FILE", __FILE__, \
"CODE_LINE", G_STRINGIFY (__LINE__), \
- "CODE_FUNC", __func__, \
+ "CODE_FUNC", G_STRFUNC, \
"MESSAGE", format)
#define g_critical(format...) g_log_structured (G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL, \
"CODE_FILE", __FILE__, \
"CODE_LINE", G_STRINGIFY (__LINE__), \
- "CODE_FUNC", __func__, \
+ "CODE_FUNC", G_STRFUNC, \
"MESSAGE", format)
#define g_warning(format...) g_log_structured (G_LOG_DOMAIN, G_LOG_LEVEL_WARNING, \
"CODE_FILE", __FILE__, \
"CODE_LINE", G_STRINGIFY (__LINE__), \
- "CODE_FUNC", __func__, \
+ "CODE_FUNC", G_STRFUNC, \
"MESSAGE", format)
#define g_info(format...) g_log_structured (G_LOG_DOMAIN, G_LOG_LEVEL_INFO, \
"CODE_FILE", __FILE__, \
"CODE_LINE", G_STRINGIFY (__LINE__), \
- "CODE_FUNC", __func__, \
+ "CODE_FUNC", G_STRFUNC, \
"MESSAGE", format)
#define g_debug(format...) g_log_structured (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, \
"CODE_FILE", __FILE__, \
"CODE_LINE", G_STRINGIFY (__LINE__), \
- "CODE_FUNC", __func__, \
+ "CODE_FUNC", G_STRFUNC, \
"MESSAGE", format)
#else
#define g_error(format...) G_STMT_START { \
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]