|
|
@@ -436,7 +436,7 @@ Filename Filename::
|
|
|
temporary(const string &dirname, const string &prefix, const string &suffix,
|
|
|
Type type) {
|
|
|
Filename fdirname = dirname;
|
|
|
-#if defined(_WIN32) || defined(ANDROID)
|
|
|
+#if defined(_WIN32) || defined(ANDROID) || defined(__wasi__)
|
|
|
// The Windows tempnam() function doesn't do a good job of choosing a
|
|
|
// temporary directory. Choose one ourselves.
|
|
|
if (fdirname.empty()) {
|
|
|
@@ -1049,7 +1049,7 @@ make_canonical() {
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
-#ifndef _WIN32
|
|
|
+#if !defined(_WIN32) && !defined(__wasi__)
|
|
|
// Use realpath in order to resolve symlinks properly
|
|
|
char newpath [PATH_MAX + 1];
|
|
|
if (realpath(c_str(), newpath) != nullptr) {
|
|
|
@@ -1057,7 +1057,7 @@ make_canonical() {
|
|
|
newpath_fn._flags = _flags;
|
|
|
(*this) = newpath_fn;
|
|
|
}
|
|
|
-#endif
|
|
|
+#endif // _WIN32 __wasi__
|
|
|
|
|
|
Filename cwd = ExecutionEnvironment::get_cwd();
|
|
|
if (!r_make_canonical(cwd)) {
|