summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2021-10-04 19:28:17 +0200
committerTyge Løvset <[email protected]>2021-10-04 19:28:17 +0200
commit20645dbb5ca19015d100f33277c7fcf60bd4bf93 (patch)
tree1e54746437047c9c19cf4f2115070f29728ec189 /include
parent35997591de5a448752734c822b0f1003e08853a5 (diff)
downloadSTC-modified-20645dbb5ca19015d100f33277c7fcf60bd4bf93.tar.gz
STC-modified-20645dbb5ca19015d100f33277c7fcf60bd4bf93.zip
Added c_autodefer() macro (again). Depressed warning with c_no_compare().
Diffstat (limited to 'include')
-rw-r--r--include/stc/ccommon.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/stc/ccommon.h b/include/stc/ccommon.h
index c9ca7ad0..e3ccfffd 100644
--- a/include/stc/ccommon.h
+++ b/include/stc/ccommon.h
@@ -94,7 +94,7 @@
#define c_default_compare(x, y) c_less_compare(c_default_less, x, y)
#define c_default_less(x, y) (*(x) < *(y))
-#define c_no_compare(x, y) (assert(!"c_no_compare() called"), 0)
+#define c_no_compare(x, y) (assert(!"c_no_compare() called"), (x)==(y))
#define c_less_compare(less, x, y) (less(y, x) - less(x, y))
#define c_default_equals(x, y) (*(x) == *(y))
@@ -138,6 +138,7 @@ STC_API uint64_t c_default_hash(const void *key, size_t len);
#define c_autoscope(init, ...) for (int _c_ii = (init, 0); !_c_ii; ++_c_ii, __VA_ARGS__)
#define c_autovar(declvar, ...) for (declvar, *_c_ii = NULL; !_c_ii; ++_c_ii, __VA_ARGS__)
+#define c_autodefer(...) for (int _c_ii = 0; !_c_ii; ++_c_ii, __VA_ARGS__)
#define c_exitauto continue
#define c_auto(...) c_MACRO_OVERLOAD(c_auto, __VA_ARGS__)