emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: display word wrapping


From: Juanma Barranquero
Subject: Re: display word wrapping
Date: Tue, 01 Jun 2004 00:19:14 +0200

On Mon, 31 May 2004 20:05:07 +0100, Jason Rumney <address@hidden> wrote:

> Could it be that the register state is not fully saved before a
> library call (or restored after)?

It is the case, yes.

Andreas Schwab says that the callee should preserve edi, and after a
look at the relevant MSVC docs I tend to agree. The GnuWin32 libraries
seem to be compiled with GCC 2.95.2 from MinGW, I
think. I don't know whether MinGW's GCC follows the MSVC calling
conventions or not; it seems they don't.

Certainly I don't want to go the route of providing MSVC builds of
libungif, tiff, libXpm and libjpeg.

There are workarounds; in the case of lookup_image, just making the
variable "static" works (and it's a bit less ugly than interspersing
_asm calls or whatnot). I haven't yet researched what happens with
png_read_from_memory, but it's small, so there's no problem on
de-optimizing it.

So, unless someone has a better idea, I propose the attached patch.

                                                           /L/e/k/t/u



Index: image.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/image.c,v
retrieving revision 1.11
diff -u -2 -r1.11 image.c
--- image.c     12 May 2004 02:23:37 -0000      1.11
+++ image.c     31 May 2004 22:14:27 -0000
@@ -1597,4 +1597,9 @@
 {
   struct image_cache *c = FRAME_X_IMAGE_CACHE (f);
+#ifdef _MSC_VER
+  /* Work around a problem with MinGW builds of graphic libraries
+     not honoring calling conventions */
+  static
+#endif
   struct image *img;
   int i;
@@ -5689,4 +5695,8 @@
    bytes from the input to DATA.  */
 
+#ifdef _MSC_VER
+#pragma optimize("g", off)
+#endif
+
 static void
 png_read_from_memory (png_ptr, data, length)
@@ -5705,4 +5715,8 @@
 }
 
+#ifdef _MSC_VER
+#pragma optimize("", on)
+#endif
+
 /* Load PNG image IMG for use on frame F.  Value is non-zero if
    successful.  */
 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]