Ghostscript-9.53.3_fix-freetype-callback.patch 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. fix compilation error when building Ghostscript 9.53.3 on top of freetype 2.10.3:
  2. error: expected declaration specifiers before FF_alloc
  3. see also https://bugs.ghostscript.com/show_bug.cgi?id=702985
  4. From 41ef9a0bc36b9db7115fbe9623f989bfb47bbade Mon Sep 17 00:00:00 2001
  5. From: Chris Liddell <chris.liddell@artifex.com>
  6. Date: Tue, 20 Oct 2020 09:49:45 +0100
  7. Subject: [PATCH] Bug 702985: drop use of FT_CALLBACK_DEF() def
  8. From 2.10.3, Freetype disappeared the FT_CALLBACK_DEF() macro, which is what
  9. we used when defining our callbacks from Freetype.
  10. No guidance forthcoming from the Freetype developer who made those changes,
  11. so change to explicitly declaring the callbacks file static.
  12. Should fix the reported build failures.
  13. ---
  14. base/fapi_ft.c | 6 +++---
  15. 1 file changed, 3 insertions(+), 3 deletions(-)
  16. diff --git a/base/fapi_ft.c b/base/fapi_ft.c
  17. index 65fa6dcf4..21aef2f06 100644
  18. --- a/base/fapi_ft.c
  19. +++ b/base/fapi_ft.c
  20. @@ -125,7 +125,7 @@ static void
  21. delete_inc_int_info(gs_fapi_server * a_server,
  22. FT_IncrementalRec * a_inc_int_info);
  23. -FT_CALLBACK_DEF(void *)
  24. +static void *
  25. FF_alloc(FT_Memory memory, long size)
  26. {
  27. gs_memory_t *mem = (gs_memory_t *) memory->user;
  28. @@ -133,7 +133,7 @@ FF_alloc(FT_Memory memory, long size)
  29. return (gs_malloc(mem, size, 1, "FF_alloc"));
  30. }
  31. -FT_CALLBACK_DEF(void *)
  32. +static void *
  33. FF_realloc(FT_Memory memory, long cur_size, long new_size, void *block)
  34. {
  35. gs_memory_t *mem = (gs_memory_t *) memory->user;
  36. @@ -153,7 +153,7 @@ FT_CALLBACK_DEF(void *)
  37. return (tmp);
  38. }
  39. -FT_CALLBACK_DEF(void)
  40. +static void
  41. FF_free(FT_Memory memory, void *block)
  42. {
  43. gs_memory_t *mem = (gs_memory_t *) memory->user;
  44. --
  45. 2.17.1