bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#7908: png-1.5 fix for emacs-23.2 and HEAD


From: Thomas Klausner
Subject: bug#7908: png-1.5 fix for emacs-23.2 and HEAD
Date: Mon, 24 Jan 2011 22:59:40 +0100

On Mon, Jan 24, 2011 at 07:43:41PM +0200, Eli Zaretskii wrote:
> > Date: Mon, 24 Jan 2011 13:54:37 +0100
> > From: Thomas Klausner <tk@giga.or.at>
> > Cc: 
> > 
> > emacs-23.2 and git master from a few minutes don't compile against the
> > rather new png-1.5, which is hiding internal structure members.
> 
> "Doesn't compile" is a bit of exaggeration, I think: the members are
> declared with `__attribute__((deprecated))', which produces warning
> messages.

That was true with png-1.4, but with png-1.5, it's incorrect.
emacs-23.2 compilation output with png-1.5 and without the patch:
image.c: In function 'my_png_error':
image.c:5651: error: dereferencing pointer to incomplete type
image.c: In function 'png_load':
image.c:5827: error: dereferencing pointer to incomplete type

> > The attached patch fixes the problem. Please include it.
> 
> Thanks, but this patch won't work with dynamic link against libpng, at
> least not on MS-Windows, because the expansion of png_jmpbuf, viz.:
> 
>   #  define png_jmpbuf(png_ptr) \
>      (*png_set_longjmp_fn((png_ptr), longjmp, sizeof (jmp_buf)))
> 
> causes link errors, since png_set_longjmp_fn is not available (a NULL
> pointer) until the DLL is loaded.

Ok, then you'll probably need something like
...
DEF_IMGLIB_FN (png_set_longjmp_fn);
...
LOAD_IMGLIB_FN (library, png_set_longjmp_fn);
...
#define fn_png_set_longjmp_fn   png_set_longjmp_fn
...
setjmp(*png_set_longjmp_fn(png_ptr, longjmp, sizeof(jmp_buf)));
...

and similarly for png_longjmp. Completely untested, just guessed,
since I haven't tried compiling emacs on MS-Windows before.

Hope this helps,
  Thomas





reply via email to

[Prev in Thread] Current Thread [Next in Thread]