src/cx/compare.h

changeset 1399
40c3b850f859
parent 1186
7fc882813125
--- a/src/cx/compare.h	Sat Sep 27 17:03:35 2025 +0200
+++ b/src/cx/compare.h	Sat Sep 27 17:47:10 2025 +0200
@@ -423,6 +423,36 @@
 int cx_vcmp_uint64(uint64_t i1, uint64_t i2);
 
 /**
+ * Compares two integers of type size_t.
+ *
+ * @note the parameters deliberately have type @c void* to be
+ * compatible with #cx_compare_func without the need of a cast.
+ *
+ * @param i1 pointer to size_t one
+ * @param i2 pointer to size_t two
+ * @retval -1 if the left argument is less than the right argument
+ * @retval 0 if both arguments are equal
+ * @retval 1 if the left argument is greater than the right argument
+ */
+cx_attr_nonnull
+cx_attr_nodiscard
+cx_attr_export
+int cx_cmp_size(const void *i1, const void *i2);
+
+/**
+ * Compares two integers of type size_t.
+ *
+ * @param i1 size_t one
+ * @param i2 size_t two
+ * @retval -1 if the left argument is less than the right argument
+ * @retval 0 if both arguments are equal
+ * @retval 1 if the left argument is greater than the right argument
+ */
+cx_attr_nodiscard
+cx_attr_export
+int cx_vcmp_size(size_t i1, size_t i2);
+
+/**
  * Compares two real numbers of type float with precision 1e-6f.
  *
  * @note the parameters deliberately have type @c void* to be

mercurial