From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andrew Schwartzmeyer Newsgroups: gmane.emacs.devel Subject: Patch for build failure on OS X (under review) Date: Mon, 5 May 2014 19:39:41 -0700 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Content-Type: multipart/signed; boundary="Apple-Mail=_2E980EE2-C331-4B24-BADE-96C66252D755"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Trace: ger.gmane.org 1399413834 26572 80.91.229.3 (6 May 2014 22:03:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 6 May 2014 22:03:54 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed May 07 00:03:47 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WhnR0-0002FQ-U3 for ged-emacs-devel@m.gmane.org; Wed, 07 May 2014 00:01:59 +0200 Original-Received: from localhost ([::1]:32961 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WhXuD-0008Vy-1u for ged-emacs-devel@m.gmane.org; Tue, 06 May 2014 01:27:05 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47080) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WhVIX-0006Qu-Oa for emacs-devel@gnu.org; Mon, 05 May 2014 22:40:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WhVIQ-0008Jh-58 for emacs-devel@gnu.org; Mon, 05 May 2014 22:40:01 -0400 Original-Received: from krikkit.schwartzmeyer.com ([192.241.204.17]:43927) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WhVIP-0008JO-SR for emacs-devel@gnu.org; Mon, 05 May 2014 22:39:54 -0400 Original-Received: from localhost (unknown [127.0.0.1]) by krikkit.schwartzmeyer.com (Postfix) with ESMTP id 6397082390 for ; Mon, 5 May 2014 19:39:51 -0700 (PDT) Original-Received: from krikkit.schwartzmeyer.com ([127.0.0.1]) by localhost (krikkit.schwartzmeyer.com. [127.0.0.1]) (amavisd-new, port 10024) with LMTP id Y-uPN6AVEwk3 for ; Mon, 5 May 2014 19:39:49 -0700 (PDT) Original-Received: from [192.168.1.121] (unknown [76.178.142.134]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by krikkit.schwartzmeyer.com (Postfix) with ESMTPSA id 5067780231 for ; Mon, 5 May 2014 19:39:49 -0700 (PDT) X-Mailer: Apple Mail (2.1874) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 192.241.204.17 X-Mailman-Approved-At: Tue, 06 May 2014 01:27:01 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:171706 Archived-At: --Apple-Mail=_2E980EE2-C331-4B24-BADE-96C66252D755 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 When building under Homebrew with the options 'brew install emacs = --use-git-head --HEAD --cocoa --srgb --with-gnutls' (that is, build off = master as of Mon May 5 19:31:51 PDT 2014, Cocoa build with sRGB colors, = link to GnuTLS library, the following build error was encountered: > gcc-4.8 -std=3Dgnu99 -c -Demacs -I. -I. -I../lib -I./../lib = -I/usr/X11/include -I/usr/include/libxml2 -MMD -MF = deps/image.d -MP -I/usr/local/Cellar/libtasn1/3.4/include = -I/usr/local/Cellar/nettle/2.7.1/include = -I/usr/local/Cellar/gnutls/3.2.13/include -g3 -O2 image.c > image.c: In function 'png_load_body': > image.c:5919:37: error: 'frame_background' undeclared (first use in = this function) > fn_png_set_background (png_ptr, &frame_background, > ^ > image.c:5919:37: note: each undeclared identifier is reported only = once for each function it appears in > make[1]: *** [image.o] Error 1 > make: *** [src] Error 2 > =3D=3D> Configuration > HOMEBREW_VERSION: 0.9.5 > HEAD: b10c09b1746cd5673bff4e40c4485cb266b1932b > CPU: quad-core 64-bit ivybridge > OS X: 10.9.2-x86_64 > Xcode: 5.1.1 > CLT: 5.1.0.0.1.1396320587 > X11: 2.7.5 =3D> /opt/X11 > =3D=3D> ENV > HOMEBREW_CC: gcc-4.8 > HOMEBREW_CXX: g++-4.8 > CMAKE_PREFIX_PATH: /usr/local > CMAKE_INCLUDE_PATH: = /usr/include/libxml2:/System/Library/Frameworks/OpenGL.framework/Versions/= Current/Headers > CMAKE_LIBRARY_PATH: = /System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries > PKG_CONFIG_PATH: = /usr/local/opt/libtasn1/lib/pkgconfig:/usr/local/opt/nettle/lib/pkgconfig:= /usr/local/opt/gnutls/lib/pkgconfig > PKG_CONFIG_LIBDIR: = /usr/lib/pkgconfig:/usr/local/Library/ENV/pkgconfig/10.9 > ACLOCAL_PATH: /usr/local/share/aclocal > PATH: = /usr/local/Library/ENV/4.3:/usr/local/opt/autoconf/bin:/usr/local/opt/auto= make/bin:/usr/local/opt/pkg-config/bin:/usr/local/opt/libtasn1/bin:/usr/lo= cal/opt/nettle/bin:/usr/local/opt/gnutls/bin:/usr/bin:/bin:/usr/sbin:/sbin= :/usr/local/opt/gcc/bin >=20 > Error: emacs HEAD did not build Note that the exact same error happens when building with the system = clang compiler. Inspection of src/image.c revealed that in certain cases, an undefined = variable reference occurred. This was due to a preprocessor #if/endif = block (lines 5906 to 5917) in which the variable (png_color_16 = frame_background;) was created, and a function (fn_png_set_background) = after said block that needed used said variable. Here is where I am = unsure: should the function be called after the block (necessitating = making the variable before the block), or should the function be called = inside the block? This patch does the former, as I assumed. > diff --git a/src/image.c b/src/image.c > index c26c0db..b4582d2 100644 > --- a/src/image.c > +++ b/src/image.c > @@ -5903,9 +5903,11 @@ png_load_body (struct frame *f, struct image = *img, struct png_load_context *c) > { > /* We use the current frame background, ignoring any default > background color set by the image. */ > + > + png_color_16 frame_background; > + > #if defined (HAVE_X_WINDOWS) || defined (HAVE_NTGUI) > XColor color; > - png_color_16 frame_background; > =20 > color.pixel =3D FRAME_BACKGROUND_PIXEL (f); > x_query_color (f, &color); I made this from a git diff; if need be, I can figure out Bazaar and = send a patch in the documented format. If there=92s a better way to do = this, please let me know. Cheers, Andrew Schwartzmeyer --Apple-Mail=_2E980EE2-C331-4B24-BADE-96C66252D755 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJTaEttAAoJENUANqmoSiFvdhcQAIgNh+fT8qGxeEgL9vVD5Tl4 ry4br5BgDvCwnnlMch1c561m5ACothyZDVlCrXFhvcDU8KqlyCHde7k9OPVVaxWs 1LIif6xOBiS0nlcfFCrKj+8B08I+t9Tq0cSEsCXYt8qEBA13wJ4C272hWZGw1lPS S5YB8DGqLwRFzszgK72hdILsZh/Cn9RSzw2gVV/lucHvBgLHnnSOzbwx4WpHnr/u c93rFeNaK0Ca+W4wsDOnSJ7+Um3vCShxINkypwmdlXcgWU3v5DpiGRv1yn0T4UC0 LbhmvZOq2woAGbiNogbsSY92v5yAAOgYV/FX9OTdYDVqqZqABdMmQbiPOPpf4ZPn kVRRiaPQsD7QRtLwpTHkIZ6Tp1QTNocu8dAJd5KRTyOjEeruhvkBUyby5O1KUCpX RniP3Zp5wCXdlZc7JT5EaC02WdFt7s9cAUuIri8Oh+pNB7HU5CvreGlIPHJmb4P/ XTKuxcH6btysQzfO+dnKCUItYR9Xgbk/2XXcxwAVbjhWcVM4UMjfCZ47OhTc2gj9 h4O8wtv/0gfUfkJmJ4z2zTBKmfBFCnTG21HQbak5bZsEQ1UkOgYl1veve5Vf7Bwy QErEA4+REW9io8mCxpDvopwAieYM/QB06bABSUDpZao5zYcF8yEhB4c1dZ4DgPg6 vuOu02Pqt+8FIGc4WZuG =3/kR -----END PGP SIGNATURE----- --Apple-Mail=_2E980EE2-C331-4B24-BADE-96C66252D755--