summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authortylov <[email protected]>2023-08-11 22:43:59 +0200
committertylov <[email protected]>2023-08-11 22:43:59 +0200
commit31ba4b2a36dee10b7e5d58561a2c0291cff6faeb (patch)
tree28c56e41c5d3534dc12821d407f4ff808b766cac /include
parent0c29a8413619870f23682b74c032137e81db17e2 (diff)
downloadSTC-modified-31ba4b2a36dee10b7e5d58561a2c0291cff6faeb.tar.gz
STC-modified-31ba4b2a36dee10b7e5d58561a2c0291cff6faeb.zip
Finalized converting to i_use_cmp (vs i_no_cmp)
Diffstat (limited to 'include')
-rw-r--r--include/stc/carc.h9
-rw-r--r--include/stc/ccommon.h3
2 files changed, 7 insertions, 5 deletions
diff --git a/include/stc/carc.h b/include/stc/carc.h
index e987f453..1b1c22eb 100644
--- a/include/stc/carc.h
+++ b/include/stc/carc.h
@@ -43,7 +43,6 @@ void Person_drop(Person* p) {
#define i_type ArcPers
#define i_valclass Person // clone, drop, cmp, hash
-#define i_opt c_no_cmp|c_no_hash // exclude cmp, hash
#include <stc/carc.h>
int main(void) {
@@ -86,7 +85,10 @@ int main(void) {
#include "priv/template.h"
typedef i_keyraw _cx_raw;
-#if !c_option(c_no_atomic)
+#if c_option(c_no_atomic)
+ #define i_no_atomic
+#endif
+#if !defined i_no_atomic
#define _i_atomic_inc(v) c_atomic_inc(v)
#define _i_atomic_dec_and_test(v) c_atomic_dec_and_test(v)
#else
@@ -213,7 +215,8 @@ STC_INLINE void _cx_MEMB(_assign)(_cx_Self* self, _cx_Self ptr) {
{ return c_default_hash(&self->get); }
#endif // i_use_cmp
+#include "priv/template2.h"
+#undef i_no_atomic
#undef _i_atomic_inc
#undef _i_atomic_dec_and_test
-#include "priv/template2.h"
#undef _i_carc
diff --git a/include/stc/ccommon.h b/include/stc/ccommon.h
index b37ad1da..45fa01c6 100644
--- a/include/stc/ccommon.h
+++ b/include/stc/ccommon.h
@@ -116,9 +116,8 @@ typedef long long _llong;
#define c_no_atomic (1<<1)
#define c_no_clone (1<<2)
#define c_no_emplace (1<<3)
-#define c_no_cmp (1<<4)
+#define c_no_hash (1<<4)
#define c_use_cmp (1<<5)
-#define c_no_hash (1<<6)
/* Function macros and others */
#define c_litstrlen(literal) (c_sizeof("" literal) - 1)