0003-Fix-UWP.patch 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. diff --git a/CMakeLists.txt b/CMakeLists.txt
  2. index db48e9f..5c35276 100644
  3. --- a/CMakeLists.txt
  4. +++ b/CMakeLists.txt
  5. @@ -328,6 +328,10 @@ else ()
  6. list(APPEND BASE_SRCS src/base/ftdebug.c)
  7. endif ()
  8. +if(MSVC)
  9. + add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS)
  10. +endif()
  11. +
  12. if (BUILD_FRAMEWORK)
  13. list(APPEND BASE_SRCS builds/mac/freetype-Info.plist)
  14. endif ()
  15. diff --git a/include/freetype/freetype.h b/include/freetype/freetype.h
  16. index 4f2eaca..1e01fe4 100644
  17. --- a/include/freetype/freetype.h
  18. +++ b/include/freetype/freetype.h
  19. @@ -1038,6 +1038,11 @@ FT_BEGIN_HEADER
  20. * Especially for TrueType fonts see also the documentation for
  21. * @FT_Size_Metrics.
  22. */
  23. +
  24. +#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP)
  25. +#define generic GenericFromFreeTypeLibrary
  26. +#endif
  27. +
  28. typedef struct FT_FaceRec_
  29. {
  30. FT_Long num_faces;
  31. @@ -1910,6 +1915,9 @@ FT_BEGIN_HEADER
  32. } FT_GlyphSlotRec;
  33. +#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP)
  34. +#undef generic
  35. +#endif
  36. /*************************************************************************/
  37. /*************************************************************************/
  38. diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
  39. index 3f8619d..edf03b6 100644
  40. --- a/src/base/ftobjs.c
  41. +++ b/src/base/ftobjs.c
  42. @@ -528,6 +528,9 @@
  43. return error;
  44. }
  45. +#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP)
  46. +#define generic GenericFromFreeTypeLibrary
  47. +#endif
  48. static void
  49. ft_glyphslot_clear( FT_GlyphSlot slot )
  50. @@ -1195,6 +1198,9 @@
  51. FT_FREE( face );
  52. }
  53. +#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP)
  54. +#undef generic
  55. +#endif
  56. static void
  57. Destroy_Driver( FT_Driver driver )