diff -r 83284b289430 -r 3a89b31f0724 src/cx/compare.h --- a/src/cx/compare.h Wed Oct 15 22:45:21 2025 +0200 +++ b/src/cx/compare.h Thu Oct 16 19:57:47 2025 +0200 @@ -54,13 +54,7 @@ * can be used, but they are NOT compatible with this function * pointer. */ -cx_attr_nonnull -cx_attr_nodiscard -cx_attr_export -typedef int (*cx_compare_func)( - const void *left, - const void *right -); +typedef int (*cx_compare_func)(const void *left, const void *right); /** * Compares two integers of type int. @@ -74,10 +68,8 @@ * @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_int(const void *i1, const void *i2); +cx_attr_nonnull cx_attr_nodiscard +CX_EXPORT int cx_cmp_int(const void *i1, const void *i2); /** * Compares two integers of type int. @@ -89,8 +81,7 @@ * @retval 1 if the left argument is greater than the right argument */ cx_attr_nodiscard -cx_attr_export -int cx_vcmp_int(int i1, int i2); +CX_EXPORT int cx_vcmp_int(int i1, int i2); /** * Compares two integers of type long int. @@ -104,10 +95,8 @@ * @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_longint(const void *i1, const void *i2); +cx_attr_nonnull cx_attr_nodiscard +CX_EXPORT int cx_cmp_longint(const void *i1, const void *i2); /** * Compares two integers of type long int. @@ -119,8 +108,7 @@ * @retval 1 if the left argument is greater than the right argument */ cx_attr_nodiscard -cx_attr_export -int cx_vcmp_longint(long int i1, long int i2); +CX_EXPORT int cx_vcmp_longint(long int i1, long int i2); /** * Compares two integers of type long long. @@ -134,10 +122,8 @@ * @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_longlong(const void *i1, const void *i2); +cx_attr_nonnull cx_attr_nodiscard +CX_EXPORT int cx_cmp_longlong(const void *i1, const void *i2); /** * Compares two integers of type long long. @@ -149,8 +135,7 @@ * @retval 1 if the left argument is greater than the right argument */ cx_attr_nodiscard -cx_attr_export -int cx_vcmp_longlong(long long int i1, long long int i2); +CX_EXPORT int cx_vcmp_longlong(long long int i1, long long int i2); /** * Compares two integers of type int16_t. @@ -164,10 +149,8 @@ * @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_int16(const void *i1, const void *i2); +cx_attr_nonnull cx_attr_nodiscard +CX_EXPORT int cx_cmp_int16(const void *i1, const void *i2); /** * Compares two integers of type int16_t. @@ -179,8 +162,7 @@ * @retval 1 if the left argument is greater than the right argument */ cx_attr_nodiscard -cx_attr_export -int cx_vcmp_int16(int16_t i1, int16_t i2); +CX_EXPORT int cx_vcmp_int16(int16_t i1, int16_t i2); /** * Compares two integers of type int32_t. @@ -194,10 +176,8 @@ * @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_int32(const void *i1, const void *i2); +cx_attr_nonnull cx_attr_nodiscard +CX_EXPORT int cx_cmp_int32(const void *i1, const void *i2); /** * Compares two integers of type int32_t. @@ -209,8 +189,7 @@ * @retval 1 if the left argument is greater than the right argument */ cx_attr_nodiscard -cx_attr_export -int cx_vcmp_int32(int32_t i1, int32_t i2); +CX_EXPORT int cx_vcmp_int32(int32_t i1, int32_t i2); /** * Compares two integers of type int64_t. @@ -224,10 +203,8 @@ * @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_int64(const void *i1, const void *i2); +cx_attr_nonnull cx_attr_nodiscard +CX_EXPORT int cx_cmp_int64(const void *i1, const void *i2); /** * Compares two integers of type int64_t. @@ -239,8 +216,7 @@ * @retval 1 if the left argument is greater than the right argument */ cx_attr_nodiscard -cx_attr_export -int cx_vcmp_int64(int64_t i1, int64_t i2); +CX_EXPORT int cx_vcmp_int64(int64_t i1, int64_t i2); /** * Compares two integers of type unsigned int. @@ -254,10 +230,8 @@ * @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_uint(const void *i1, const void *i2); +cx_attr_nonnull cx_attr_nodiscard +CX_EXPORT int cx_cmp_uint(const void *i1, const void *i2); /** * Compares two integers of type unsigned int. @@ -269,8 +243,7 @@ * @retval 1 if the left argument is greater than the right argument */ cx_attr_nodiscard -cx_attr_export -int cx_vcmp_uint(unsigned int i1, unsigned int i2); +CX_EXPORT int cx_vcmp_uint(unsigned int i1, unsigned int i2); /** * Compares two integers of type unsigned long int. @@ -284,10 +257,8 @@ * @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_ulongint(const void *i1, const void *i2); +cx_attr_nonnull cx_attr_nodiscard +CX_EXPORT int cx_cmp_ulongint(const void *i1, const void *i2); /** * Compares two integers of type unsigned long int. @@ -299,8 +270,7 @@ * @retval 1 if the left argument is greater than the right argument */ cx_attr_nodiscard -cx_attr_export -int cx_vcmp_ulongint(unsigned long int i1, unsigned long int i2); +CX_EXPORT int cx_vcmp_ulongint(unsigned long int i1, unsigned long int i2); /** * Compares two integers of type unsigned long long. @@ -314,10 +284,8 @@ * @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_ulonglong(const void *i1, const void *i2); +cx_attr_nonnull cx_attr_nodiscard +CX_EXPORT int cx_cmp_ulonglong(const void *i1, const void *i2); /** * Compares two integers of type unsigned long long. @@ -329,8 +297,7 @@ * @retval 1 if the left argument is greater than the right argument */ cx_attr_nodiscard -cx_attr_export -int cx_vcmp_ulonglong(unsigned long long int i1, unsigned long long int i2); +CX_EXPORT int cx_vcmp_ulonglong(unsigned long long int i1, unsigned long long int i2); /** * Compares two integers of type uint16_t. @@ -344,10 +311,8 @@ * @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_uint16(const void *i1, const void *i2); +cx_attr_nonnull cx_attr_nodiscard +CX_EXPORT int cx_cmp_uint16(const void *i1, const void *i2); /** * Compares two integers of type uint16_t. @@ -359,8 +324,7 @@ * @retval 1 if the left argument is greater than the right argument */ cx_attr_nodiscard -cx_attr_export -int cx_vcmp_uint16(uint16_t i1, uint16_t i2); +CX_EXPORT int cx_vcmp_uint16(uint16_t i1, uint16_t i2); /** * Compares two integers of type uint32_t. @@ -374,10 +338,8 @@ * @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_uint32(const void *i1, const void *i2); +cx_attr_nonnull cx_attr_nodiscard +CX_EXPORT int cx_cmp_uint32(const void *i1, const void *i2); /** * Compares two integers of type uint32_t. @@ -389,8 +351,7 @@ * @retval 1 if the left argument is greater than the right argument */ cx_attr_nodiscard -cx_attr_export -int cx_vcmp_uint32(uint32_t i1, uint32_t i2); +CX_EXPORT int cx_vcmp_uint32(uint32_t i1, uint32_t i2); /** * Compares two integers of type uint64_t. @@ -404,10 +365,8 @@ * @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_uint64(const void *i1, const void *i2); +cx_attr_nonnull cx_attr_nodiscard +CX_EXPORT int cx_cmp_uint64(const void *i1, const void *i2); /** * Compares two integers of type uint64_t. @@ -419,8 +378,7 @@ * @retval 1 if the left argument is greater than the right argument */ cx_attr_nodiscard -cx_attr_export -int cx_vcmp_uint64(uint64_t i1, uint64_t i2); +CX_EXPORT int cx_vcmp_uint64(uint64_t i1, uint64_t i2); /** * Compares two integers of type size_t. @@ -434,10 +392,8 @@ * @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); +cx_attr_nonnull cx_attr_nodiscard +CX_EXPORT int cx_cmp_size(const void *i1, const void *i2); /** * Compares two integers of type size_t. @@ -449,8 +405,7 @@ * @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); +CX_EXPORT int cx_vcmp_size(size_t i1, size_t i2); /** * Compares two real numbers of type float with precision 1e-6f. @@ -464,10 +419,8 @@ * @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_float(const void *f1, const void *f2); +cx_attr_nonnull cx_attr_nodiscard +CX_EXPORT int cx_cmp_float(const void *f1, const void *f2); /** * Compares two real numbers of type float with precision 1e-6f. @@ -479,8 +432,7 @@ * @retval 1 if the left argument is greater than the right argument */ cx_attr_nodiscard -cx_attr_export -int cx_vcmp_float(float f1, float f2); +CX_EXPORT int cx_vcmp_float(float f1, float f2); /** * Compares two real numbers of type double with precision 1e-14. @@ -494,10 +446,8 @@ * @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_double(const void *d1, const void *d2); +cx_attr_nonnull cx_attr_nodiscard +CX_EXPORT int cx_cmp_double(const void *d1, const void *d2); /** * Compares two real numbers of type double with precision 1e-14. @@ -509,8 +459,7 @@ * @retval 1 if the left argument is greater than the right argument */ cx_attr_nodiscard -cx_attr_export -int cx_vcmp_double(double d1, double d2); +CX_EXPORT int cx_vcmp_double(double d1, double d2); /** * Compares the integer representation of two pointers. @@ -524,10 +473,8 @@ * @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_intptr(const void *ptr1, const void *ptr2); +cx_attr_nonnull cx_attr_nodiscard +CX_EXPORT int cx_cmp_intptr(const void *ptr1, const void *ptr2); /** * Compares the integer representation of two pointers. @@ -539,8 +486,7 @@ * @retval 1 if the left argument is greater than the right argument */ cx_attr_nodiscard -cx_attr_export -int cx_vcmp_intptr(intptr_t ptr1, intptr_t ptr2); +CX_EXPORT int cx_vcmp_intptr(intptr_t ptr1, intptr_t ptr2); /** * Compares the unsigned integer representation of two pointers. @@ -554,10 +500,8 @@ * @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_uintptr(const void *ptr1, const void *ptr2); +cx_attr_nonnull cx_attr_nodiscard +CX_EXPORT int cx_cmp_uintptr(const void *ptr1, const void *ptr2); /** * Compares the unsigned integer representation of two pointers. @@ -569,8 +513,7 @@ * @retval 1 if the left argument is greater than the right argument */ cx_attr_nodiscard -cx_attr_export -int cx_vcmp_uintptr(uintptr_t ptr1, uintptr_t ptr2); +CX_EXPORT int cx_vcmp_uintptr(uintptr_t ptr1, uintptr_t ptr2); /** * Compares the pointers specified in the arguments without dereferencing. @@ -581,10 +524,8 @@ * @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_ptr(const void *ptr1, const void *ptr2); +cx_attr_nonnull cx_attr_nodiscard +CX_EXPORT int cx_cmp_ptr(const void *ptr1, const void *ptr2); #ifdef __cplusplus } // extern "C"