diff --git a/configure.ac b/configure.ac index eafc97d..dd1edb7 100644 --- a/configure.ac +++ b/configure.ac @@ -278,6 +278,7 @@ if test "${enable_imlib2}" != "no"; then if test "${IMLIB2}" = no; then AC_MSG_ERROR([[cannot find Imlib2 development files. Without Imlib2, cacaview will only open BMP files; if this is really what you want, re-run configure with '--disable-imlib2'.]]) fi + AC_DEFINE(USE_IMLIB2, 1, Define to 1 to use Imlib2) fi # Build development tools? diff --git a/src/cacaview.c b/src/cacaview.c index d0ed2fe..bd50139 100644 --- a/src/cacaview.c +++ b/src/cacaview.c @@ -334,7 +334,7 @@ int main(int argc, char **argv) } else if(!im) { -#if defined(HAVE_IMLIB2_H) +#if defined(USE_IMLIB2) # define ERROR_STRING " Error loading `%s'. " #else # define ERROR_STRING " Error loading `%s'. Only BMP is supported. " diff --git a/src/common-image.c b/src/common-image.c index 7ccd077..e38fea2 100644 --- a/src/common-image.c +++ b/src/common-image.c @@ -20,7 +20,7 @@ # include #endif -#if defined(HAVE_IMLIB2_H) +#if defined(USE_IMLIB2) # include #else # if !defined(__KERNEL__) @@ -31,7 +31,7 @@ #include "cucul.h" #include "common-image.h" -#if !defined(HAVE_IMLIB2_H) +#if !defined(USE_IMLIB2) static unsigned int u32fread(FILE *); static unsigned int u16fread(FILE *); static unsigned int u8fread(FILE *); @@ -42,7 +42,7 @@ struct image * load_image(char const * name) struct image * im = malloc(sizeof(struct image)); unsigned int depth, bpp, rmask, gmask, bmask, amask; -#if defined(HAVE_IMLIB2_H) +#if defined(USE_IMLIB2) Imlib_Image image; /* Load the new image */ @@ -264,7 +264,7 @@ struct image * load_image(char const * name) void unload_image(struct image * im) { -#if defined(HAVE_IMLIB2_H) +#if defined(USE_IMLIB2) /* Imlib_Image image = (Imlib_Image)im->priv; */ imlib_free_image(); #else @@ -273,7 +273,7 @@ void unload_image(struct image * im) cucul_free_dither(im->dither); } -#if !defined(HAVE_IMLIB2_H) +#if !defined(USE_IMLIB2) static unsigned int u32fread(FILE *fp) { unsigned char buffer[4];