Sun, 31 Dec 2023 14:29:46 +0100
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 |
1.1 --- a/CHANGELOG Sat Dec 30 18:48:25 2023 +0100 1.2 +++ b/CHANGELOG Sun Dec 31 14:29:46 2023 +0100 1.3 @@ -5,6 +5,7 @@ 1.4 * adds cxBufferReset() 1.5 * adds cx_cmp_ptr() 1.6 * adds improved version of UCX 2 Test framework (now a self-contained header) 1.7 + * the cx_compare_func symbol is now also declared by compare.h 1.8 * fixes wrong link from UCX 2 documentation to UCX 3 documentation 1.9 * removes CMake 1.10 * removes GTest dependency
2.1 --- a/src/cx/collection.h Sat Dec 30 18:48:25 2023 +0100 2.2 +++ b/src/cx/collection.h Sun Dec 31 14:29:46 2023 +0100 2.3 @@ -48,6 +48,8 @@ 2.4 */ 2.5 #define CX_STORE_POINTERS 0 2.6 2.7 +#ifndef CX_COMPARE_FUNC_DEFINED 2.8 +#define CX_COMPARE_FUNC_DEFINED 2.9 /** 2.10 * A comparator function comparing two collection elements. 2.11 */ 2.12 @@ -55,6 +57,7 @@ 2.13 void const *left, 2.14 void const *right 2.15 ); 2.16 +#endif // CX_COMPARE_FUNC_DEFINED 2.17 2.18 /** 2.19 * Use this macro to declare common members for a collection structure.
3.1 --- a/src/cx/compare.h Sat Dec 30 18:48:25 2023 +0100 3.2 +++ b/src/cx/compare.h Sun Dec 31 14:29:46 2023 +0100 3.3 @@ -42,6 +42,17 @@ 3.4 extern "C" { 3.5 #endif 3.6 3.7 +#ifndef CX_COMPARE_FUNC_DEFINED 3.8 +#define CX_COMPARE_FUNC_DEFINED 3.9 +/** 3.10 + * A comparator function comparing two collection elements. 3.11 + */ 3.12 +typedef int(*cx_compare_func)( 3.13 + void const *left, 3.14 + void const *right 3.15 +); 3.16 +#endif // CX_COMPARE_FUNC_DEFINED 3.17 + 3.18 /** 3.19 * Compares two integers of type int. 3.20 *