--- image.c 2012-09-18 18:10:21.952695267 +0200 +++ image.c.new 2012-09-18 18:09:18.173692841 +0200 @@ -575,12 +575,11 @@ static void x_emboss (struct frame *, struct image *); static int x_build_heuristic_mask (struct frame *, struct image *, Lisp_Object); -#ifdef HAVE_NTGUI + +static Lisp_Object loaded_image_types; + #define CACHE_IMAGE_TYPE(type, status) \ - do { Vlibrary_cache = Fcons (Fcons (type, status), Vlibrary_cache); } while (0) -#else -#define CACHE_IMAGE_TYPE(type, status) -#endif + do { loaded_image_types = Fcons (Fcons (type, status), loaded_image_types); } while (0) #define ADD_IMAGE_TYPE(type) \ do { Vimage_types = Fcons (type, Vimage_types); } while (0) @@ -8743,12 +8742,10 @@ of `dynamic-library-alist', which see). */) (Lisp_Object type, Lisp_Object libraries) { -#ifdef HAVE_NTGUI /* Don't try to reload the library. */ - Lisp_Object tested = Fassq (type, Vlibrary_cache); + Lisp_Object tested = Fassq (type, loaded_image_types); if (CONSP (tested)) return XCDR (tested); -#endif /* Types pbm and xbm are built-in and always available. */ if (EQ (type, Qpbm) || EQ (type, Qxbm)) @@ -8828,6 +8825,9 @@ non-numeric, there is no explicit limit on the size of images. */); Vmax_image_size = make_float (MAX_IMAGE_SIZE); + loaded_image_types = Qnil; + staticpro(&loaded_image_types); + DEFSYM (Qpbm, "pbm"); ADD_IMAGE_TYPE (Qpbm);