* libpng 1.4.x
@ 2010-01-24 22:25 Herbert J. Skuhra
2010-01-24 23:06 ` Chong Yidong
0 siblings, 1 reply; 2+ messages in thread
From: Herbert J. Skuhra @ 2010-01-24 22:25 UTC (permalink / raw)
To: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 439 bytes --]
Hi!
I am running Arch Linux with testing repositories enabled.
Recently libpng was updated to 1.4.0 and now Emacs no longer builds.
There is a patch availabe (by Eric Bélanger):
http://repos.archlinux.org/wsvn/packages/emacs/trunk/libpng14.patch
I slightly modified the patch so that it only applies to libpng-1.4.x,
although it seems that it also works for libpng-1.2.x.
Is there a better fix?
Thanks.
-Herbert
[-- Attachment #2: emacs_src_image_c.diff --]
[-- Type: application/octet-stream, Size: 1820 bytes --]
--- src/image.c.orig 2010-01-24 21:50:22.802800276 +0100
+++ src/image.c 2010-01-24 23:07:24.265671586 +0100
@@ -5559,7 +5559,11 @@
/* PNG library details. */
DEF_IMGLIB_FN (png_get_io_ptr);
+#if PNG_LIBPNG_VER >= 10400
+DEF_IMGLIB_FN (png_sig_cmp);
+#else
DEF_IMGLIB_FN (png_check_sig);
+#endif
DEF_IMGLIB_FN (png_create_read_struct);
DEF_IMGLIB_FN (png_create_info_struct);
DEF_IMGLIB_FN (png_destroy_read_struct);
@@ -5590,7 +5594,11 @@
return 0;
LOAD_IMGLIB_FN (library, png_get_io_ptr);
+#if PNG_LIBPNG_VER >= 10400
+ LOAD_IMGLIB_FN (library, png_sig_cmp);
+#else
LOAD_IMGLIB_FN (library, png_check_sig);
+#endif
LOAD_IMGLIB_FN (library, png_create_read_struct);
LOAD_IMGLIB_FN (library, png_create_info_struct);
LOAD_IMGLIB_FN (library, png_destroy_read_struct);
@@ -5615,7 +5623,11 @@
#else
#define fn_png_get_io_ptr png_get_io_ptr
+#if PNG_LIBPNG_VER >= 10400
+#define fn_png_sig_cmp png_sig_cmp
+#else
#define fn_png_check_sig png_check_sig
+#endif
#define fn_png_create_read_struct png_create_read_struct
#define fn_png_create_info_struct png_create_info_struct
#define fn_png_destroy_read_struct png_destroy_read_struct
@@ -5762,7 +5774,11 @@
/* Check PNG signature. */
if (fread (sig, 1, sizeof sig, fp) != sizeof sig
+#if PNG_LIBPNG_VER >= 10400
+ || fn_png_sig_cmp (sig, 0, sizeof sig))
+#else
|| !fn_png_check_sig (sig, sizeof sig))
+#endif
{
image_error ("Not a PNG file: `%s'", file, Qnil);
UNGCPRO;
@@ -5779,7 +5795,11 @@
/* Check PNG signature. */
if (tbr.len < sizeof sig
+#if PNG_LIBPNG_VER >= 10400
+ || fn_png_sig_cmp (tbr.bytes, 0, sizeof sig))
+#else
|| !fn_png_check_sig (tbr.bytes, sizeof sig))
+#endif
{
image_error ("Not a PNG image: `%s'", img->spec, Qnil);
UNGCPRO;
[-- Attachment #3: Type: text/plain, Size: 1 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: libpng 1.4.x
2010-01-24 22:25 libpng 1.4.x Herbert J. Skuhra
@ 2010-01-24 23:06 ` Chong Yidong
0 siblings, 0 replies; 2+ messages in thread
From: Chong Yidong @ 2010-01-24 23:06 UTC (permalink / raw)
To: Herbert J. Skuhra; +Cc: emacs-devel
"Herbert J. Skuhra" <h.skuhra@gmail.com> writes:
> I am running Arch Linux with testing repositories enabled.
> Recently libpng was updated to 1.4.0 and now Emacs no longer builds.
>
> There is a patch availabe (by Eric Bélanger):
>
> http://repos.archlinux.org/wsvn/packages/emacs/trunk/libpng14.patch
>
> I slightly modified the patch so that it only applies to libpng-1.4.x,
> although it seems that it also works for libpng-1.2.x.
>
> Is there a better fix?
No, the fix looks correct, and I've checked it in. Thanks for pointing
it out.
(To be absolutely safe, we could check for the availability of
png_sig_cmp in our configure script, but I don't think it's worthwhile
for us to clean up after the libpng developers.)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-01-24 23:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-24 22:25 libpng 1.4.x Herbert J. Skuhra
2010-01-24 23:06 ` Chong Yidong
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.