blob: 85c40ff34dc4b6cfa8c0c12c4a4264ad1a1b2a23 (
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
|
From 96af9ef4f8bd16816834008b73e7b29694136552 Mon Sep 17 00:00:00 2001
From: Raymond Wooninck <tittiatcoke@gmail.com>
Date: Thu, 14 Mar 2013 10:26:45 +0100
Subject: [PATCH] Make kdelibs compile with the latest giflib v5 while
maintaining backwards compatibility
REVIEW: 109478
---
khtml/imload/decoders/gifloader.cpp | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/khtml/imload/decoders/gifloader.cpp b/khtml/imload/decoders/gifloader.cpp
index ebbb749..0c1acf5 100644
--- a/khtml/imload/decoders/gifloader.cpp
+++ b/khtml/imload/decoders/gifloader.cpp
@@ -45,6 +45,11 @@ extern "C" {
#include <gif_lib.h>
}
+/* avoid cpp warning about undefined macro, old giflib had no GIFLIB_MAJOR */
+#ifndef GIFLIB_MAJOR
+#define GIFLIB_MAJOR 4
+#endif
+
// #define DEBUG_GIFLOADER
namespace khtmlImLoad {
@@ -300,7 +305,11 @@ public:
}
+#if GIFLIB_MAJOR >= 5
+ static unsigned int decode16Bit(unsigned char* signedLoc)
+#else
static unsigned int decode16Bit(char* signedLoc)
+#endif
{
unsigned char* loc = reinterpret_cast<unsigned char*>(signedLoc);
@@ -348,7 +357,12 @@ public:
virtual int processEOF()
{
//Feed the buffered data to libUnGif
+#if GIFLIB_MAJOR >= 5
+ int errorCode;
+ GifFileType* file = DGifOpen(this, gifReaderBridge, &errorCode);
+#else
GifFileType* file = DGifOpen(this, gifReaderBridge);
+#endif
if (!file)
return Error;
--
1.8.1.5
|