mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2025-11-15 07:38:12 +00:00
fpi-compat: Add definition for g_memdup2 when not available or deprecated
It's suggested to use g_memdup2 everywhere, but since we've a max-glib version set we'd get a "deprecation" warning. Avoid it this by re-defininig it through a macro in both cases.
This commit is contained in:
@@ -39,6 +39,17 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC (FpDeviceClass, g_type_class_unref);
|
|||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GDate, g_date_free);
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GDate, g_date_free);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if !GLIB_CHECK_VERSION (2, 68, 0)
|
||||||
|
#define g_memdup2(data, size) g_memdup ((data), (size))
|
||||||
|
#else
|
||||||
|
#define g_memdup2(data, size) \
|
||||||
|
(G_GNUC_EXTENSION ({ \
|
||||||
|
G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
|
||||||
|
g_memdup2 ((data), (size)); \
|
||||||
|
G_GNUC_END_IGNORE_DEPRECATIONS \
|
||||||
|
}))
|
||||||
|
#endif
|
||||||
|
|
||||||
#if __GNUC__ > 10 || (__GNUC__ == 10 && __GNUC_MINOR__ >= 1)
|
#if __GNUC__ > 10 || (__GNUC__ == 10 && __GNUC_MINOR__ >= 1)
|
||||||
#define FP_GNUC_ACCESS(m, p, s) __attribute__((access (m, p, s)))
|
#define FP_GNUC_ACCESS(m, p, s) __attribute__((access (m, p, s)))
|
||||||
#else
|
#else
|
||||||
|
|||||||
Reference in New Issue
Block a user