mirror of
https://github.com/dhewm/dhewm3.git
synced 2024-11-26 22:31:17 +00:00
Win32: Don't access FILE::_file, use _fileno() instead
It has always been ugly to do that with and MSVC2015 doesn't seem to work at all.
This commit is contained in:
parent
c86e394da5
commit
9958e3807c
1 changed files with 2 additions and 2 deletions
|
@ -3368,7 +3368,7 @@ size_t idFileSystemLocal::CurlWriteFunction( void *ptr, size_t size, size_t nmem
|
|||
return size * nmemb;
|
||||
}
|
||||
#ifdef _WIN32
|
||||
return _write( static_cast<idFile_Permanent*>(bgl->f)->GetFilePtr()->_file, ptr, size * nmemb );
|
||||
return _write( _fileno(static_cast<idFile_Permanent*>(bgl->f)->GetFilePtr()), ptr, size * nmemb );
|
||||
#else
|
||||
return fwrite( ptr, size, nmemb, static_cast<idFile_Permanent*>(bgl->f)->GetFilePtr() );
|
||||
#endif
|
||||
|
@ -3416,7 +3416,7 @@ int BackgroundDownloadThread( void *pexit ) {
|
|||
if ( bgl->opcode == DLTYPE_FILE ) {
|
||||
// use the low level read function, because fread may allocate memory
|
||||
#if defined(WIN32)
|
||||
_read( static_cast<idFile_Permanent*>(bgl->f)->GetFilePtr()->_file, bgl->file.buffer, bgl->file.length );
|
||||
_read( _fileno(static_cast<idFile_Permanent*>(bgl->f)->GetFilePtr()), bgl->file.buffer, bgl->file.length );
|
||||
#else
|
||||
fread( bgl->file.buffer, bgl->file.length, 1, static_cast<idFile_Permanent*>(bgl->f)->GetFilePtr() );
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue