Browse Source

Fixed build error with giflib 5.0

Newer giflib versions have a new ErrorCode parameter in several
functions, DGifOpen being one of them.
v1.x
Akita Noek 11 years ago
parent
commit
a0632275c5
  1. 6
      src/Image.cc

6
src/Image.cc

@ -487,8 +487,14 @@ Image::loadGIFFromBuffer(uint8_t *buf, unsigned len) {
gif_data_t gifd = { buf, len, 0 }; 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) if ((gif = DGifOpen((void*) &gifd, read_gif_from_memory)) == NULL)
return CAIRO_STATUS_READ_ERROR; return CAIRO_STATUS_READ_ERROR;
#endif
if (GIF_OK != DGifSlurp(gif)) { if (GIF_OK != DGifSlurp(gif)) {
DGifCloseFile(gif); DGifCloseFile(gif);

Loading…
Cancel
Save