Alexei Podtelezhnikov pushed to branch master at FreeType / FreeType
Commits:
-
f0f00f7c
by Carlo Bramini at 2021-08-19T22:14:42-04:00
1 changed file:
Changes:
... | ... | @@ -226,7 +226,15 @@ |
226 | 226 |
return FT_THROW( Cannot_Open_Resource );
|
227 | 227 |
}
|
228 | 228 |
|
229 |
+#if defined _WIN32_WCE || defined _WIN32_WINDOWS || \
|
|
230 |
+ (defined _WIN32_WINNT && _WIN32_WINNT <= 0x0400)
|
|
231 |
+ /* Use GetFileSize() for legacy Windows */
|
|
232 |
+ size.u.LowPart = GetFileSize( file, (DWORD *)&size.u.HighPart );
|
|
233 |
+ if ( size.u.LowPart == INVALID_FILE_SIZE && GetLastError() != NO_ERROR )
|
|
234 |
+#else
|
|
235 |
+ /* Use GetFileSizeEx() for modern Windows */
|
|
229 | 236 |
if ( GetFileSizeEx( file, &size ) == FALSE )
|
237 |
+#endif
|
|
230 | 238 |
{
|
231 | 239 |
FT_ERROR(( "FT_Stream_Open:" ));
|
232 | 240 |
FT_ERROR(( " could not retrieve size of file `%s'\n", filepathname ));
|