Fix for 64-bit file pointers big endian machines.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@786
This commit is contained in:
parent
fd1e05cb25
commit
39ac002795
1 changed files with 4 additions and 2 deletions
|
@ -334,17 +334,19 @@ bool localFile::Seek(Bit32u * pos,Bit32u type) {
|
|||
//TODO Give some doserrorcode;
|
||||
return false;//ERROR
|
||||
}
|
||||
fpos_t temppos;
|
||||
int ret=fseek(fhandle,*pos,seektype);
|
||||
if (ret!=0) {
|
||||
// Out of file range, pretend everythings ok
|
||||
// and move file pointer top end of file... ?! (Black Thorne)
|
||||
fseek(fhandle,0,SEEK_END);
|
||||
};
|
||||
#if 0
|
||||
fpos_t temppos;
|
||||
fgetpos(fhandle,&temppos);
|
||||
//TODO Hope we don't encouter files with 64 bits size
|
||||
Bit32u * fake_pos=(Bit32u*)&temppos;
|
||||
*pos=*fake_pos;
|
||||
#endif
|
||||
*pos=(Bit32u)ftell(fhandle);
|
||||
last_action=NONE;
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue