Use _fullpath function on windows to get absolute path of a directory (#2377)

There is no standard `realpath` function in the C/C++ standard libraries for Windows,
use `_fullpath` function instead to get absolute path of a directory.
This commit is contained in:
Marcin Kolny 2023-07-22 01:46:10 +01:00 committed by GitHub
parent 662e38e9b0
commit a9d008f942
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2895,7 +2895,11 @@ wasm_runtime_init_wasi(WASMModuleInstanceCommon *module_inst,
wasm_fd = 3;
for (i = 0; i < dir_count; i++, wasm_fd++) {
#ifdef BH_PLATFORM_WINDOWS
path = _fullpath(resolved_path, dir_list[i], PATH_MAX);
#else
path = realpath(dir_list[i], resolved_path);
#endif
if (!path) {
if (error_buf)
snprintf(error_buf, error_buf_size,