summaryrefslogtreecommitdiffhomepage
path: root/include/stc/csptr.h
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2021-12-16 07:32:16 +0100
committerTyge Løvset <[email protected]>2021-12-16 07:32:16 +0100
commit183a89859ba9914ee0546e4482b40be199e52292 (patch)
treec199c6f1f5dead5e349f2b00f70bb33989ee520e /include/stc/csptr.h
parent7f264be520123c71211967a56d2826d272694edf (diff)
downloadSTC-modified-183a89859ba9914ee0546e4482b40be199e52292.tar.gz
STC-modified-183a89859ba9914ee0546e4482b40be199e52292.zip
Changed default comparison of csbox and csptr objects to comparing addresses to containing objects. If i_cmp is defined, it is used instead.
Diffstat (limited to 'include/stc/csptr.h')
-rw-r--r--include/stc/csptr.h6
1 files changed, 3 insertions, 3 deletions
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);