Skip to content

Commit

Permalink
Merge branch 'bug/SDK-3848_revert-filesystem-changes-breaking-build-o…
Browse files Browse the repository at this point in the history
…n-macos-10-13-x86' into 'develop'

SDK-3848: Revert std::filesystem changes breaking macOS 10.13 x86 build

Closes SDK-3848

See merge request sdk/sdk!5455
  • Loading branch information
adlonMEGA committed Apr 15, 2024
2 parents 4729030 + d7934bb commit 6fc1394
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/autocomplete.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,12 @@
#include <mega/megaclient.h>
#include <cassert>
#include <algorithm>
#include <filesystem>
namespace fs = std::filesystem;

#if !defined(__MINGW32__) && !defined(__ANDROID__) && (!defined(__GNUC__) || (__GNUC__*100+__GNUC_MINOR__) >= 503)
#define HAVE_FILESYSTEM
#include <filesystem>
namespace fs = std::filesystem;
#endif

namespace mega {
namespace autocomplete {
Expand Down Expand Up @@ -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 ) ?'/':'\\';
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 6fc1394

Please sign in to comment.