mirror of
https://git.FreeBSD.org/ports.git
synced 2025-01-09 06:51:44 +00:00
Allow building with giflib 5.1
PR: 204492
This commit is contained in:
parent
17c483a38a
commit
840d46ac0f
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=401341
@ -12,3 +12,73 @@
|
||||
if (!gif)
|
||||
{
|
||||
close(fd);
|
||||
@@ -60,13 +64,21 @@ load(ImlibImage * im, ImlibProgressFunct
|
||||
h = gif->Image.Height;
|
||||
if (!IMAGE_DIMENSIONS_OK(w, h))
|
||||
{
|
||||
+#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5
|
||||
+ DGifCloseFile(gif, NULL);
|
||||
+#else
|
||||
DGifCloseFile(gif);
|
||||
+#endif
|
||||
return 0;
|
||||
}
|
||||
rows = malloc(h * sizeof(GifRowType *));
|
||||
if (!rows)
|
||||
{
|
||||
+#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5
|
||||
+ DGifCloseFile(gif, NULL);
|
||||
+#else
|
||||
DGifCloseFile(gif);
|
||||
+#endif
|
||||
return 0;
|
||||
}
|
||||
for (i = 0; i < h; i++)
|
||||
@@ -78,7 +90,11 @@ load(ImlibImage * im, ImlibProgressFunct
|
||||
rows[i] = malloc(w * sizeof(GifPixelType));
|
||||
if (!rows[i])
|
||||
{
|
||||
+#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5
|
||||
+ DGifCloseFile(gif, NULL);
|
||||
+#else
|
||||
DGifCloseFile(gif);
|
||||
+#endif
|
||||
for (i = 0; i < h; i++)
|
||||
{
|
||||
if (rows[i])
|
||||
@@ -150,7 +166,11 @@ load(ImlibImage * im, ImlibProgressFunct
|
||||
im->data = (DATA32 *) malloc(sizeof(DATA32) * w * h);
|
||||
if (!im->data)
|
||||
{
|
||||
+#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5
|
||||
+ DGifCloseFile(gif, NULL);
|
||||
+#else
|
||||
DGifCloseFile(gif);
|
||||
+#endif
|
||||
free(rows);
|
||||
return 0;
|
||||
}
|
||||
@@ -181,7 +201,11 @@ load(ImlibImage * im, ImlibProgressFunct
|
||||
last_per = (int)per;
|
||||
if (!(progress(im, (int)per, 0, last_y, w, i)))
|
||||
{
|
||||
+#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5
|
||||
+ DGifCloseFile(gif, NULL);
|
||||
+#else
|
||||
DGifCloseFile(gif);
|
||||
+#endif
|
||||
for (i = 0; i < h; i++)
|
||||
{
|
||||
free(rows[i]);
|
||||
@@ -198,7 +222,11 @@ load(ImlibImage * im, ImlibProgressFunct
|
||||
{
|
||||
progress(im, 100, 0, last_y, w, h);
|
||||
}
|
||||
+#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5
|
||||
+ DGifCloseFile(gif, NULL);
|
||||
+#else
|
||||
DGifCloseFile(gif);
|
||||
+#endif
|
||||
for (i = 0; i < h; i++)
|
||||
{
|
||||
free(rows[i]);
|
||||
|
Loading…
Reference in New Issue
Block a user