From b39c84f81e5599e59504248c981fcbdb5946a9aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Mon, 14 Aug 2023 10:03:53 +0800 Subject: [PATCH] IO (Android): fix compiler errors if `wordexp` is not available --- src/common/io/io_unix.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/common/io/io_unix.c b/src/common/io/io_unix.c index d1e635e11..1941e6637 100644 --- a/src/common/io/io_unix.c +++ b/src/common/io/io_unix.c @@ -1,12 +1,16 @@ #include "io.h" #include "util/stringUtils.h" +#include "util/unused.h" #include #include #include #include #include + +#if __has_include() #include +#endif static void createSubfolders(const char* fileName) { @@ -108,9 +112,12 @@ bool ffPathExists(const char* path, FFPathType type) return false; } -bool ffPathExpandEnv(const char* in, FFstrbuf* out) +bool ffPathExpandEnv(FF_MAYBE_UNUSED const char* in, FF_MAYBE_UNUSED FFstrbuf* out) { bool result = false; + + #if __has_include() // https://github.com/termux/termux-packages/pull/7056 + wordexp_t exp; if(wordexp(in, &exp, WRDE_NOCMD) != 0) return false; @@ -123,6 +130,8 @@ bool ffPathExpandEnv(const char* in, FFstrbuf* out) wordfree(&exp); + #endif + return result; }