summaryrefslogtreecommitdiff
path: root/libre/kdenetwork-kopete-libre/giflib5.patch
blob: 231aefbc2181f682a057e971dfb6987c9977dce4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
From: Raymond Wooninck <tittiatcoke@gmail.com>
Date: Sun, 17 Mar 2013 12:24:09 +0000
Subject: Enable building with giflib v5
X-Git-Tag: v4.10.80
X-Git-Url: http://quickgit.kde.org/?p=kopete.git&a=commitdiff&h=47ceec53aa5ee6b84a753fdbf735e44558513fe2
---
Enable building with giflib v5

REVIEW: 7066

svn path=/trunk/KDE/kdenetwork/kopete/; revision=1344846
---


--- a/protocols/wlm/wlmchatsession.cpp
+++ b/protocols/wlm/wlmchatsession.cpp
@@ -65,6 +65,10 @@
 #include "wlmchatsessioninkaction.h"
 #ifdef HAVE_GIFLIB
 #include <gif_lib.h>
+/* old giflib has no GIFLIB_MAJOR, define to avoid cpp warnings */
+#ifndef GIFLIB_MAJOR
+#define GIFLIB_MAJOR 4
+#endif
 #endif
 
 WlmChatSession::WlmChatSession (Kopete::Protocol * protocol,
@@ -467,11 +471,15 @@
 {
 #ifdef HAVE_GIFLIB
 #ifdef HAVE_GIF_ERROR_STRING // giflib 4.2.0+
+#if GIFLIB_MAJOR >= 5
+        fprintf(stderr, "GIF-LIB error (exact reporting not implemented)\n");
+#else
         const char * errorString = GifErrorString();
         if (errorString)
             fprintf(stderr, "GIF-LIB error: %s\n", errorString);
         else
             fprintf(stderr, "GIF-LIB undefined error: %d\n", GifError());
+#endif
 #else // older giflib versions, libungif
         PrintGifError();
 #endif // HAVE_GIF_ERROR_STRING
@@ -483,6 +491,10 @@
 WlmChatSession::convertToGif( const QPixmap & ink, QString filename)
 {
 #ifdef HAVE_GIFLIB
+#if GIFLIB_MAJOR >= 5
+#define FreeMapObject  GifFreeMapObject
+#define MakeMapObject  GifMakeMapObject
+#endif
     int i, status;
     GifFileType *GifFile;
     ColorMapObject *screenColourmap;
@@ -525,7 +537,11 @@
         }
     }
 
+#if GIFLIB_MAJOR >= 5
+    GifFile= EGifOpenFileName(QFile::encodeName(filename).constData(), 0, NULL);
+#else
     GifFile= EGifOpenFileName(QFile::encodeName(filename).constData(), 0);
+#endif
     if (!GifFile) {
         FreeMapObject(imageColourmap);
         FreeMapObject(screenColourmap);