summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuanma Barranquero <lekktu@gmail.com>2004-06-02 00:50:09 +0000
committerJuanma Barranquero <lekktu@gmail.com>2004-06-02 00:50:09 +0000
commitb0da69a77b64c420c6e6157ee1ca0baac29fcd8d (patch)
treef47fb2fb4be79eb8be3b85487dc42ae68aee140f
parent9857367f6fea924843d6adcde3528b98f334f787 (diff)
downloademacs-b0da69a77b64c420c6e6157ee1ca0baac29fcd8d.tar.gz
Work around bugs/problems with MinGW builds of graphics libraries
called from MSVC builds of Emacs. (lookup_image): Make pointer to img static. (png_read_from_memory): Disable "global" optimization.
-rw-r--r--src/image.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/image.c b/src/image.c
index 700ab3fa2d9..3c53903b4b4 100644
--- a/src/image.c
+++ b/src/image.c
@@ -213,7 +213,7 @@ XDestroyImage (ximg)
{
UnlockPixels (GetGWorldPixMap (ximg));
}
-#endif
+#endif /* MAC_OS */
/* Functions to access the contents of a bitmap, given an id. */
@@ -1596,6 +1596,11 @@ lookup_image (f, spec)
Lisp_Object spec;
{
struct image_cache *c = FRAME_X_IMAGE_CACHE (f);
+#ifdef _MSC_VER
+ /* Work around a problem with MinGW builds of graphics libraries
+ not honoring calling conventions. */
+ static
+#endif
struct image *img;
int i;
unsigned hash;
@@ -4238,7 +4243,7 @@ xpm_load (f, img)
}
#endif /* MAC_OS */
-
+
/***********************************************************************
@@ -5688,6 +5693,12 @@ struct png_memory_storage
PNG_PTR is a pointer to the PNG control structure. Copy LENGTH
bytes from the input to DATA. */
+#ifdef _MSC_VER
+ /* Work around a problem with MinGW builds of graphics libraries
+ not honoring calling conventions. */
+#pragma optimize("g", off)
+#endif
+
static void
png_read_from_memory (png_ptr, data, length)
png_structp png_ptr;
@@ -5704,6 +5715,11 @@ png_read_from_memory (png_ptr, data, length)
tbr->index = tbr->index + length;
}
+#ifdef _MSC_VER
+/* Restore normal optimization, as specified on the command line. */
+#pragma optimize("", on)
+#endif
+
/* Load PNG image IMG for use on frame F. Value is non-zero if
successful. */