re-org platform APIs, simplify porting process (#201)
Co-authored-by: Xu Jun <jun1.xu@intel.com>
This commit is contained in:
@ -16,14 +16,7 @@ typedef union jvalue {
|
||||
double d;
|
||||
} jvalue;
|
||||
|
||||
#ifndef bh_memcpy_s
|
||||
int b_memcpy_s(void * s1, unsigned int s1max,
|
||||
const void * s2, unsigned int n);
|
||||
#define bh_memcpy_s(dest, dlen, src, slen) do { \
|
||||
int _ret = slen == 0 ? 0 : b_memcpy_s (dest, dlen, src, slen); \
|
||||
(void)_ret; \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
|
||||
static inline int16_t get_int16(const char *buf)
|
||||
{
|
||||
|
||||
@ -9,30 +9,6 @@
|
||||
/* Note: the bh_plaform.h is the only head file separately
|
||||
implemented by both [app] and [native] worlds */
|
||||
#include "bh_platform.h"
|
||||
#include "wasm_export.h"
|
||||
|
||||
#define get_module_inst(exec_env) \
|
||||
wasm_runtime_get_module_inst(exec_env)
|
||||
|
||||
#define validate_app_addr(offset, size) \
|
||||
wasm_runtime_validate_app_addr(module_inst, offset, size)
|
||||
|
||||
#define validate_app_str_addr(offset) \
|
||||
wasm_runtime_validate_app_str_addr(module_inst, offset)
|
||||
|
||||
#define addr_app_to_native(offset) \
|
||||
wasm_runtime_addr_app_to_native(module_inst, offset)
|
||||
|
||||
#define addr_native_to_app(ptr) \
|
||||
wasm_runtime_addr_native_to_app(module_inst, ptr)
|
||||
|
||||
#define module_malloc(size, p_native_addr) \
|
||||
wasm_runtime_module_malloc(module_inst, size, p_native_addr)
|
||||
|
||||
#define module_free(offset) \
|
||||
wasm_runtime_module_free(module_inst, offset)
|
||||
|
||||
/*char *wa_strdup(const char *);*/
|
||||
|
||||
|
||||
#endif /* end of _NATIVE_INTERFACE_H */
|
||||
|
||||
Reference in New Issue
Block a user