1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-23 01:59:43 +01:00

Support Emscripten in FileSystemUtils

This commit is contained in:
leo60228 2021-03-31 14:01:58 -04:00 committed by Misa Elizabeth Kai
parent a689c3ab96
commit 6d57ccc25b

View file

@ -25,7 +25,7 @@ int mkdir(char* path, int mode)
MultiByteToWideChar(CP_UTF8, 0, path, -1, utf16_path, MAX_PATH); MultiByteToWideChar(CP_UTF8, 0, path, -1, utf16_path, MAX_PATH);
return CreateDirectoryW(utf16_path, NULL); return CreateDirectoryW(utf16_path, NULL);
} }
#elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__HAIKU__) || defined(__DragonFly__) #elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__HAIKU__) || defined(__DragonFly__) || defined(__EMSCRIPTEN__)
#include <limits.h> #include <limits.h>
#include <sys/stat.h> #include <sys/stat.h>
#define MAX_PATH PATH_MAX #define MAX_PATH PATH_MAX
@ -996,6 +996,12 @@ bool FILESYSTEM_openDirectoryEnabled(void)
return !SDL_GetHintBoolean("SteamTenfoot", SDL_FALSE); return !SDL_GetHintBoolean("SteamTenfoot", SDL_FALSE);
} }
#if defined(__EMSCRIPTEN__)
bool FILESYSTEM_openDirectory(const char *dname)
{
return false;
}
#else
bool FILESYSTEM_openDirectory(const char *dname) bool FILESYSTEM_openDirectory(const char *dname)
{ {
char url[MAX_PATH]; char url[MAX_PATH];
@ -1007,6 +1013,7 @@ bool FILESYSTEM_openDirectory(const char *dname)
} }
return true; return true;
} }
#endif
bool FILESYSTEM_delete(const char *name) bool FILESYSTEM_delete(const char *name)
{ {