fix error

This commit is contained in:
chinky 2023-12-15 18:09:19 +08:00
parent 9dc1d995aa
commit 07c2945a9d
4 changed files with 23 additions and 16 deletions

View File

@ -3,7 +3,7 @@ from building import *
cwd = GetCurrentDir() cwd = GetCurrentDir()
src = [] src = []
src = src + Glob('src/*.c') src = src + Glob('src/*.c')
src = src + Glob('adapter/*.c') src = src + Glob('adapter/cjson/*.c')
CPPPATH = [cwd + '/inc'] CPPPATH = [cwd + '/inc']
LOCAL_CFLAGS = " -Wall -Wextra " LOCAL_CFLAGS = " -Wall -Wextra "

View File

@ -7,6 +7,14 @@
#include "string.h" #include "string.h"
#include "stdio.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){ cson_t cjson_impl_object_get(const cson_t object, const char* key){
return cJSON_GetObjectItem((cJSON*)object, key); return cJSON_GetObjectItem((cJSON*)object, key);
} }

View File

@ -7,21 +7,6 @@
#include "stddef.h" #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. * @brief error code of parser.
*/ */

View File

@ -9,6 +9,20 @@
#include "limits.h" #include "limits.h"
#include "string.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; extern cson_interface csomImpl;
#define cson_object_get csomImpl.cson_object_get #define cson_object_get csomImpl.cson_object_get