all repos — mgba @ 386da2accd6a168f4d59b3a011c401f14a3913ff

mGBA Game Boy Advance Emulator

VFS: Add VFile.sync for memory vfs
Jeffrey Pfau jeffrey@endrift.com
Sun, 12 Jul 2015 15:49:04 -0700
commit

386da2accd6a168f4d59b3a011c401f14a3913ff

parent

1b8fe1aa09563444903cd5609dde104222a80ec6

1 files changed, 9 insertions(+), 0 deletions(-)

jump to
M src/util/vfs/vfs-mem.csrc/util/vfs/vfs-mem.c

@@ -20,6 +20,7 @@ static void* _vfmMap(struct VFile* vf, size_t size, int flags);

static void _vfmUnmap(struct VFile* vf, void* memory, size_t size); static void _vfmTruncate(struct VFile* vf, size_t size); static ssize_t _vfmSize(struct VFile* vf); +static bool _vfmSync(struct VFile* vf, const void* buffer, size_t size); struct VFile* VFileFromMemory(void* mem, size_t size) { if (!mem || !size) {

@@ -43,6 +44,7 @@ vfm->d.map = _vfmMap;

vfm->d.unmap = _vfmUnmap; vfm->d.truncate = _vfmTruncate; vfm->d.size = _vfmSize; + vfm->d.sync = _vfmSync; return &vfm->d; }

@@ -137,3 +139,10 @@ ssize_t _vfmSize(struct VFile* vf) {

struct VFileMem* vfm = (struct VFileMem*) vf; return vfm->size; } + +bool _vfmSync(struct VFile* vf, const void* buffer, size_t size) { + UNUSED(vf); + UNUSED(buffer); + UNUSED(size); + return true; +}