summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMike Hommey <mh@glandium.org>2016-09-30 18:15:37 +0900
committerBehdad Esfahbod <behdad@behdad.org>2016-12-18 01:37:07 -0600
commit1c98ff87c76536553e53c131e75aba33033ee3a0 (patch)
treeb9198ee630e94311257a54a851954bc1f730629d /test
parentad273881c597a95929ce3b84f63865f9d7dcdb7e (diff)
Support building with older glib versions
It is desirable to be able to build against older versions of glib. fd7a245 changed the configure check to require glib > 2.38 for G_TEST_DIST. Before that, version 2.16 was required, but in fact, since aafe395, G_PASTE is being used, which was introduced in 2.19.1. And since 0ef179e2, hb-glib uses GBytes, which were introduced in 2.31.10. 2.19.1 is rather old, but 2.38 is rather new. For Firefox, building against 2.22 is still supported, although we could probably get away with bumping that to 2.28. Either way, GBytes is not available. Arguably, if you build against a glib that doesn't support GBytes, you're not going to use the hb_glib_blob_create function, so we hide the function when building against such a glib. As for G_TEST_DIST, when building against versions of glib that don't support it, we can fallback to the previous behavior, which, AIUI, was just making the test not work when building in a separate directory.
Diffstat (limited to 'test')
-rw-r--r--test/api/test-ot-math.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/api/test-ot-math.c b/test/api/test-ot-math.c
index 5f4ccb7f..049656a0 100644
--- a/test/api/test-ot-math.c
+++ b/test/api/test-ot-math.c
@@ -54,7 +54,11 @@ cleanupFreeType (void)
static void
openFont(const char* fontFile)
{
+#if GLIB_CHECK_VERSION(2,37,2)
gchar* path = g_test_build_filename(G_TEST_DIST, fontFile, NULL);
+#else
+ gchar* path = g_strdup(fontFile);
+#endif
FT_Error ft_error;
if ((ft_error = FT_New_Face (ft_library, path, 0, &ft_face))) {