unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Thomas Klausner <tk@giga.or.at>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 7908@debbugs.gnu.org
Subject: bug#7908: png-1.5 fix for emacs-23.2 and HEAD
Date: Mon, 24 Jan 2011 22:59:40 +0100	[thread overview]
Message-ID: <20110124215940.GH16230@danbala.tuwien.ac.at> (raw)
In-Reply-To: <83d3nmyz76.fsf@gnu.org>

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	other threads:[~2011-01-24 21:59 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-24 12:54 bug#7908: png-1.5 fix for emacs-23.2 and HEAD Thomas Klausner
2011-01-24 17:43 ` Eli Zaretskii
2011-01-24 21:59   ` Thomas Klausner [this message]
2011-01-25  3:49     ` Eli Zaretskii
2011-01-25  7:18       ` Thomas Klausner
2011-01-25 10:53         ` Eli Zaretskii
2011-01-25 11:29           ` Thomas Klausner
2011-01-25 20:57       ` Chong Yidong
2011-01-25 21:09         ` Chong Yidong
2011-01-25 21:56         ` Eli Zaretskii
2011-01-25 23:35           ` Chong Yidong
2011-01-29 13:54         ` Eli Zaretskii
2011-01-29 15:44           ` Chong Yidong
2011-01-29 16:16             ` Eli Zaretskii
2011-01-29 18:29               ` Chong Yidong
2011-01-29 19:02                 ` Eli Zaretskii
2011-01-29 19:50                   ` Eli Zaretskii
2011-01-29 20:33                     ` Chong Yidong
2011-01-29 20:46                       ` Eli Zaretskii
2011-01-29 21:29                         ` Chong Yidong
2011-01-29 22:03                       ` Andreas Schwab
2011-01-29 22:27                         ` Chong Yidong
2011-01-30  0:00                           ` Andreas Schwab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110124215940.GH16230@danbala.tuwien.ac.at \
    --to=tk@giga.or.at \
    --cc=7908@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).