From xemacs-m  Fri Apr 25 12:16:07 1997
Received: from canker.atype.com (jsc@canker.atype.com [137.103.200.167])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id MAA08259
	for <xemacs-beta@xemacs.org>; Fri, 25 Apr 1997 12:16:06 -0500 (CDT)
Received: (from jsc@localhost)
	by canker.atype.com (8.8.5/8.8.5) id NAA11091;
	Fri, 25 Apr 1997 13:15:51 -0400
Date: Fri, 25 Apr 1997 13:15:51 -0400
Message-Id: <199704251715.NAA11091@canker.atype.com>
From: "Jin S. Choi" <jsc@atype.com>
To: xemacs-beta@xemacs.org
Subject: xemacs-20.2 build failure with new libpng
Reply-to: jsc@atype.com
Mime-Version: 1.0 (generated by tm-edit 7.106)
Content-Type: text/plain; charset=US-ASCII

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 */


Here's a patch that let me compile:
diff -c /usr/src/xemacs-20.2-b2/src/glyphs-x.c~ /usr/src/xemacs-20.2-b2/src/glyphs-x.c
*** /usr/src/xemacs-20.2-b2/src/glyphs-x.c~	Fri Apr 25 13:15:07 1997
--- /usr/src/xemacs-20.2-b2/src/glyphs-x.c	Fri Apr 25 13:15:07 1997
***************
*** 57,63 ****
--- 57,67 ----
  
  #include "sysfile.h"
  
+ #ifdef HAVE_PNG
+ #include <png.h>
+ #else
  #include <setjmp.h>
+ #endif
  
  #define LISP_DEVICE_TO_X_SCREEN(dev)					\
    XDefaultScreenOfDisplay (DEVICE_X_DISPLAY (XDEVICE (dev)))
***************
*** 1921,1928 ****
  
  
  #ifdef HAVE_PNG
- 
- #include <png.h>
  
  /**********************************************************************
   *                             PNG                                    *
--- 1925,1930 ----

