unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Building trunk fails in x_check_image_size
@ 2011-07-28  6:50 martin rudalics
  2011-07-28  7:05 ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: martin rudalics @ 2011-07-28  6:50 UTC (permalink / raw
  To: emacs-devel; +Cc: Paul Eggert

After

configure --no-opt --without-xpm --without-png --without-jpeg --without-tiff --without-gif

building and bootstrapping trunk on Windows XP with
i386-mingw-nt5.1.2600 fail with

gcc -I. -c -gdwarf-2 -g3  -DEMACSDEBUG    -Demacs=1 -DHAVE_CONFIG_H -I../lib -I../nt/inc -DHAVE_NTGUI=1 -DUSE_CRT_DLL=1 -DPURESIZE=5000000 -o oo/i386/image.o image.c
image.c: In function `x_check_image_size':
image.c:1928: error: structure has no member named `bitmap_pad'
image.c:1929: error: structure has no member named `depth'
image.c:1930: error: structure has no member named `bytes_per_line'
make[3]: *** [oo/i386/image.o] Error 1
make[3]: Leaving directory `C:/emacs/quickfixes/src'
make[2]: *** [bootstrap-temacs-CMD] Error 2
make[2]: Leaving directory `C:/emacs/quickfixes/src'
make[1]: *** [bootstrap-temacs] Error 2
make[1]: Leaving directory `C:/emacs/quickfixes/src'
make: *** [bootstrap-gmake] Error 2

martin



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Building trunk fails in x_check_image_size
  2011-07-28  6:50 Building trunk fails in x_check_image_size martin rudalics
@ 2011-07-28  7:05 ` Eli Zaretskii
  2011-07-28  8:09   ` martin rudalics
  0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2011-07-28  7:05 UTC (permalink / raw
  To: martin rudalics; +Cc: eggert, emacs-devel

> Date: Thu, 28 Jul 2011 08:50:47 +0200
> From: martin rudalics <rudalics@gmx.at>
> Cc: Paul Eggert <eggert@cs.ucla.edu>
> 
> After
> 
> configure --no-opt --without-xpm --without-png --without-jpeg --without-tiff --without-gif
> 
> building and bootstrapping trunk on Windows XP with
> i386-mingw-nt5.1.2600 fail with
> 
> gcc -I. -c -gdwarf-2 -g3  -DEMACSDEBUG    -Demacs=1 -DHAVE_CONFIG_H -I../lib -I../nt/inc -DHAVE_NTGUI=1 -DUSE_CRT_DLL=1 -DPURESIZE=5000000 -o oo/i386/image.o image.c
> image.c: In function `x_check_image_size':
> image.c:1928: error: structure has no member named `bitmap_pad'
> image.c:1929: error: structure has no member named `depth'
> image.c:1930: error: structure has no member named `bytes_per_line'
> make[3]: *** [oo/i386/image.o] Error 1
> make[3]: Leaving directory `C:/emacs/quickfixes/src'
> make[2]: *** [bootstrap-temacs-CMD] Error 2
> make[2]: Leaving directory `C:/emacs/quickfixes/src'
> make[1]: *** [bootstrap-temacs] Error 2
> make[1]: Leaving directory `C:/emacs/quickfixes/src'
> make: *** [bootstrap-gmake] Error 2

I think x_check_image_size is X-specific, so just comment out its
call, at least for now.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Building trunk fails in x_check_image_size
  2011-07-28  7:05 ` Eli Zaretskii
@ 2011-07-28  8:09   ` martin rudalics
  2011-07-28  9:44     ` Paul Eggert
  0 siblings, 1 reply; 5+ messages in thread
From: martin rudalics @ 2011-07-28  8:09 UTC (permalink / raw
  To: Eli Zaretskii; +Cc: eggert, emacs-devel

 >> image.c:1928: error: structure has no member named `bitmap_pad'
 >> image.c:1929: error: structure has no member named `depth'
 >> image.c:1930: error: structure has no member named `bytes_per_line'
 >> make[3]: *** [oo/i386/image.o] Error 1
 >> make[3]: Leaving directory `C:/emacs/quickfixes/src'
 >> make[2]: *** [bootstrap-temacs-CMD] Error 2
 >> make[2]: Leaving directory `C:/emacs/quickfixes/src'
 >> make[1]: *** [bootstrap-temacs] Error 2
 >> make[1]: Leaving directory `C:/emacs/quickfixes/src'
 >> make: *** [bootstrap-gmake] Error 2
 >
 > I think x_check_image_size is X-specific, so just comment out its
 > call, at least for now.

IIUC I'd have to comment out its definition and at least two calls of
it.  But the consequences of doing that seem too unpredictable to me.
I'll wait till Paul fixes it.

martin



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Building trunk fails in x_check_image_size
  2011-07-28  8:09   ` martin rudalics
@ 2011-07-28  9:44     ` Paul Eggert
  2011-07-28 12:18       ` martin rudalics
  0 siblings, 1 reply; 5+ messages in thread
From: Paul Eggert @ 2011-07-28  9:44 UTC (permalink / raw
  To: martin rudalics; +Cc: Eli Zaretskii, emacs-devel

On 07/28/11 01:09, martin rudalics wrote:
> But the consequences of doing that seem too unpredictable to me.
> I'll wait till Paul fixes it.

Sorry about that.  I fixed it for now as follows.  Doing it "right" requires more
expertise in Windows and NS than I have right now, but at least
this fix should let things compile, and the code will be no worse
off than before (when it didn't check image sizes on any platform).

* image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
In other words, assume that every image size is allowed, on non-X
hosts.  This assumption is probably wrong, but it lets Emacs compile.
=== modified file 'src/image.c'
--- src/image.c	2011-07-14 06:20:53 +0000
+++ src/image.c	2011-07-28 09:35:15 +0000
@@ -1906,16 +1906,17 @@
 static void x_destroy_x_image (XImagePtr);
 static void x_put_x_image (struct frame *, XImagePtr, Pixmap, int, int);

-/* Return nonzero if XIMG's size WIDTH x HEIGHT doesn't break X.
+/* Return nonzero if XIMG's size WIDTH x HEIGHT doesn't break the
+   windowing system.
    WIDTH and HEIGHT must both be positive.
    If XIMG is null, assume it is a bitmap.  */
 static int
 x_check_image_size (XImagePtr ximg, int width, int height)
 {
+#ifdef HAVE_X_WINDOWS
   /* Respect Xlib's limits: it cannot deal with images that have more
      than INT_MAX (and/or UINT_MAX) bytes.  And respect Emacs's limits
-     of PTRDIFF_MAX (and/or SIZE_MAX) bytes for any object.  For now,
-     assume all windowing systems have the same limits that X does.  */
+     of PTRDIFF_MAX (and/or SIZE_MAX) bytes for any object.  */
   enum
   {
     XLIB_BYTES_MAX = min (INT_MAX, UINT_MAX),
@@ -1937,6 +1938,11 @@
     }
   return (width <= (INT_MAX - (bitmap_pad - 1)) / depth
 	  && height <= X_IMAGE_BYTES_MAX / bytes_per_line);
+#else
+  /* FIXME: Implement this check for the HAVE_NS and HAVE_NTGUI cases.
+     For now, assume that every image size is allowed on these systems.  */
+  return 1;
+#endif
 }

 /* Create an XImage and a pixmap of size WIDTH x HEIGHT for use on




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Building trunk fails in x_check_image_size
  2011-07-28  9:44     ` Paul Eggert
@ 2011-07-28 12:18       ` martin rudalics
  0 siblings, 0 replies; 5+ messages in thread
From: martin rudalics @ 2011-07-28 12:18 UTC (permalink / raw
  To: Paul Eggert; +Cc: Eli Zaretskii, emacs-devel

 > I fixed it for now as follows.  Doing it "right" requires more
 > expertise in Windows and NS than I have right now, but at least
 > this fix should let things compile, and the code will be no worse
 > off than before (when it didn't check image sizes on any platform).

Thank you Paul, no more problems here now.  Since I build without image
support I can't tell whether your changes fix or break anything in that
department though.

Thanks again for the quick fix, martin



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-07-28 12:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-28  6:50 Building trunk fails in x_check_image_size martin rudalics
2011-07-28  7:05 ` Eli Zaretskii
2011-07-28  8:09   ` martin rudalics
2011-07-28  9:44     ` Paul Eggert
2011-07-28 12:18       ` martin rudalics

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).