Skip to content

Commit

Permalink
Fix compilation with gif_lib 5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
gogglesguy authored and rouault committed Aug 21, 2015
1 parent f103b42 commit 0101157
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions mapimageio.c
Expand Up @@ -1058,6 +1058,13 @@ int readGIF(char *path, rasterBufferObj *rb)

} while (recordType != TERMINATE_RECORD_TYPE);


#if defined GIFLIB_MAJOR && GIFLIB_MINOR && ((GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1) || (GIFLIB_MAJOR > 5))
if (DGifCloseFile(image, &errcode) == GIF_ERROR) {
msSetError(MS_MISCERR,"failed to close gif after loading: %s","readGIF()", gif_error_msg(errcode));
return MS_FAILURE;
}
#else
if (DGifCloseFile(image) == GIF_ERROR) {
#if defined GIFLIB_MAJOR && GIFLIB_MAJOR >= 5
msSetError(MS_MISCERR,"failed to close gif after loading: %s","readGIF()", gif_error_msg(image->Error));
Expand All @@ -1066,6 +1073,7 @@ int readGIF(char *path, rasterBufferObj *rb)
#endif
return MS_FAILURE;
}
#endif

return MS_SUCCESS;
}
Expand Down

0 comments on commit 0101157

Please sign in to comment.