summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2020-02-25 20:02:28 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2020-02-25 20:02:28 -0500
commitb1c2b4bcabfd3ff01921e2601d41a33b40ec1f3b (patch)
treede2c1054c369fb71e4f7e0dbc7141607e63a91ef
parenta30ad2609d09002c3de7494029016c963d26bd48 (diff)
cleaned up a few things so that msvc build still works
-rw-r--r--cgen.c2
-rw-r--r--eval.c2
-rw-r--r--types.h2
3 files changed, 4 insertions, 2 deletions
diff --git a/cgen.c b/cgen.c
index 27cf651..31d9467 100644
--- a/cgen.c
+++ b/cgen.c
@@ -721,7 +721,7 @@ static bool cgen_set_tuple(CGenerator *g, Expression *exprs, Identifier *idents,
else if (exprs)
e = &exprs[i];
else {
- snprintf(buf, sizeof buf, "(%s%lu_)", prefix, i);
+ snprintf(buf, sizeof buf, "(%s%lu_)", prefix, (unsigned long)i);
s = buf;
}
if (!cgen_set(g, e, s, &to->tuple[i], NULL)) return false;
diff --git a/eval.c b/eval.c
index 850984e..d5603f5 100644
--- a/eval.c
+++ b/eval.c
@@ -12,7 +12,7 @@ static bool eval_expr(Evaluator *ev, Expression *e, Value *v);
static Value get_builtin_val(BuiltinVal val);
static void evalr_create(Evaluator *ev, Typer *tr, Allocator *allocr) {
- ev->returning = NULL;
+ ev->returning = false;
ev->typer = tr;
ev->enabled = true;
ev->allocr = allocr;
diff --git a/types.h b/types.h
index 04b6dea..f8a0716 100644
--- a/types.h
+++ b/types.h
@@ -60,6 +60,8 @@ typedef uint64_t U64;
#elif defined __cplusplus
#else
typedef U8 bool;
+#define false ((bool)0)
+#define true ((bool)1)
#endif