[glib-networking/fix.openssl.x64.win: 2/2] gtlslog.h: Fix build on non-GCC
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib-networking/fix.openssl.x64.win: 2/2] gtlslog.h: Fix build on non-GCC
- Date: Wed, 1 Jan 2020 05:25:49 +0000 (UTC)
commit 7627cdc1d5ffcb9bc32179c4af64b8bec49fa349
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Wed Jan 1 13:25:04 2020 +0800
gtlslog.h: Fix build on non-GCC
We need to use ISO-style varargs for non-GCC compilers.
tls/base/gtlslog.h | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
---
diff --git a/tls/base/gtlslog.h b/tls/base/gtlslog.h
index 5501756..387b084 100644
--- a/tls/base/gtlslog.h
+++ b/tls/base/gtlslog.h
@@ -37,12 +37,19 @@ void g_tls_log (GLogLevelFlags level,
const gchar *format,
...) G_GNUC_PRINTF (6, 7);
+#ifdef G_HAVE_GNUC_VARARGS
#define g_tls_log_debug(_conn, _format, _args...) g_tls_log (G_LOG_LEVEL_DEBUG, _conn, \
__FILE__, G_STRINGIFY (__LINE__), \
G_STRFUNC, _format, ## _args)
+#elif defined (G_HAVE_ISO_VARARGS)
+#define g_tls_log_debug(_conn, _format, ...) g_tls_log (G_LOG_LEVEL_DEBUG, _conn, \
+ __FILE__, G_STRINGIFY (__LINE__), \
+ G_STRFUNC, _format, ## __VA_ARGS__)
+#endif
/* The following functions are for local debugging only. */
#if 0
+#ifdef G_HAVE_GNUC_VARARGS
#define g_tls_log_info(_conn, _format, _args...) g_tls_log (G_LOG_LEVEL_INFO, _conn, \
__FILE__, G_STRINGIFY (__LINE__), \
G_STRFUNC, _format, ## _args)
@@ -52,6 +59,17 @@ void g_tls_log (GLogLevelFlags level,
#define g_tls_log_error(_conn, _format, _args...) g_tls_log (G_LOG_LEVEL_ERROR, _conn, \
__FILE__, G_STRINGIFY (__LINE__), \
G_STRFUNC, _format, ## _args)
+#elif defined (G_HAVE_ISO_VARARGS)
+#define g_tls_log_info(_conn, _format, ...) g_tls_log (G_LOG_LEVEL_INFO, _conn, \
+ __FILE__, G_STRINGIFY (__LINE__), \
+ G_STRFUNC, _format, ## __VA_ARGS__)
+#define g_tls_log_warning(_conn, _format, ...) g_tls_log (G_LOG_LEVEL_WARNING, _conn, \
+ __FILE__, G_STRINGIFY (__LINE__), \
+ G_STRFUNC, _format, ## __VA_ARGS__)
+#define g_tls_log_error(_conn, _format, ...) g_tls_log (G_LOG_LEVEL_ERROR, _conn, \
+ __FILE__, G_STRINGIFY (__LINE__), \
+ G_STRFUNC, _format, ## __VA_ARGS__)
+#endif
#endif
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]