not sure if anyone cares but I did this:
--- main-win.c.orig Fri Dec 24 05:14:00 2010
+++ src\main-win.c Mon Jan 03 19:44:36 2011
@@ -3983,7 +3983,7 @@
term_data *td;
/* Acquire proper "term_data" info */
- td = (term_data *)GetWindowLong(hWnd, 0);
+ td = (term_data *)GetWindowLongPtr(hWnd, GWLP_USERDATA);
BeginPaint(hWnd, &ps);
@@ -4028,7 +4028,7 @@
#endif /* USE_SAVER */
/* Acquire proper "term_data" info */
- td = (term_data *)GetWindowLong(hWnd, 0);
+ td = (term_data *)GetWindowLongPtr(hWnd, GWLP_USERDATA);
/* Handle message */
switch (uMsg)
@@ -4036,7 +4036,11 @@
/* XXX XXX XXX */
case WM_NCCREATE:
{
- SetWindowLong(hWnd, 0, (LONG)(my_td));
+#ifdef _WIN64
+ SetWindowLongPtr(hWnd, GWLP_USERDATA, my_td);
+#else
+ SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG)(my_td));
+#endif
break;
}
@@ -4366,7 +4370,7 @@
/* Acquire proper "term_data" info */
- td = (term_data *)GetWindowLong(hWnd, 0);
+ td = (term_data *)GetWindowLongPtr(hWnd, GWLP_USERDATA);
/* Process message */
switch (uMsg)
@@ -4374,7 +4378,11 @@
/* XXX XXX XXX */
case WM_NCCREATE:
{
- SetWindowLong(hWnd, 0, (LONG)(my_td));
+#ifdef _WIN64
+ SetWindowLongPtr(hWnd, GWLP_USERDATA, my_td);
+#else
+ SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG)(my_td));
+#endif
break;
}
and it compiles and runs natively in Win7 x64. I would make it a formal contribution but, as I said, I don't know that anyone really cares since it runs fine in 32bit mode on Win64... I mostly did it just to see if my windoze C coding was as rusty as I thought it was (it was... it took me much longer to do that than it should have)
--- main-win.c.orig Fri Dec 24 05:14:00 2010
+++ src\main-win.c Mon Jan 03 19:44:36 2011
@@ -3983,7 +3983,7 @@
term_data *td;
/* Acquire proper "term_data" info */
- td = (term_data *)GetWindowLong(hWnd, 0);
+ td = (term_data *)GetWindowLongPtr(hWnd, GWLP_USERDATA);
BeginPaint(hWnd, &ps);
@@ -4028,7 +4028,7 @@
#endif /* USE_SAVER */
/* Acquire proper "term_data" info */
- td = (term_data *)GetWindowLong(hWnd, 0);
+ td = (term_data *)GetWindowLongPtr(hWnd, GWLP_USERDATA);
/* Handle message */
switch (uMsg)
@@ -4036,7 +4036,11 @@
/* XXX XXX XXX */
case WM_NCCREATE:
{
- SetWindowLong(hWnd, 0, (LONG)(my_td));
+#ifdef _WIN64
+ SetWindowLongPtr(hWnd, GWLP_USERDATA, my_td);
+#else
+ SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG)(my_td));
+#endif
break;
}
@@ -4366,7 +4370,7 @@
/* Acquire proper "term_data" info */
- td = (term_data *)GetWindowLong(hWnd, 0);
+ td = (term_data *)GetWindowLongPtr(hWnd, GWLP_USERDATA);
/* Process message */
switch (uMsg)
@@ -4374,7 +4378,11 @@
/* XXX XXX XXX */
case WM_NCCREATE:
{
- SetWindowLong(hWnd, 0, (LONG)(my_td));
+#ifdef _WIN64
+ SetWindowLongPtr(hWnd, GWLP_USERDATA, my_td);
+#else
+ SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG)(my_td));
+#endif
break;
}
and it compiles and runs natively in Win7 x64. I would make it a formal contribution but, as I said, I don't know that anyone really cares since it runs fine in 32bit mode on Win64... I mostly did it just to see if my windoze C coding was as rusty as I thought it was (it was... it took me much longer to do that than it should have)
Comment