fix error
This commit is contained in:
parent
9dc1d995aa
commit
07c2945a9d
|
@ -3,7 +3,7 @@ from building import *
|
|||
cwd = GetCurrentDir()
|
||||
src = []
|
||||
src = src + Glob('src/*.c')
|
||||
src = src + Glob('adapter/*.c')
|
||||
src = src + Glob('adapter/cjson/*.c')
|
||||
|
||||
CPPPATH = [cwd + '/inc']
|
||||
LOCAL_CFLAGS = " -Wall -Wextra "
|
||||
|
|
|
@ -7,6 +7,14 @@
|
|||
#include "string.h"
|
||||
#include "stdio.h"
|
||||
|
||||
// for RT-Thread
|
||||
#ifdef __RTTHREAD__
|
||||
#include "rtthread.h"
|
||||
|
||||
#define printf rt_kprintf
|
||||
#endif // __RTTHREAD__
|
||||
|
||||
|
||||
cson_t cjson_impl_object_get(const cson_t object, const char* key){
|
||||
return cJSON_GetObjectItem((cJSON*)object, key);
|
||||
}
|
||||
|
|
15
inc/cson.h
15
inc/cson.h
|
@ -7,21 +7,6 @@
|
|||
|
||||
#include "stddef.h"
|
||||
|
||||
// for RT-Thread
|
||||
#ifdef __RTTHREAD__
|
||||
#include "rtthread.h"
|
||||
|
||||
#define printf rt_kprintf
|
||||
#define free rt_free
|
||||
#define memset rt_memset
|
||||
#define memcpy rt_memcpy
|
||||
#define malloc rt_malloc
|
||||
#define strcpy rt_strcpy
|
||||
#define strcmp rt_strcmp
|
||||
#define strlen rt_strlen
|
||||
#endif // __RTTHREAD__
|
||||
|
||||
|
||||
/**
|
||||
* @brief error code of parser.
|
||||
*/
|
||||
|
|
14
src/cson.c
14
src/cson.c
|
@ -9,6 +9,20 @@
|
|||
#include "limits.h"
|
||||
#include "string.h"
|
||||
|
||||
// for RT-Thread
|
||||
#ifdef __RTTHREAD__
|
||||
#include "rtthread.h"
|
||||
|
||||
#define printf rt_kprintf
|
||||
#define free rt_free
|
||||
#define memset rt_memset
|
||||
#define memcpy rt_memcpy
|
||||
#define malloc rt_malloc
|
||||
#define strcpy rt_strcpy
|
||||
#define strcmp rt_strcmp
|
||||
#define strlen rt_strlen
|
||||
#endif // __RTTHREAD__
|
||||
|
||||
extern cson_interface csomImpl;
|
||||
|
||||
#define cson_object_get csomImpl.cson_object_get
|
||||
|
|
Loading…
Reference in New Issue