summarylogtreecommitdiffstats
path: root/0001-Merge-pull-request-28016-from-heitbaum-giflib.patch
blob: 3361e818c50294e5de40a70c267f3428484673e5 (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 0b8a4b3037a6d4baeb6875f0192102ec8098c1ef Mon Sep 17 00:00:00 2001
From: fuzzard <fuzzard@users.noreply.github.com>
Date: Tue, 17 Mar 2026 19:52:15 +1000
Subject: [PATCH] Merge pull request #28016 from heitbaum/giflib

TexturePacker: allow build with giflib 6.x
---
 .../native/TexturePacker/src/decoder/GifHelper.cpp        | 8 ++++----
 .../depends/native/TexturePacker/src/decoder/GifHelper.h  | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/depends/native/TexturePacker/src/decoder/GifHelper.cpp b/tools/depends/native/TexturePacker/src/decoder/GifHelper.cpp
index eb513134b3eb..b216ecbcef7f 100644
--- a/tools/depends/native/TexturePacker/src/decoder/GifHelper.cpp
+++ b/tools/depends/native/TexturePacker/src/decoder/GifHelper.cpp
@@ -52,7 +52,7 @@ GifHelper::~GifHelper()
 bool GifHelper::Open(GifFileType*& gif, void *dataPtr, InputFunc readFunc)
 {
   int err = 0;
-#if GIFLIB_MAJOR == 5
+#if GIFLIB_MAJOR >= 5
   gif = DGifOpen(dataPtr, readFunc, &err);
 #else
   gif = DGifOpen(dataPtr, readFunc);
@@ -73,7 +73,7 @@ void GifHelper::Close(GifFileType* gif)
 {
   int err = 0;
   int reason = 0;
-#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1
+#if (GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1) || GIFLIB_MAJOR >= 6
   err = DGifCloseFile(gif, &reason);
 #else
   err = DGifCloseFile(gif);
@@ -181,7 +181,7 @@ bool GifHelper::Slurp(GifFileType* gif)
   if (DGifSlurp(gif) == GIF_ERROR)
   {
     int reason = 0;
-#if GIFLIB_MAJOR == 5
+#if GIFLIB_MAJOR >= 5
     reason = gif->Error;
 #else
     reason = GifLastError();
@@ -246,7 +246,7 @@ bool GifHelper::GcbToFrame(GifFrame &frame, unsigned int imgIdx)
 
   if (m_gif->ImageCount > 0)
   {
-#if GIFLIB_MAJOR == 5
+#if GIFLIB_MAJOR >= 5
     GraphicsControlBlock gcb;
     if (DGifSavedExtensionToGCB(m_gif, imgIdx, &gcb))
     {
diff --git a/tools/depends/native/TexturePacker/src/decoder/GifHelper.h b/tools/depends/native/TexturePacker/src/decoder/GifHelper.h
index 6124b69e4629..ce5dca3394b4 100644
--- a/tools/depends/native/TexturePacker/src/decoder/GifHelper.h
+++ b/tools/depends/native/TexturePacker/src/decoder/GifHelper.h
@@ -128,7 +128,7 @@ private:
   bool PrepareTemplate(GifFrame &frame);
   void Release();
 
-#if GIFLIB_MAJOR != 5
+#if GIFLIB_MAJOR < 5
   /*
   taken from giflib 5.1.0
   */
-- 
2.53.0