# HG changeset patch # User Mike Becker # Date 1704029386 -3600 # Node ID b0ebb3d88407dc2de2fb8eaefcb6d9aafcad72fb # Parent bb18daa62d5f2fef17d3a343f6087f69e3ecf9fa declare cx_compare_func in compare.h - fixes #344 diff -r bb18daa62d5f -r b0ebb3d88407 CHANGELOG --- 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 diff -r bb18daa62d5f -r b0ebb3d88407 src/cx/collection.h --- 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. diff -r bb18daa62d5f -r b0ebb3d88407 src/cx/compare.h --- 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. *