freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[freetype2] master f0f00f7: * builds/windows/ftsystem.c (FT_Stream_Open)


From: Werner Lemberg
Subject: [freetype2] master f0f00f7: * builds/windows/ftsystem.c (FT_Stream_Open): Support legacy Windows.
Date: Thu, 19 Aug 2021 22:17:10 -0400 (EDT)

branch: master
commit f0f00f7c1648daa9b75e7ea97b9f84b78d8a6d9c
Author: Carlo Bramini <carlo.bramix@libero.it>
Commit: Alexei Podtelezhnikov <apodtele@gmail.com>

    * builds/windows/ftsystem.c (FT_Stream_Open): Support legacy Windows.
---
 builds/windows/ftsystem.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/builds/windows/ftsystem.c b/builds/windows/ftsystem.c
index ac1d2e7..65c37aa 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 ));



reply via email to

[Prev in Thread] Current Thread [Next in Thread]