mirror of https://github.com/mgba-emu/mgba.git
VFS: Fix Windows build
This commit is contained in:
parent
3f78362a3e
commit
d747badc25
|
@ -8,6 +8,7 @@
|
|||
#include "util/string.h"
|
||||
|
||||
#include <dirent.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
static bool _vdClose(struct VDir* vd);
|
||||
static void _vdRewind(struct VDir* vd);
|
||||
|
@ -17,8 +18,10 @@ static struct VFile* _vdOpenFile(struct VDir* vd, const char* path, int mode);
|
|||
static const char* _vdeName(struct VDirEntry* vde);
|
||||
static enum VFSType _vdeType(struct VDirEntry* vde);
|
||||
|
||||
struct VDirDE;
|
||||
struct VDirEntryDE {
|
||||
struct VDirEntry d;
|
||||
struct VDirDE* p;
|
||||
struct dirent* ent;
|
||||
};
|
||||
|
||||
|
@ -50,6 +53,7 @@ struct VDir* VDirOpen(const char* path) {
|
|||
|
||||
vd->vde.d.name = _vdeName;
|
||||
vd->vde.d.type = _vdeType;
|
||||
vd->vde.p = vd;
|
||||
|
||||
return &vd->d;
|
||||
}
|
||||
|
@ -201,7 +205,7 @@ static enum VFSType _vdeType(struct VDirEntry* vde) {
|
|||
}
|
||||
return VFS_FILE;
|
||||
#else
|
||||
const char* dir = vdde->path;
|
||||
const char* dir = vdede->p->path;
|
||||
char* combined = malloc(sizeof(char) * (strlen(vdede->ent->d_name) + strlen(dir) + 2));
|
||||
sprintf(combined, "%s%s%s", dir, PATH_SEP, vdede->ent->d_name);
|
||||
struct stat sb;
|
||||
|
|
Loading…
Reference in New Issue