From 9595f2901074be92075a3ee18e66fc9c13ad6e74 Mon Sep 17 00:00:00 2001 From: Pascal Massimino Date: Thu, 22 Sep 2016 13:43:36 +0200 Subject: [PATCH] fix anim_util.c compilation when HAVE_GIF is not defined. Change-Id: I1a4f13a5799c020fb4b3ade3c7336f049443ab62 (cherry picked from commit 1effde7bcd401ceef77d506c21c66ff7522b4e90) --- examples/anim_util.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/examples/anim_util.c b/examples/anim_util.c index 73fc7b97..5c593df3 100644 --- a/examples/anim_util.c +++ b/examples/anim_util.c @@ -265,6 +265,8 @@ static int ReadAnimatedWebP(const char filename[], // ----------------------------------------------------------------------------- // GIF Decoding. +#ifdef WEBP_HAVE_GIF + // Returns true if this is a valid GIF bitstream. static int IsGIF(const WebPData* const data) { return data->size > GIF_STAMP_LEN && @@ -273,8 +275,6 @@ static int IsGIF(const WebPData* const data) { !memcmp(GIF89_STAMP, data->bytes, GIF_STAMP_LEN)); } -#ifdef WEBP_HAVE_GIF - // GIFLIB_MAJOR is only defined in libgif >= 4.2.0. #if defined(GIFLIB_MAJOR) && defined(GIFLIB_MINOR) # define LOCAL_GIF_VERSION ((GIFLIB_MAJOR << 8) | GIFLIB_MINOR) @@ -665,6 +665,11 @@ static int ReadAnimatedGIF(const char filename[], AnimatedImage* const image, #else +static int IsGIF(const WebPData* const data) { + (void)data; + return 0; +} + static int ReadAnimatedGIF(const char filename[], AnimatedImage* const image, int dump_frames, const char dump_folder[]) { (void)filename;