diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2023-05-20 13:47:52 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2023-05-20 13:47:55 -0700 |
commit | 2695ccda5df58af60ebb15bb17f1570437554adb (patch) | |
tree | 2e0b0783fec411ac250a0240378355c090b3ebb8 | |
parent | 4524c578581b427145ae136844fc655a89e94777 (diff) |
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 <alan.coopersmith@oracle.com>
-rw-r--r-- | configure.ac | 3 | ||||
-rw-r--r-- | test/TestAllFiles.h | 6 |
2 files changed, 9 insertions, 0 deletions
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; |