| @@ -18,11 +18,14 @@ |
| 18 | 18 | | |
| 19 | 19 | | #define _IMAGE_CONFIG |
| 20 | 20 | | |
| 21 | + | #include <unistd.h> |
| 22 | + | |
| 23 | + | #ifdef HAVE_GIFLIB |
| 21 | 24 | | #include <stdlib.h> |
| 22 | 25 | | #include <string.h> |
| 23 | | − | #include <unistd.h> |
| 24 | 26 | | #include <sys/types.h> |
| 25 | 27 | | #include <gif_lib.h> |
| 28 | + | #endif |
| 26 | 29 | | |
| 27 | 30 | | #include "image.h" |
| 28 | 31 | | #include "options.h" |
| @@ -55,6 +58,7 @@ void img_init(img_t *img, win_t *win) { |
| 55 | 58 | | } |
| 56 | 59 | | } |
| 57 | 60 | | |
| 61 | + | #ifdef HAVE_GIFLIB |
| 58 | 62 | | int img_load_gif(img_t *img, const fileinfo_t *file) { |
| 59 | 63 | | GifFileType *gif; |
| 60 | 64 | | GifRowType *rows = NULL; |
| @@ -208,6 +212,7 @@ int img_load_gif(img_t *img, const fileinfo_t *file) { |
| 208 | 212 | | |
| 209 | 213 | | return !err; |
| 210 | 214 | | } |
| 215 | + | #endif /* HAVE_GIFLIB */ |
| 211 | 216 | | |
| 212 | 217 | | int img_load(img_t *img, const fileinfo_t *file) { |
| 213 | 218 | | const char *fmt; |
| @@ -225,8 +230,13 @@ int img_load(img_t *img, const fileinfo_t *file) { |
| 225 | 230 | | imlib_context_set_anti_alias(img->aa); |
| 226 | 231 | | |
| 227 | 232 | | fmt = imlib_image_format(); |
| 233 | + | #ifdef HAVE_GIFLIB |
| 228 | 234 | | if (!strcmp(fmt, "gif")) |
| 229 | 235 | | img_load_gif(img, file); |
| 236 | + | #else |
| 237 | + | /* avoid unused-but-set-variable warning */ |
| 238 | + | (void) fmt; |
| 239 | + | #endif |
| 230 | 240 | | |
| 231 | 241 | | img->scalemode = options->scalemode; |
| 232 | 242 | | img->re = 0; |