all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* emacs-cvs built on Windows XP crashes on Windows 2000
@ 2002-09-04 11:25 Peter 'Luna' Runestig
  2002-09-04 13:05 ` Peter 'Luna' Runestig
  2002-11-22 11:48 ` Peter 'Luna' Runestig
  0 siblings, 2 replies; 3+ messages in thread
From: Peter 'Luna' Runestig @ 2002-09-04 11:25 UTC (permalink / raw)


Hi all,

If I build emacs from cvs (20020829) on Windows XP (using VC++ 6), the
binary doesn't work on another system, running Windows 2000. This is not
the case for emacs 21.2, that works fine. It took me some time to figure
out why:

For some reason, a few Windows API functions are loaded at runtime,
using GetModuleHandle()/GetProcAddress(). In 21.2, this was done
"locally"; each time one of those function was needed, it's entry point
in the shared library was queried and then used. In the latest code, the
entry point are queried only when the global variable "initialized" ==
0, and then stored in global variables. This only happens once, at build
time, when the globals are actually saved in the binary (if I understand
it correctly). But one can hardly expect the entry points for functions
in various shared libraries to be the same across systems, or ever
system upgrades (which are constanty needed when running a Microsoft
OS). So when I run emacs, built on XP, on Windows 2000, it tries co call
functions at totally bogus entry points, and is sure to break.

Cheers,
- Peter
----------------------------------------------------------------
Peter 'Luna' Runestig (fd. Altberg), Sweden <peter@runestig.com>
PGP Key ID: 0xD07BBE13
Fingerprint: 7B5C 1F48 2997 C061 DE4B  42EA CB99 A35C D07B BE13
AOL Instant Messenger Screenname: PRunestig

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

* Re: emacs-cvs built on Windows XP crashes on Windows 2000
  2002-09-04 11:25 emacs-cvs built on Windows XP crashes on Windows 2000 Peter 'Luna' Runestig
@ 2002-09-04 13:05 ` Peter 'Luna' Runestig
  2002-11-22 11:48 ` Peter 'Luna' Runestig
  1 sibling, 0 replies; 3+ messages in thread
From: Peter 'Luna' Runestig @ 2002-09-04 13:05 UTC (permalink / raw)


This is a quick hack to make it roll again:

diff -urN emacs-cvs.orig/src/emacs.c emacs-cvs/src/emacs.c
--- emacs-cvs.orig/src/emacs.c	Wed Aug 28 08:28:30 2002
+++ emacs-cvs/src/emacs.c	Wed Sep  4 14:38:07 2002
@@ -1536,6 +1536,19 @@
       keys_of_window ();
     }
 
+#ifdef HAVE_NTGUI
+  {
+    /* these must be initialized every run time */
+    extern FARPROC track_mouse_event_fn;
+    extern FARPROC get_menu_item_info;
+    extern FARPROC set_menu_item_info;
+    HMODULE user32 = GetModuleHandle ("user32.dll");
+    track_mouse_event_fn = GetProcAddress (user32, "TrackMouseEvent");
+    get_menu_item_info = GetProcAddress (user32, "GetMenuItemInfoA");
+    set_menu_item_info = GetProcAddress (user32, "SetMenuItemInfoA");
+  }
+#endif /* HAVE_NTGUI */
+
   if (!noninteractive)
     {
 #ifdef VMS

Cheers,
- Peter
-- 
Peter 'Luna' Runestig (fd. Altberg), Sweden <peter@runestig.com>
PGP Key ID: 0xD07BBE13
Fingerprint: 7B5C 1F48 2997 C061 DE4B  42EA CB99 A35C D07B BE13
AOL Instant Messenger Screenname: PRunestig

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

* Re: emacs-cvs built on Windows XP crashes on Windows 2000
  2002-09-04 11:25 emacs-cvs built on Windows XP crashes on Windows 2000 Peter 'Luna' Runestig
  2002-09-04 13:05 ` Peter 'Luna' Runestig
@ 2002-11-22 11:48 ` Peter 'Luna' Runestig
  1 sibling, 0 replies; 3+ messages in thread
From: Peter 'Luna' Runestig @ 2002-11-22 11:48 UTC (permalink / raw)


Ah, good news! I see that the bug I pointed out and "fixed" in
http://mail.gnu.org/pipermail/bug-gnu-emacs/2002-September/014607.html
and
http://mail.gnu.org/pipermail/bug-gnu-emacs/2002-September/014608.html
is finally fixed in cvs, after 2½ months. Great!

Cheers,
- Peter
-- 
Peter 'Luna' Runestig (fd. Altberg), Sweden <peter@runestig.com>
PGP Key ID: 0xD07BBE13
Fingerprint: 7B5C 1F48 2997 C061 DE4B  42EA CB99 A35C D07B BE13
AOL Instant Messenger Screen name: PRunestig

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

end of thread, other threads:[~2002-11-22 11:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-04 11:25 emacs-cvs built on Windows XP crashes on Windows 2000 Peter 'Luna' Runestig
2002-09-04 13:05 ` Peter 'Luna' Runestig
2002-11-22 11:48 ` Peter 'Luna' Runestig

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.