fix: changed android defines

This commit is contained in:
2021-11-04 17:42:31 +01:00
parent a3712febca
commit 95e9c270db
9 changed files with 46 additions and 11 deletions

View File

@@ -21,7 +21,7 @@
#include "Dirent/dirent.h"
#include <windows.h>
#else
#include "dirent.h"
#include <dirent.h>
#endif // defined (WIN32) || defined (_WIN32)
namespace imgui_addons
@@ -1156,6 +1156,23 @@ namespace imgui_addons
if(path_max_def)
buffer = new char[PATH_MAX];
#ifdef __ANDROID__
char* real_path = realpath("/storage/emulated/0/Download", buffer);
if (real_path == nullptr)
{
current_path = "/storage/emulated/0/Download";
current_dirlist.push_back("/storage/emulated/0/Download");
}
else
{
current_path = std::string(real_path);
current_path += "/";
parsePathTabs(current_path);
}
#else
char* real_path = realpath("./", buffer);
if (real_path == nullptr)
{
@@ -1169,6 +1186,8 @@ namespace imgui_addons
parsePathTabs(current_path);
}
#endif
if(path_max_def)
delete[] buffer;
else