[libvirt PATCH v2 54/56] src: ensure use of g_printf / g_fprintf functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The printf/fprintf function impls provided on Windows do
not follow the normal syntax for format specifiers as
the UNIX hosts. Currently we use GNULIB to provide a
portability fix for this. GLib has also imported the
GNULIB impl for this same reason, and thus we can rely
on the g_printf / g_fprintf functions.

This identified a couple of places not explicitly
linking to glib.

Signed-off-by: Daniel P. Berrangé <berrange@xxxxxxxxxx>
---
 src/internal.h              | 14 ++++++++++++++
 src/locking/Makefile.inc.am |  5 ++++-
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/src/internal.h b/src/internal.h
index 96a43113cb..e181218067 100644
--- a/src/internal.h
+++ b/src/internal.h
@@ -488,3 +488,17 @@ enum {
 #  define ENOMSG 122
 # endif
 #endif
+
+/* Ideally callers would use the g_*printf
+ * functions directly but there are alot to
+ * convert, so until then...
+ */
+#ifndef VIR_NO_GLIB_STDIO
+
+# undef printf
+# define printf(...) g_printf(__VA_ARGS__)
+
+# undef fprintf
+# define fprintf(fh, ...) g_fprintf(fh, __VA_ARGS__)
+
+#endif /* VIR_NO_GLIB_STDIO */
diff --git a/src/locking/Makefile.inc.am b/src/locking/Makefile.inc.am
index d49383d9d7..9fd2b7f282 100644
--- a/src/locking/Makefile.inc.am
+++ b/src/locking/Makefile.inc.am
@@ -208,7 +208,10 @@ libvirt_sanlock_helper_LDFLAGS = \
 	$(AM_LDFLAGS) \
 	$(PIE_LDFLAGS) \
 	$(NULL)
-libvirt_sanlock_helper_LDADD = libvirt.la
+libvirt_sanlock_helper_LDADD = \
+	libvirt.la \
+	$(GLIB_LIBS) \
+	$(NULL)
 endif WITH_SANLOCK
 
 conf_DATA += locking/virtlockd.conf
-- 
2.24.1





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux