diff options
author | Carlo Bramini <carlo.bramix@libero.it> | 2021-08-19 22:14:42 -0400 |
---|---|---|
committer | Alexei Podtelezhnikov <apodtele@gmail.com> | 2021-08-19 22:14:42 -0400 |
commit | f0f00f7c1648daa9b75e7ea97b9f84b78d8a6d9c (patch) | |
tree | f4ac04efe3463bcfb1b2a33fc884e131bcfebf48 /builds | |
parent | ffdac8d67e21452b3c076857a707c9b0618e9e0a (diff) | |
download | freetype2-f0f00f7c1648daa9b75e7ea97b9f84b78d8a6d9c.tar.gz |
* builds/windows/ftsystem.c (FT_Stream_Open): Support legacy Windows.
Diffstat (limited to 'builds')
-rw-r--r-- | builds/windows/ftsystem.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/builds/windows/ftsystem.c b/builds/windows/ftsystem.c index ac1d2e78c..65c37aa61 100644 --- a/builds/windows/ftsystem.c +++ b/builds/windows/ftsystem.c @@ -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 )); |