summaryrefslogtreecommitdiffhomepage
path: root/include/stc/clist.h
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2023-02-24 11:26:53 +0100
committerTyge Løvset <[email protected]>2023-02-24 11:26:53 +0100
commit84e75e1b5039c3e04d9683ec7d8302f1a824b5cb (patch)
treea3229848ed987974e00638fb844a6ff7aa3099c6 /include/stc/clist.h
parent35e872ec6c0c23b0843e81ff886fc7f5742670b1 (diff)
downloadSTC-modified-84e75e1b5039c3e04d9683ec7d8302f1a824b5cb.tar.gz
STC-modified-84e75e1b5039c3e04d9683ec7d8302f1a824b5cb.zip
Allow to have both i_no_cmp and i_eq defined.
Diffstat (limited to 'include/stc/clist.h')
-rw-r--r--include/stc/clist.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/include/stc/clist.h b/include/stc/clist.h
index e6423c53..6fd7252d 100644
--- a/include/stc/clist.h
+++ b/include/stc/clist.h
@@ -99,9 +99,11 @@ STC_API _cx_value* _cx_memb(_push_front)(_cx_self* self, i_key value);
STC_API _cx_iter _cx_memb(_insert_at)(_cx_self* self, _cx_iter it, i_key value);
STC_API _cx_iter _cx_memb(_erase_at)(_cx_self* self, _cx_iter it);
STC_API _cx_iter _cx_memb(_erase_range)(_cx_self* self, _cx_iter it1, _cx_iter it2);
-#if !defined i_no_cmp
-STC_API intptr_t _cx_memb(_remove)(_cx_self* self, _cx_raw val);
+#if !defined i_no_cmp || defined _i_has_eq
STC_API _cx_iter _cx_memb(_find_in)(_cx_iter it1, _cx_iter it2, _cx_raw val);
+STC_API intptr_t _cx_memb(_remove)(_cx_self* self, _cx_raw val);
+#endif
+#ifndef i_no_cmp
STC_API int _cx_memb(_sort_cmp_)(const _cx_node* x, const _cx_node* y);
#endif
STC_API void _cx_memb(_reverse)(_cx_self* self);
@@ -188,7 +190,7 @@ _cx_memb(_splice_range)(_cx_self* self, _cx_iter it,
return _cx_memb(_splice)(self, it, &tmp);
}
-#if !defined i_no_cmp
+#if !defined i_no_cmp || defined _i_has_eq
STC_INLINE _cx_iter
_cx_memb(_find)(const _cx_self* self, _cx_raw val) {
return _cx_memb(_find_in)(_cx_memb(_begin)(self), _cx_memb(_end)(self), val);
@@ -203,6 +205,8 @@ STC_INLINE _cx_value*
_cx_memb(_get_mut)(_cx_self* self, _cx_raw val) {
return _cx_memb(_find_in)(_cx_memb(_begin)(self), _cx_memb(_end)(self), val).ref;
}
+#endif
+#ifndef i_no_cmp
STC_INLINE void
_cx_memb(_sort)(_cx_self* self) {
@@ -401,7 +405,7 @@ _cx_memb(_split_off)(_cx_self* self, _cx_iter it1, _cx_iter it2) {
return lst;
}
-#if !defined i_no_cmp
+#if !defined i_no_cmp || defined _i_has_eq
STC_DEF _cx_iter
_cx_memb(_find_in)(_cx_iter it1, _cx_iter it2, _cx_raw val) {
@@ -428,6 +432,8 @@ _cx_memb(_remove)(_cx_self* self, _cx_raw val) {
} while (node != self->last);
return n;
}
+#endif
+#ifndef i_no_cmp
STC_DEF int
_cx_memb(_sort_cmp_)(const _cx_node* x, const _cx_node* y) {