From xemacs-m  Fri Apr 25 12:31:23 1997
Received: from altair.xemacs.org (steve@xemacs.miranova.com [206.190.83.19])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id MAA08380
	for <xemacs-beta@xemacs.org>; Fri, 25 Apr 1997 12:31:22 -0500 (CDT)
Received: (from steve@localhost)
	by altair.xemacs.org (8.8.5/8.8.5) id KAA12129;
	Fri, 25 Apr 1997 10:44:36 -0700
Mail-Copies-To: never
To: xemacs-beta@xemacs.org
Subject: Re: xemacs-20.2 build failure with new libpng
References: <199704251715.NAA11091@canker.atype.com>
X-Url: http://www.miranova.com/%7Esteve/
X-Face: #!T9!#9s-3o8)*uHlX{Ug[xW7E7Wr!*L46-OxqMu\xz23v|R9q}lH?cRS{rCNe^'[`^sr5"
 f8*@r4ipO6Jl!:Ccq<xoV[Qz2u8<8-+Vwf2gzJ44lf_/y9OaQ`@#Q65{U4/TC)i2`~/M&QI$X>p:9I
 OSS'2{-)-4wBnVeg0S\O4Al@)uC[pD|+
X-Attribution: sb
From: Steven L Baur <steve@miranova.com>
In-Reply-To: "Jin S. Choi"'s message of Fri, 25 Apr 1997 13:15:51 -0400
Mime-Version: 1.0 (generated by tm-edit 7.106)
Content-Type: text/plain; charset=US-ASCII
Date: 25 Apr 1997 10:44:33 -0700
Message-ID: <m2yba7xaim.fsf@altair.xemacs.org>
Lines: 67
X-Mailer: Gnus v5.4.46/XEmacs 20.2(beta3)

Jin S Choi <jsc@atype.com> writes:

> I'm using libpng "1.0 beta 5 - version 0.95".
> I run into an error compiling glyphs-x.c:

> /usr/include/pngconf.h:98: parse error before `__png_h_already_includes_setjmp_h__'
> /usr/include/pngconf.h:301: syntax error before `typedef'


> Here's the bit of pngconf.h that's causing it.
> /* This is an attempt to force a single setjmp behaviour on Linux.  If
>    the X config stuff didn't define _BSD_SOURCE we wouldn't need this. */
> #ifdef linux
> #ifdef _BSD_SOURCE
> #define _PNG_SAVE_BSD_SOURCE
> #undef _BSD_SOURCE
> #endif
> #ifdef _SETJMP_H
> error  __png_h_already_includes_setjmp_h__
> error  __dont_include_it_again__
> #endif
> #endif /* linux */

This is hateful!

> Here's a patch that let me compile:

Sigh.  This patch breaks backwards compatibility.  Is testing
`PNG_LIBPNG_VER' a guaranteed way of knowing what version of libpng is 
installed?

How about this instead?

Index: src/glyphs-x.c
===================================================================
RCS file: /usr/local/xemacs/xemacs-20.0/src/glyphs-x.c,v
retrieving revision 1.11
diff -u -r1.11 glyphs-x.c
--- glyphs-x.c	1997/04/13 03:14:33	1.11
+++ glyphs-x.c	1997/04/25 17:42:42
@@ -57,7 +57,13 @@
 
 #include "sysfile.h"
 
+#ifdef HAVE_PNG
+#include <png.h>
+#endif
+
+#if !defined (HAVE_PNG) || (PNG_LIBPNG_VER < 95)
 #include <setjmp.h>
+#endif
 
 #define LISP_DEVICE_TO_X_SCREEN(dev)					\
   XDefaultScreenOfDisplay (DEVICE_X_DISPLAY (XDEVICE (dev)))
@@ -1921,8 +1927,6 @@
 
 
 #ifdef HAVE_PNG
-
-#include <png.h>
 
 /**********************************************************************
  *                             PNG                                    *

-- 
steve@miranova.com baur
Unsolicited commercial e-mail will be billed at $250/message.

