giflib6.patch 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. --- a/src/libimage/gif.c
  2. +++ b/src/libimage/gif.c
  3. @@ -20,6 +20,7 @@
  4. #include <stdio.h>
  5. #include <stdlib.h>
  6. +#include <stdbool.h>
  7. #include <string.h>
  8. #include <gif_lib.h>
  9. @@ -179,7 +180,11 @@
  10. }
  11. }
  12. +#if GIFLIB_MAJOR >= 5
  13. + if (DGifCloseFile(GifFile, NULL) == GIF_ERROR) {
  14. +#else
  15. if (DGifCloseFile(GifFile) == GIF_ERROR) {
  16. +#endif
  17. return(0);
  18. }
  19. @@ -240,7 +245,7 @@
  20. * Also non of the parameter are allocated by this routine.
  21. * This function returns GIF_OK if succesfull, GIF_ERROR otherwise.
  22. ******************************************************************************/
  23. -static int
  24. +int
  25. QuantizeBuffer(unsigned int Width,
  26. unsigned int Height,
  27. int *ColorMapSize,
  28. @@ -493,7 +498,11 @@
  29. static void QuitGifError(GifFileType *GifFile)
  30. {
  31. fprintf(stderr, "Error writing GIF file\n");
  32. +#if GIFLIB_MAJOR >= 5
  33. + if (GifFile != NULL) EGifCloseFile(GifFile, NULL);
  34. +#else
  35. if (GifFile != NULL) EGifCloseFile(GifFile);
  36. +#endif
  37. }
  38. int
  39. @@ -589,7 +598,11 @@
  40. Ptr += width;
  41. }
  42. +#if GIFLIB_MAJOR >= 5
  43. + if (EGifCloseFile(GifFile, NULL) == GIF_ERROR)
  44. +#else
  45. if (EGifCloseFile(GifFile) == GIF_ERROR)
  46. +#endif
  47. {
  48. QuitGifError(GifFile);