Skip to content

fix Universal Windows build

Steve Lhomme requested to merge robUx41/freetype:vlc4-1 into master

CreateFileA, CreateFileW CreateFileMapping and MapViewOfFile don't exist in Universal builds. See [1] for the list of allowed file API's and [2] for mapping API's.

  • use the WinCE local version of CreateFileA and map CreateFileW to CreateFile2
  • use CreateFileMappingFromApp instead of CreateFileMapping
  • use MapViewOfFileFromApp instead of MapViewOfFile

It is therefore possible to load fonts in Universal Windows builds but only for the application package, not the system.

The API's are available in Universal Builds starting with Win10 1903 (18362). So we only need to disable the calls when compiling for Universal apps targeting older versions of Windows.

[1] https://docs.microsoft.com/en-us/uwp/win32-and-com/win32-apis#apis-from-api-ms-win-core-file-l1-2-1dll [2] https://docs.microsoft.com/en-us/uwp/win32-and-com/win32-apis#apis-from-api-ms-win-core-memory-l1-1-2dll

Signed-off-by: Steve Lhomme robux4@ycbcr.xyz

Edited by Steve Lhomme

Merge request reports