From f906d0b350b0b4ceb747669c9a9845d11bd0e486 Mon Sep 17 00:00:00 2001 From: lemon Date: Mon, 15 Aug 2022 12:22:47 +0200 Subject: self hosted progress --- src/common.hff | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/common.hff') diff --git a/src/common.hff b/src/common.hff index aac733e..fe90e09 100644 --- a/src/common.hff +++ b/src/common.hff @@ -26,6 +26,19 @@ defmacro foreach(x, i, a, ...body) [ ] defmacro streq(a,b) [ (strcmp(a,b) == 0) ] +defmacro strcieq(a,b) [ (strcasecmp(a,b) == 0) ] + +defmacro coalesce(a,b) [ + (do let $x = a; + $x ? $x : b; ) +] + +defmacro with_tmpchange(var,x,...body) [ + { let $tmp = (var); + (var) = x; + { body } + (var) = $tmp; } +] // Inline functions fn bswap32(x u32) u32 { -- cgit v1.2.3