summaryrefslogtreecommitdiff
path: root/fonts
diff options
context:
space:
mode:
authortnn <tnn@pkgsrc.org>2020-08-18 09:27:38 +0000
committertnn <tnn@pkgsrc.org>2020-08-18 09:27:38 +0000
commit23edf2a6c97ae65d927d2c0f3419c763e09ea648 (patch)
tree3ba7de9cb3e6277a605cc1824192610bc5f6b1a6 /fonts
parent775377a2114ab72cc0a9767a001416cb18093d0f (diff)
downloadpkgsrc-23edf2a6c97ae65d927d2c0f3419c763e09ea648.tar.gz
also need an implementation of uuid_compare() for the test suite
Diffstat (limited to 'fonts')
-rw-r--r--fonts/fontconfig/files/uuid.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/fonts/fontconfig/files/uuid.h b/fonts/fontconfig/files/uuid.h
index 54bd904a004..5debe08ee18 100644
--- a/fonts/fontconfig/files/uuid.h
+++ b/fonts/fontconfig/files/uuid.h
@@ -228,4 +228,21 @@ static void uuid_generate_random(uuid_t out)
__uuid_generate_random(out, &num);
}
+#define UUCMP(u1,u2) if (u1 != u2) return((u1 < u2) ? -1 : 1);
+
+static int uuid_compare(const uuid_t uu1, const uuid_t uu2)
+{
+ struct uuid uuid1, uuid2;
+
+ uuid_unpack(uu1, &uuid1);
+ uuid_unpack(uu2, &uuid2);
+
+ UUCMP(uuid1.time_low, uuid2.time_low);
+ UUCMP(uuid1.time_mid, uuid2.time_mid);
+ UUCMP(uuid1.time_hi_and_version, uuid2.time_hi_and_version);
+ UUCMP(uuid1.clock_seq, uuid2.clock_seq);
+ return memcmp(uuid1.node, uuid2.node, 6);
+}
+
+
#endif