So thank you, Mats Lidell, Aidan Kehoe, Jerry James, Stephen
J. Turnbull and Vin Shelton, for encouraging responses.
I'll try to outline what I did -- my actual patched sources are
probably more trouble to look at than it's worth. . .
My starting point was
http://cygwin.com/faq/faq.html#faq.programming.64bitporting
The simple and I think obvious point is to replace the use of (int) to
hold pointers. The larger issue which engages the intl-... code is
the necessity to move to the ...LongPtr windows functions.
Here's an example diff wrt event-msw.c which illustrates these:
@@ -4139,7 +4142,7 @@
Lisp_Object
mswindows_find_frame (HWND hwnd)
{
- LONG l = qxeGetWindowLong (hwnd, XWL_FRAMEOBJ);
+ LONG_PTR l = GetWindowLongPtr (hwnd, XWL_FRAMEOBJ);
Lisp_Object f;
if (l == 0)
{
@@ -4149,7 +4152,7 @@
assert (!NILP (Vmswindows_frame_being_created));
return Vmswindows_frame_being_created;
}
- f = GET_LISP_FROM_VOID ((void *) l);
+ f = GET_LISP_FROM_VOID ((intptr_t) l);
It's much less obvious what to do in cases where existing casts go in
the other direction, e.g.
@@ -1855,7 +1855,7 @@
val = Fget (item, QHSZ, Qnil);
if (!FLOATP (val))
return Qnil;
- hsz = (HSZ)(int)XFLOAT_DATA (val);
+ hsz = (HSZ)(intptr_t)XFLOAT_DATA (val);
DdeFreeStringHandle (mswindows_dde_mlid, hsz);
Vdde_advise_items = delq_no_quit (item, Vdde_advise_items);
return Qnil;
I'm not at all sure that's the right thing to do.
Or take something such as
emacs_mswindows_remove_timeout (int id)
{
if (KillTimer (NULL, id))
--mswindows_pending_timers_count;
/* If there is a dispatch event generated by this
timeout in the queue, we have to remove it too. */
map_event_chain_remove (remove_timeout_mapper,
&mswindows_s_dispatch_event_queue,
&mswindows_s_dispatch_event_queue_tail,
(void *) id, MECR_DEALLOCATE_EVENT);
where it's clearly too late to make the change from void* to
intptr_t. Fixing this presumably requires actually tracking back the
calling chain . . .
So, like I said, I really don't understand enough to make my efforts
very likely to succeed. Making changes along the above lines (and
disabling the relevant error-inducing #defines for
e.g. GetWindowLongPtr) enabled me to _compile_ successfully, with lots
of remaining warnings about the up-conversion cases (e.g. void*->int),
but not to run w/o immediate segfault (
Program received signal SIGSEGV, Segmentation fault.
0x0000000100468eda in assert_failed (
file=0x100d8cba0 <devmode_description+608> "event-msw.c",
line=4152,
expr=0x100d8d440 <devmode_description+2816> "!NILP
(Vmswindows_frame_being_created)") at emacs.c:4089
4089 * ((int *) 0) = 666;
(gdb) where
#0 0x0000000100468eda in assert_failed (
file=0x100d8cba0 <devmode_description+608> "event-msw.c",
line=4152,
expr=0x100d8d440 <devmode_description+2816> "!NILP
(Vmswindows_frame_being_created)") at emacs.c:4089
#1 0x000000010056bf69 in mswindows_find_frame (hwnd=0x4c09ee)
at event-msw.c:4152
#2 0x00000001005691d8 in mswindows_wnd_proc (hwnd=0x4c09ee,
message_=71,
wParam=0, lParam=2330144) at event-msw.c:3312
#3 0x00000001006a5e85 in intercepted_wnd_proc (hwnd=0x4c09ee,
message_=71,
wParam=0, lParam=2330144) at intl-encap-win32.c:2498
#4 0x00007ffe6ec44d85 in USER32!ClientThreadSetup ()
from /c/WINDOWS/system32/USER32.dll
)
So, happy to test stuff, but probably not the right person to push
any further on my own, sorry.
ht
--
Henry S. Thompson, School of Informatics, University of Edinburgh
10 Crichton Street, Edinburgh EH8 9AB, SCOTLAND -- (44) 131 650-4440
Fax: (44) 131 650-4587, e-mail: ht(a)inf.ed.ac.uk
URL:
http://www.ltg.ed.ac.uk/~ht/
[mail from me _always_ has a .sig like this -- mail without it is forged spam]
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-beta