summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2013-10-10 12:15:33 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2013-10-10 12:15:33 -0700
commit991496253a519d728a1041c157b37182a829d156 (patch)
tree6b4550dfe074a49472789e7d7d821f4ccdf6f08b
parenta5dab1594a1bbd76ad7fe016268bb91007e5be39 (diff)
downloademacs-991496253a519d728a1041c157b37182a829d156.tar.gz
* image.c: Pacify --enable-gcc-warnings.
(GIFLIB_MAJOR, GIFLIB_MINOR, GIFLIB_RELEASE, fn_GifErrorString): #define only if used.
-rw-r--r--src/ChangeLog6
-rw-r--r--src/image.c29
2 files changed, 23 insertions, 12 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 40926622090..e650c1e7d4d 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
+2013-10-10 Paul Eggert <eggert@cs.ucla.edu>
+
+ * image.c: Pacify --enable-gcc-warnings.
+ (GIFLIB_MAJOR, GIFLIB_MINOR, GIFLIB_RELEASE, fn_GifErrorString):
+ #define only if used.
+
2013-10-10 Eli Zaretskii <eliz@gnu.org>
* image.c (GIFLIB_MAJOR): Define to 4 if undefined.
diff --git a/src/image.c b/src/image.c
index 86da6116533..86780c62a0b 100644
--- a/src/image.c
+++ b/src/image.c
@@ -7203,7 +7203,21 @@ gif_image_p (Lisp_Object object)
#ifdef HAVE_GIF
+/* Giflib before 5.0 didn't define these macros. */
+#ifndef GIFLIB_MAJOR
+#define GIFLIB_MAJOR 4
+#endif
+
#if defined (HAVE_NTGUI)
+
+/* Giflib before 5.0 didn't define these macros (used only if HAVE_NTGUI). */
+#ifndef GIFLIB_MINOR
+#define GIFLIB_MINOR 0
+#endif
+#ifndef GIFLIB_RELEASE
+#define GIFLIB_RELEASE 0
+#endif
+
/* winuser.h might define DrawText to DrawTextA or DrawTextW.
Undefine before redefining to avoid a preprocessor warning. */
#ifdef DrawText
@@ -7220,17 +7234,6 @@ gif_image_p (Lisp_Object object)
#endif /* HAVE_NTGUI */
-/* Giflib before 5.0 didn't define these macros. */
-#ifndef GIFLIB_MAJOR
-#define GIFLIB_MAJOR 4
-#endif
-#ifndef GIFLIB_MINOR
-#define GIFLIB_MINOR 0
-#endif
-#ifndef GIFLIB_RELEASE
-#define GIFLIB_RELEASE 0
-#endif
-
#ifdef WINDOWSNT
/* GIF library details. */
@@ -7269,7 +7272,9 @@ init_gif_functions (void)
#define fn_DGifSlurp DGifSlurp
#define fn_DGifOpen DGifOpen
#define fn_DGifOpenFileName DGifOpenFileName
-#define fn_GifErrorString GifErrorString
+#if 5 <= GIFLIB_MAJOR
+# define fn_GifErrorString GifErrorString
+#endif
#endif /* WINDOWSNT */