Skip to content

Commit

Permalink
Merge pull request #21 from QiwenLi0729/main
Browse files Browse the repository at this point in the history
添加__cpluscplus宏, 修复C++兼容性
  • Loading branch information
pinxue authored Feb 16, 2022
2 parents c62b9ec + 15ae884 commit 6476fc1
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 0 deletions.
9 changes: 9 additions & 0 deletions RT-AK/rt_ai_lib/include/rt_ai.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@

#ifndef _RT_AI_H
#define _RT_AI_H

#ifdef __cplusplus
extern "C"{
#endif

#include <rt_ai_def.h>
#include <rt_ai_common.h>

Expand All @@ -19,4 +24,8 @@ rt_err_t rt_ai_run(rt_ai_t ai, void (*callback)(void * arg), void *arg);
rt_ai_t rt_ai_find(const char *name);
rt_ai_buffer_t* rt_ai_output(rt_ai_t ai, rt_uint32_t index);
rt_err_t rt_ai_config(rt_ai_t ai, int cmd, rt_ai_buffer_t *arg);

#ifdef __cplusplus
}
#endif
#endif // _RT_AI_H
8 changes: 8 additions & 0 deletions RT-AK/rt_ai_lib/include/rt_ai_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
#include <rt_ai_def.h>
#include <aiconfig.h>

#ifdef __cplusplus
extern "C"{
#endif

#define RT_AI_FLAG_INITED 0x01
#define RT_AI_FLAG_LOADED 0X02
#define RT_AI_FLAG_RUN 0x04
Expand Down Expand Up @@ -102,4 +106,8 @@ if (!(_expr))
#define rt_ai_del(_ptr) rt_ai_free(_ptr)

void rt_ai_allocate_buffer(rt_ai_t ai, rt_ai_buffer_t *buf);

#ifdef __cplusplus
}
#endif
#endif
8 changes: 8 additions & 0 deletions RT-AK/rt_ai_lib/include/rt_ai_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,16 @@
#include <rt_ai_def.h>
#include <rt_ai_common.h>

#ifdef __cplusplus
extern "C"{
#endif

rt_ai_core_t rt_ai_core_register(struct rt_ai_core *object, enum rt_ai_obj_type type, const char *name);
rt_ai_core_t rt_ai_core_find(const char *name, rt_uint8_t type);
void rt_ai_core_detach(rt_ai_core_t object);

#ifdef __cplusplus
}
#endif
#endif

8 changes: 8 additions & 0 deletions RT-AK/rt_ai_lib/include/rt_ai_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
#include <rtthread.h>
#include <aiconfig.h>

#ifdef __cplusplus
extern "C"{
#endif

#define RT_AI_NULL NULL
#define RT_AI_OK 0
#define RT_AI_ERROR 1
Expand Down Expand Up @@ -139,4 +143,8 @@ struct rt_ai_record
rt_ai_uint32_t record;
};


#ifdef __cplusplus
}
#endif
#endif
7 changes: 7 additions & 0 deletions RT-AK/rt_ai_lib/include/rt_ai_runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
#define __RT_AI_RUNTIME_H__
#include <rt_ai_def.h>

#ifdef __cplusplus
extern "C"{
#endif

void run_done(void *arg);
void run_entry(rt_ai_t ai);
rt_ai_record_t rt_ai_record_find(const char *name);
Expand All @@ -27,4 +31,7 @@ rt_ai_timestamp_t statistic_time_interval(const char *name);
#define STATISTIC_TIME_INTERVAL(_name) \
statistic_time_interval(_name)

#ifdef __cplusplus
}
#endif
#endif //end

0 comments on commit 6476fc1

Please sign in to comment.