From e8a58f7c7596393898eb084c4c9d8a4f6ebac684 Mon Sep 17 00:00:00 2001 From: Akita Noek Date: Fri, 2 Aug 2013 14:05:44 -0400 Subject: [PATCH 1/2] Added #include to PNG.h for inlined memcpy usage --- src/PNG.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/PNG.h b/src/PNG.h index 81ad160..cecaacf 100644 --- a/src/PNG.h +++ b/src/PNG.h @@ -4,6 +4,7 @@ #include #include #include +#include #include "closure.h" #if defined(__GNUC__) && (__GNUC__ > 2) && defined(__OPTIMIZE__) From a0632275c53d0ed4811a96fb7bf12ebd5668f289 Mon Sep 17 00:00:00 2001 From: Akita Noek Date: Sat, 3 Aug 2013 17:54:55 -0400 Subject: [PATCH 2/2] Fixed build error with giflib 5.0 Newer giflib versions have a new ErrorCode parameter in several functions, DGifOpen being one of them. --- src/Image.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Image.cc b/src/Image.cc index 5cc43f4..72c5df5 100644 --- a/src/Image.cc +++ b/src/Image.cc @@ -487,8 +487,14 @@ Image::loadGIFFromBuffer(uint8_t *buf, unsigned len) { gif_data_t gifd = { buf, len, 0 }; +#if GIFLIB_MAJOR >= 5 + int errorcode; + if ((gif = DGifOpen((void*) &gifd, read_gif_from_memory, &errorcode)) == NULL) + return CAIRO_STATUS_READ_ERROR; +#else if ((gif = DGifOpen((void*) &gifd, read_gif_from_memory)) == NULL) return CAIRO_STATUS_READ_ERROR; +#endif if (GIF_OK != DGifSlurp(gif)) { DGifCloseFile(gif);