diff --git a/src/autocomplete.cpp b/src/autocomplete.cpp index 66b40893c5..f22ed00a5d 100644 --- a/src/autocomplete.cpp +++ b/src/autocomplete.cpp @@ -25,8 +25,12 @@ #include #include #include -#include -namespace fs = std::filesystem; + +#if !defined(__MINGW32__) && !defined(__ANDROID__) && (!defined(__GNUC__) || (__GNUC__*100+__GNUC_MINOR__) >= 503) + #define HAVE_FILESYSTEM + #include + namespace fs = std::filesystem; +#endif namespace mega { namespace autocomplete { @@ -592,6 +596,7 @@ bool LocalFS::addCompletions(ACState& s) { if (s.atCursor()) { +#ifdef HAVE_FILESYSTEM fs::path searchPath = fs::u8path(s.word().s + (s.word().s.empty() || (s.word().s.back() == '\\' || s.word().s.back() == '/' ) ? "*" : "")); #ifdef WIN32 char sep = (!s.word().s.empty() && s.word().s.find('/') != string::npos ) ?'/':'\\'; @@ -628,6 +633,9 @@ bool LocalFS::addCompletions(ACState& s) } } } +#else +// todo: implement local directory listing for any platforms without std::filsystem, if it turns out to be needed +#endif return true; } else