From 057c209bebdd852178030e3cae7a7bd1b1dfe05f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Mon, 19 Feb 2024 22:23:02 +0100 Subject: [PATCH] build: Build-depend on glib 2.68 GLib 2.68 is now more than 3 years old, so we can definitely start using it without thinking too much. This allows us to drop lots of compat code that we had around. And like the previous commit tells us, it will also help us to have more correct code around. --- libfprint/fpi-compat.h | 30 ------------------------------ meson.build | 2 +- 2 files changed, 1 insertion(+), 31 deletions(-) diff --git a/libfprint/fpi-compat.h b/libfprint/fpi-compat.h index ad86874a..efb77723 100644 --- a/libfprint/fpi-compat.h +++ b/libfprint/fpi-compat.h @@ -20,36 +20,6 @@ #include -#if !GLIB_CHECK_VERSION (2, 57, 0) -G_DEFINE_AUTOPTR_CLEANUP_FUNC (GTypeClass, g_type_class_unref); -G_DEFINE_AUTOPTR_CLEANUP_FUNC (GEnumClass, g_type_class_unref); -G_DEFINE_AUTOPTR_CLEANUP_FUNC (GFlagsClass, g_type_class_unref); -G_DEFINE_AUTOPTR_CLEANUP_FUNC (GParamSpec, g_param_spec_unref); -#else -/* Re-define G_SOURCE_FUNC as we are technically not allowed to use it with - * the version we depend on currently. */ -#undef G_SOURCE_FUNC -#endif - -#define G_SOURCE_FUNC(f) ((GSourceFunc) (void (*)(void))(f)) - -#if !GLIB_CHECK_VERSION (2, 63, 3) -typedef struct _FpDeviceClass FpDeviceClass; -G_DEFINE_AUTOPTR_CLEANUP_FUNC (FpDeviceClass, g_type_class_unref); -G_DEFINE_AUTOPTR_CLEANUP_FUNC (GDate, g_date_free); -#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) #define FP_GNUC_ACCESS(m, p, s) __attribute__((access (m, p, s))) #else diff --git a/meson.build b/meson.build index 10d17e75..b57d3c51 100644 --- a/meson.build +++ b/meson.build @@ -21,7 +21,7 @@ datadir = prefix / get_option('datadir') cc = meson.get_compiler('c') cpp = meson.get_compiler('cpp') host_system = host_machine.system() -glib_min_version = '2.56' +glib_min_version = '2.68' glib_version_def = 'GLIB_VERSION_@0@_@1@'.format( glib_min_version.split('.')[0], glib_min_version.split('.')[1])