ucx/compare.c

changeset 2
fbdfaacc4182
parent 0
2483f517c562
child 49
2f71f4ee247a
--- a/ucx/compare.c	Mon Jan 22 17:27:47 2024 +0100
+++ b/ucx/compare.c	Sat Jan 27 17:50:19 2024 +0100
@@ -199,3 +199,15 @@
     }
 }
 
+int cx_cmp_ptr(
+        void const *ptr1,
+        void const *ptr2
+) {
+    uintptr_t p1 = (uintptr_t) ptr1;
+    uintptr_t p2 = (uintptr_t) ptr2;
+    if (p1 == p2) {
+        return 0;
+    } else {
+        return p1 < p2 ? -1 : 1;
+    }
+}

mercurial