From 8c36b9499dc4f61e1add147454b30dd1eb34640f Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Wed, 3 Jul 2019 21:47:49 +0200 Subject: [PATCH] make json work with new optionals --- Makefile | 2 +- compiler/jsgen.v | 2 +- {vlib/builtin => compiler/tests}/struct_test.v | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename {vlib/builtin => compiler/tests}/struct_test.v (100%) diff --git a/Makefile b/Makefile index 6341205544..71ee253e22 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ all: clean v $(info V has been successfully built) v: v.c - cc -march=native -std=gnu11 -w -o v v.c + cc -std=gnu11 -w -o v v.c ./v -o v compiler rm v.c diff --git a/compiler/jsgen.v b/compiler/jsgen.v index 9f2a8f98af..5b62c098ce 100644 --- a/compiler/jsgen.v +++ b/compiler/jsgen.v @@ -105,7 +105,7 @@ string res = tos2(""); } // cJSON_delete //p.cgen.fns << '$dec return opt_ok(res); \n}' - p.cgen.fns << '$dec return opt_ok(res, sizeof(res)); \n}' + p.cgen.fns << '$dec return opt_ok(res, sizeof(*res)); \n}' p.cgen.fns << '/*enc start*/ $enc return o;}' } diff --git a/vlib/builtin/struct_test.v b/compiler/tests/struct_test.v similarity index 100% rename from vlib/builtin/struct_test.v rename to compiler/tests/struct_test.v