mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
util: keep glib compat methods in alphabetical order
Reviewed-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
14c136443c
commit
b14ad26738
@ -23,9 +23,22 @@
|
|||||||
|
|
||||||
#include "glibcompat.h"
|
#include "glibcompat.h"
|
||||||
|
|
||||||
|
#undef g_fsync
|
||||||
#undef g_strdup_printf
|
#undef g_strdup_printf
|
||||||
#undef g_strdup_vprintf
|
#undef g_strdup_vprintf
|
||||||
#undef g_fsync
|
|
||||||
|
|
||||||
|
/* Drop when min glib >= 2.63.0 */
|
||||||
|
gint
|
||||||
|
vir_g_fsync(gint fd)
|
||||||
|
{
|
||||||
|
#ifdef G_OS_WIN32
|
||||||
|
return _commit(fd);
|
||||||
|
#else
|
||||||
|
return fsync(fd);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Due to a bug in glib, g_strdup_printf() nor g_strdup_vprintf()
|
/* Due to a bug in glib, g_strdup_printf() nor g_strdup_vprintf()
|
||||||
* abort on OOM. It's fixed in glib's upstream. Provide our own
|
* abort on OOM. It's fixed in glib's upstream. Provide our own
|
||||||
@ -53,15 +66,3 @@ vir_g_strdup_vprintf(const char *msg, va_list args)
|
|||||||
abort();
|
abort();
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Drop when min glib >= 2.63.0 */
|
|
||||||
gint
|
|
||||||
vir_g_fsync(gint fd)
|
|
||||||
{
|
|
||||||
#ifdef G_OS_WIN32
|
|
||||||
return _commit(fd);
|
|
||||||
#else
|
|
||||||
return fsync(fd);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
@ -21,11 +21,11 @@
|
|||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <glib/gstdio.h>
|
#include <glib/gstdio.h>
|
||||||
|
|
||||||
|
gint vir_g_fsync(gint fd);
|
||||||
char *vir_g_strdup_printf(const char *msg, ...)
|
char *vir_g_strdup_printf(const char *msg, ...)
|
||||||
G_GNUC_PRINTF(1, 2);
|
G_GNUC_PRINTF(1, 2);
|
||||||
char *vir_g_strdup_vprintf(const char *msg, va_list args)
|
char *vir_g_strdup_vprintf(const char *msg, va_list args)
|
||||||
G_GNUC_PRINTF(1, 0);
|
G_GNUC_PRINTF(1, 0);
|
||||||
gint vir_g_fsync(gint fd);
|
|
||||||
|
|
||||||
#if !GLIB_CHECK_VERSION(2, 64, 0)
|
#if !GLIB_CHECK_VERSION(2, 64, 0)
|
||||||
# define g_strdup_printf vir_g_strdup_printf
|
# define g_strdup_printf vir_g_strdup_printf
|
||||||
|
Loading…
x
Reference in New Issue
Block a user