sync emufiles between emus

This commit is contained in:
zeromus 2011-03-20 18:34:08 +00:00
parent cd461e50ba
commit 7526131735
2 changed files with 9 additions and 2 deletions

View File

@ -61,7 +61,7 @@ size_t EMUFILE_MEMORY::_fread(const void *ptr, size_t bytes){
void EMUFILE_FILE::truncate(s32 length) void EMUFILE_FILE::truncate(s32 length)
{ {
fflush(fp); ::fflush(fp);
#ifdef _MSC_VER #ifdef _MSC_VER
_chsize(_fileno(fp),length); _chsize(_fileno(fp),length);
#else #else

View File

@ -113,6 +113,7 @@ public:
virtual int ftell() = 0; virtual int ftell() = 0;
virtual int size() = 0; virtual int size() = 0;
virtual void fflush() = 0;
virtual void truncate(s32 length) = 0; virtual void truncate(s32 length) = 0;
}; };
@ -244,6 +245,8 @@ public:
return pos; return pos;
} }
virtual void fflush() {}
void trim() void trim()
{ {
vec->resize(len); vec->resize(len);
@ -319,7 +322,7 @@ public:
failbit = true; failbit = true;
} }
virtual int fseek(int offset, int origin){ virtual int fseek(int offset, int origin) {
return ::fseek(fp, offset, origin); return ::fseek(fp, offset, origin);
} }
@ -335,6 +338,10 @@ public:
return len; return len;
} }
virtual void fflush() {
::fflush(fp);
}
}; };
#endif #endif