freetype-commit
[Top][All Lists]
Advanced

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

[Git][freetype/freetype][master] [builds/windows] Try both wide and narr


From: Alexei Podtelezhnikov (@apodtele)
Subject: [Git][freetype/freetype][master] [builds/windows] Try both wide and narrow `CreateFile`
Date: Fri, 17 Sep 2021 12:34:05 +0000

Alexei Podtelezhnikov pushed to branch master at FreeType / FreeType

Commits:

1 changed file:

Changes:

  • builds/windows/ftsystem.c
    ... ... @@ -215,9 +215,21 @@
    215 215
                            NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0 );
    
    216 216
         if ( file == INVALID_HANDLE_VALUE )
    
    217 217
         {
    
    218
    -      FT_ERROR(( "FT_Stream_Open:" ));
    
    219
    -      FT_ERROR(( " could not open `%s'\n", filepathname ));
    
    220
    -      return FT_THROW( Cannot_Open_Resource );
    
    218
    +      /* fall back on the alernative interface */
    
    219
    +#ifdef UNICODE
    
    220
    +      file = CreateFileA( (LPCSTR)filepathname, GENERIC_READ, FILE_SHARE_READ,
    
    221
    +                          NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0 );
    
    222
    +#else
    
    223
    +      file = CreateFileW( (LPCWSTR)filepathname, GENERIC_READ, FILE_SHARE_READ,
    
    224
    +                          NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0 );
    
    225
    +#endif
    
    226
    +
    
    227
    +      if ( file == INVALID_HANDLE_VALUE )
    
    228
    +      {
    
    229
    +        FT_ERROR(( "FT_Stream_Open:" ));
    
    230
    +        FT_ERROR(( " could not open `%s'\n", filepathname ));
    
    231
    +        return FT_THROW( Cannot_Open_Resource );
    
    232
    +      }
    
    221 233
         }
    
    222 234
     
    
    223 235
     #if defined _WIN32_WCE || defined _WIN32_WINDOWS || \
    


  • reply via email to

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