mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
json: Windows fix
This commit is contained in:
@@ -4,14 +4,10 @@
|
|||||||
|
|
||||||
module json
|
module json
|
||||||
|
|
||||||
// TODO: windows support
|
#flag -I @VROOT/thirdparty/cJSON
|
||||||
|
|
||||||
#flag linux -I @VROOT/thirdparty/cJSON
|
|
||||||
#flag darwin -I @VROOT/thirdparty/cJSON
|
|
||||||
|
|
||||||
#flag @VROOT/thirdparty/cJSON/cJSON.o
|
#flag @VROOT/thirdparty/cJSON/cJSON.o
|
||||||
|
|
||||||
#include "cJSON.h"
|
#include "cJSON.h"
|
||||||
|
|
||||||
struct C.cJSON {
|
struct C.cJSON {
|
||||||
valueint int
|
valueint int
|
||||||
valuedouble f32
|
valuedouble f32
|
||||||
@@ -25,8 +21,6 @@ fn jsdecode_int(root *C.cJSON) int {
|
|||||||
return root.valueint
|
return root.valueint
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: Refactor with generics when it will be avaible
|
|
||||||
|
|
||||||
fn jsdecode_i8(root *C.cJSON) i8 {
|
fn jsdecode_i8(root *C.cJSON) i8 {
|
||||||
if isnil(root) {
|
if isnil(root) {
|
||||||
return i8(0)
|
return i8(0)
|
||||||
@@ -90,7 +84,6 @@ fn jsdecode_bool(root *C.cJSON) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ///////////////////
|
// ///////////////////
|
||||||
//TODO: Refactor with Generics when it will be available
|
|
||||||
fn jsencode_int(val int) *C.cJSON {
|
fn jsencode_int(val int) *C.cJSON {
|
||||||
return C.cJSON_CreateNumber(val)
|
return C.cJSON_CreateNumber(val)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user