mirror of
https://github.com/dhewm/dhewm3.git
synced 2025-02-18 18:21:22 +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;
|
return size * nmemb;
|
||||||
}
|
}
|
||||||
#ifdef _WIN32
|
#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
|
#else
|
||||||
return fwrite( ptr, size, nmemb, static_cast<idFile_Permanent*>(bgl->f)->GetFilePtr() );
|
return fwrite( ptr, size, nmemb, static_cast<idFile_Permanent*>(bgl->f)->GetFilePtr() );
|
||||||
#endif
|
#endif
|
||||||
|
@ -3416,7 +3416,7 @@ int BackgroundDownloadThread( void *pexit ) {
|
||||||
if ( bgl->opcode == DLTYPE_FILE ) {
|
if ( bgl->opcode == DLTYPE_FILE ) {
|
||||||
// use the low level read function, because fread may allocate memory
|
// use the low level read function, because fread may allocate memory
|
||||||
#if defined(WIN32)
|
#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
|
#else
|
||||||
fread( bgl->file.buffer, bgl->file.length, 1, static_cast<idFile_Permanent*>(bgl->f)->GetFilePtr() );
|
fread( bgl->file.buffer, bgl->file.length, 1, static_cast<idFile_Permanent*>(bgl->f)->GetFilePtr() );
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue