From 183a89859ba9914ee0546e4482b40be199e52292 Mon Sep 17 00:00:00 2001 From: Tyge Løvset Date: Thu, 16 Dec 2021 07:32:16 +0100 Subject: Changed default comparison of csbox and csptr objects to comparing addresses to containing objects. If i_cmp is defined, it is used instead. --- include/stc/csptr.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include/stc/csptr.h') diff --git a/include/stc/csptr.h b/include/stc/csptr.h index 06790e01..4753ef12 100644 --- a/include/stc/csptr.h +++ b/include/stc/csptr.h @@ -185,9 +185,9 @@ _cx_memb(_take)(_cx_self* self, _cx_self ptr) { STC_INLINE uint64_t _cx_memb(_hash)(const _cx_self* self, size_t n) { - #if c_option(c_no_compare) && SIZE_MAX >> 32 + #if (c_option(c_no_compare) || defined _i_default_compare) && SIZE_MAX >> 32 return c_hash64(&self->get, 8); - #elif c_option(c_no_compare) + #elif (c_option(c_no_compare) || defined _i_default_compare) return c_hash32(&self->get, 4); #else i_valraw raw = i_valto(self->get); @@ -197,7 +197,7 @@ _cx_memb(_hash)(const _cx_self* self, size_t n) { STC_INLINE int _cx_memb(_compare)(const _cx_self* x, const _cx_self* y) { - #if c_option(c_no_compare) + #if (c_option(c_no_compare) || defined _i_default_compare) return (int)(x->get - y->get); #else i_valraw rx = i_valto(x->get); -- cgit v1.2.3