declare cx_compare_func in compare.h - fixes #344

Sun, 31 Dec 2023 14:29:46 +0100

author
Mike Becker <universe@uap-core.de>
date
Sun, 31 Dec 2023 14:29:46 +0100
changeset 786
b0ebb3d88407
parent 785
bb18daa62d5f
child 787
d0f02310aa47

declare cx_compare_func in compare.h - fixes #344

CHANGELOG file | annotate | diff | comparison | revisions
src/cx/collection.h file | annotate | diff | comparison | revisions
src/cx/compare.h file | annotate | diff | comparison | revisions
--- a/CHANGELOG	Sat Dec 30 18:48:25 2023 +0100
+++ b/CHANGELOG	Sun Dec 31 14:29:46 2023 +0100
@@ -5,6 +5,7 @@
  * adds cxBufferReset()
  * adds cx_cmp_ptr()
  * adds improved version of UCX 2 Test framework (now a self-contained header)
+ * the cx_compare_func symbol is now also declared by compare.h
  * fixes wrong link from UCX 2 documentation to UCX 3 documentation
  * removes CMake
  * removes GTest dependency
--- a/src/cx/collection.h	Sat Dec 30 18:48:25 2023 +0100
+++ b/src/cx/collection.h	Sun Dec 31 14:29:46 2023 +0100
@@ -48,6 +48,8 @@
  */
 #define CX_STORE_POINTERS 0
 
+#ifndef CX_COMPARE_FUNC_DEFINED
+#define CX_COMPARE_FUNC_DEFINED
 /**
  * A comparator function comparing two collection elements.
  */
@@ -55,6 +57,7 @@
         void const *left,
         void const *right
 );
+#endif // CX_COMPARE_FUNC_DEFINED
 
 /**
  * Use this macro to declare common members for a collection structure.
--- a/src/cx/compare.h	Sat Dec 30 18:48:25 2023 +0100
+++ b/src/cx/compare.h	Sun Dec 31 14:29:46 2023 +0100
@@ -42,6 +42,17 @@
 extern "C" {
 #endif
 
+#ifndef CX_COMPARE_FUNC_DEFINED
+#define CX_COMPARE_FUNC_DEFINED
+/**
+ * A comparator function comparing two collection elements.
+ */
+typedef int(*cx_compare_func)(
+        void const *left,
+        void const *right
+);
+#endif // CX_COMPARE_FUNC_DEFINED
+
 /**
  * Compares two integers of type int.
  *

mercurial