From 2695ccda5df58af60ebb15bb17f1570437554adb Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sat, 20 May 2023 13:47:52 -0700 Subject: test: use g_pattern_spec_match_string if available g_pattern_spec_match_string was introduced in glib 2.70 to replace g_pattern_match_string which is deprecated in glib 2.70 and later. Signed-off-by: Alan Coopersmith --- configure.ac | 3 +++ test/TestAllFiles.h | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/configure.ac b/configure.ac index a69daaf..c22c988 100644 --- a/configure.ac +++ b/configure.ac @@ -103,6 +103,9 @@ fi AC_REQUIRE_AUX_FILE([tap-driver.sh]) XORG_ENABLE_UNIT_TESTS XORG_WITH_GLIB([2.46]) +if test "x$have_glib" = x"yes"; then + AC_CHECK_FUNCS([g_pattern_spec_match_string]) +fi XORG_MEMORY_CHECK_FLAGS AC_CONFIG_FILES([Makefile diff --git a/test/TestAllFiles.h b/test/TestAllFiles.h index 505b2a3..da171bb 100644 --- a/test/TestAllFiles.h +++ b/test/TestAllFiles.h @@ -32,6 +32,12 @@ #include "config.h" +/* g_pattern_spec_match_string is available in glib 2.70 and later, + to replace the deprecated g_pattern_match_string */ +#ifdef HAVE_G_PATTERN_SPEC_MATCH_STRING +#define g_pattern_match_string g_pattern_spec_match_string +#endif + #define DEFAULT_TIMEOUT 10 /* maximum seconds for each file */ static sigjmp_buf jump_env; -- cgit v1.2.3