mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2026-03-14 15:48:46 +00:00
Add bh_strtok_r function (#4790)
This commit is contained in:
parent
23df0d4e55
commit
a7fd6539dc
|
|
@ -3909,13 +3909,8 @@ wasm_runtime_init_wasi(WASMModuleInstanceCommon *module_inst,
|
|||
goto fail;
|
||||
}
|
||||
|
||||
#ifdef BH_PLATFORM_WINDOWS
|
||||
address = strtok_s(cp, "/", &nextptr);
|
||||
mask = strtok_s(NULL, "/", &nextptr);
|
||||
#else
|
||||
address = strtok_r(cp, "/", &nextptr);
|
||||
mask = strtok_r(NULL, "/", &nextptr);
|
||||
#endif
|
||||
address = bh_strtok_r(cp, "/", &nextptr);
|
||||
mask = bh_strtok_r(NULL, "/", &nextptr);
|
||||
|
||||
if (!mask) {
|
||||
snprintf(error_buf, error_buf_size,
|
||||
|
|
|
|||
|
|
@ -166,6 +166,16 @@ wa_strdup(const char *s)
|
|||
return s1;
|
||||
}
|
||||
|
||||
char *
|
||||
bh_strtok_r(char *str, const char *delim, char **saveptr)
|
||||
{
|
||||
#if !(defined(_WIN32) || defined(_WIN32_))
|
||||
return strtok_r(str, delim, saveptr);
|
||||
#else
|
||||
return strtok_s(str, delim, saveptr);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if WASM_ENABLE_WAMR_COMPILER != 0 || WASM_ENABLE_JIT != 0
|
||||
int
|
||||
bh_system(const char *cmd)
|
||||
|
|
|
|||
|
|
@ -66,6 +66,9 @@ bh_strdup(const char *s);
|
|||
char *
|
||||
wa_strdup(const char *s);
|
||||
|
||||
char *
|
||||
bh_strtok_r(char *str, const char *delim, char **saveptr);
|
||||
|
||||
#if WASM_ENABLE_WAMR_COMPILER != 0 || WASM_ENABLE_JIT != 0
|
||||
/* Executes a system command in bash/cmd.exe */
|
||||
int
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user