Commit aa15c6bb authored by Juanma Barranquero's avatar Juanma Barranquero

Move Vlibrary_cache to emacs.c and reset before dumping.

* src/lisp.h (reset_image_types): Declare.
[WINDOWSNT] (Vlibrary_cache): Declare.

* src/image.c (reset_image_types): New function.

* src/emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
(syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
(Fdump_emacs): Reset Vlibrary_cache and image_types.

* src/w32.c (Vlibrary_cache): Do not define; moved to emacs.c
(globals_of_w32) <Vlibrary_cache>: Do not initialize.

* src/w32.h (Vlibrary_cache): Do not declare.
parent 16b22fef
2012-09-25 Juanma Barranquero <lekktu@gmail.com>
Move Vlibrary_cache to emacs.c and reset before dumping.
* lisp.h (reset_image_types): Declare.
[WINDOWSNT] (Vlibrary_cache): Declare.
* image.c (reset_image_types): New function.
* emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
(syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
(Fdump_emacs): Reset Vlibrary_cache and image_types.
* w32.c (Vlibrary_cache): Do not define; moved to emacs.c
(globals_of_w32) <Vlibrary_cache>: Do not initialize.
* w32.h (Vlibrary_cache): Do not declare.
2012-09-25 Eli Zaretskii <eliz@gnu.org>
* w32proc.c (sys_signal): Handle all signals defined by the
......
......@@ -96,6 +96,11 @@ static const char emacs_copyright[] = COPYRIGHT;
/* Empty lisp strings. To avoid having to build any others. */
Lisp_Object empty_unibyte_string, empty_multibyte_string;
#ifdef WINDOWSNT
/* Cache for externally loaded libraries. */
Lisp_Object Vlibrary_cache;
#endif
/* Set after Emacs has started up the first time.
Prevents reinitialization of the Lisp world and keymaps
on subsequent starts. */
......@@ -2025,6 +2030,13 @@ You must run Emacs in batch mode in order to dump it. */)
free (malloc_state_ptr);
#endif
#ifdef WINDOWSNT
Vlibrary_cache = Qnil;
#endif
#ifdef HAVE_WINDOW_SYSTEM
reset_image_types ();
#endif
Vpurify_flag = tem;
return unbind_to (count, Qnil);
......@@ -2357,6 +2369,11 @@ libraries; only those already known by Emacs will be loaded. */);
Vdynamic_library_alist = Qnil;
Fput (intern_c_string ("dynamic-library-alist"), Qrisky_local_variable, Qt);
#ifdef WINDOWSNT
Vlibrary_cache = Qnil;
staticpro (&Vlibrary_cache);
#endif
/* Make sure IS_DAEMON starts up as false. */
daemon_pipe[1] = 0;
}
......@@ -8831,12 +8831,24 @@ lookup_image_type (Lisp_Object type)
return NULL;
}
/* Reset image_types before dumping.
Called from Fdump_emacs. */
void
reset_image_types (void)
{
while (image_types)
{
struct image_type *next = image_types->next;
xfree (image_types);
image_types = next;
}
}
void
syms_of_image (void)
{
/* Initialize this only once, since that's what we do with Vimage_types
and they are supposed to be in sync. Initializing here gives correct
operation on GNU/Linux of calling dump-emacs after loading some images. */
/* Initialize this only once; it will be reset before dumping. */
image_types = NULL;
/* Must be defined now because we're going to update it below, while
......
......@@ -2731,6 +2731,7 @@ extern void init_fringe_once (void);
extern Lisp_Object QCascent, QCmargin, QCrelief;
extern Lisp_Object QCconversion;
extern int x_bitmap_mask (struct frame *, ptrdiff_t);
extern void reset_image_types (void);
extern void syms_of_image (void);
/* Defined in insdel.c. */
......@@ -3284,6 +3285,9 @@ extern Lisp_Object empty_unibyte_string, empty_multibyte_string;
extern Lisp_Object Qfile_name_handler_alist;
extern _Noreturn void terminate_due_to_signal (int, int);
extern Lisp_Object Qkill_emacs;
#ifdef WINDOWSNT
extern Lisp_Object Vlibrary_cache;
#endif
#if HAVE_SETLOCALE
void fixup_locale (void);
void synchronize_system_messages_locale (void);
......
......@@ -6521,10 +6521,6 @@ sys_localtime (const time_t *t)
/* Delayed loading of libraries. */
Lisp_Object Vlibrary_cache;
/* Try loading LIBRARY_ID from the file(s) specified in
Vdynamic_library_alist. If the library is loaded successfully,
return the handle of the DLL, and record the filename in the
......@@ -6769,9 +6765,6 @@ globals_of_w32 (void)
DEFSYM (QCloaded_from, ":loaded-from");
Vlibrary_cache = Qnil;
staticpro (&Vlibrary_cache);
g_b_init_is_windows_9x = 0;
g_b_init_open_process_token = 0;
g_b_init_get_token_information = 0;
......
......@@ -145,7 +145,7 @@ extern void check_windows_init_file (void);
extern int _sys_read_ahead (int fd);
extern int _sys_wait_accept (int fd);
extern Lisp_Object Vlibrary_cache, QCloaded_from;
extern Lisp_Object QCloaded_from;
extern HMODULE w32_delayed_load (Lisp_Object);
#ifdef HAVE_GNUTLS
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment