* builds/windows/ftsystem.c (FT_Stream_Open): Support legacy Windows.

This commit is contained in:
Carlo Bramini 2021-08-19 22:14:42 -04:00 committed by Alexei Podtelezhnikov
parent ffdac8d67e
commit f0f00f7c16
1 changed files with 8 additions and 0 deletions

View File

@ -226,7 +226,15 @@
return FT_THROW( Cannot_Open_Resource );
}
#if defined _WIN32_WCE || defined _WIN32_WINDOWS || \
(defined _WIN32_WINNT && _WIN32_WINNT <= 0x0400)
/* Use GetFileSize() for legacy Windows */
size.u.LowPart = GetFileSize( file, (DWORD *)&size.u.HighPart );
if ( size.u.LowPart == INVALID_FILE_SIZE && GetLastError() != NO_ERROR )
#else
/* Use GetFileSizeEx() for modern Windows */
if ( GetFileSizeEx( file, &size ) == FALSE )
#endif
{
FT_ERROR(( "FT_Stream_Open:" ));
FT_ERROR(( " could not retrieve size of file `%s'\n", filepathname ));