diff --git a/compiler/main.v b/compiler/main.v index 97b9116c31..2e79ebc0b9 100644 --- a/compiler/main.v +++ b/compiler/main.v @@ -238,12 +238,12 @@ void init_consts();') // Embed cjson either in embedvlib or in json.o if imports_json && c.build_mode == EMBED_VLIB || (c.build_mode == BUILD && c.out_name.contains('json.o')) { - cgen.genln('#include "json/cJSON/cJSON.c" ') + cgen.genln('#include "cJSON.c" ') } // We need the cjson header for all the json decoding user will do in default mode if c.build_mode == DEFAULT_MODE { if imports_json { - cgen.genln('#include "json/cJSON/cJSON.h"') + cgen.genln('#include "cJSON.h"') } } if c.build_mode == EMBED_VLIB || c.build_mode == DEFAULT_MODE { diff --git a/json/json_primitives.v b/json/json_primitives.v index 108c916647..9337e5fd1c 100644 --- a/json/json_primitives.v +++ b/json/json_primitives.v @@ -4,8 +4,12 @@ module json -// #include "json/cJSON/cJSON.c" -#include "json/cJSON/cJSON.h" +// TODO: windows support +#flag linux -I$HOME/code/v/thirdpaty/cJSON +#flag mac -I$HOME/code/v/thirdpaty/cJSON + +// #include "cJSON.c" +#include "cJSON.h" struct C.cJSON { valueint int valuestring byteptr