mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-03-23 15:09:24 -05:00
Somewhat gruesome tweak to use SetClassLongPtr where available and degrade
nicely elsewhere, which should fix `win64' _properly_. Tested on recent-ish MinGW (with GetWindowLongPtr but not GetClassLongPtr), and VC++ 6.0 with a recent SDK, but not with vanilla VC++. [originally from svn r6535] [this svn revision also touched putty-wishlist]
This commit is contained in:
parent
b61713fb3f
commit
4da1f2b17e
@ -240,11 +240,7 @@ static int SaneDialogBox(HINSTANCE hinst,
|
|||||||
wc.style = CS_DBLCLKS | CS_SAVEBITS | CS_BYTEALIGNWINDOW;
|
wc.style = CS_DBLCLKS | CS_SAVEBITS | CS_BYTEALIGNWINDOW;
|
||||||
wc.lpfnWndProc = DefDlgProc;
|
wc.lpfnWndProc = DefDlgProc;
|
||||||
wc.cbClsExtra = 0;
|
wc.cbClsExtra = 0;
|
||||||
#ifdef LONG_PTR
|
|
||||||
wc.cbWndExtra = DLGWINDOWEXTRA + 2*sizeof(LONG_PTR);
|
wc.cbWndExtra = DLGWINDOWEXTRA + 2*sizeof(LONG_PTR);
|
||||||
#else
|
|
||||||
wc.cbWndExtra = DLGWINDOWEXTRA + 8;
|
|
||||||
#endif
|
|
||||||
wc.hInstance = hinst;
|
wc.hInstance = hinst;
|
||||||
wc.hIcon = NULL;
|
wc.hIcon = NULL;
|
||||||
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
|
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
|
||||||
|
@ -1010,7 +1010,7 @@ static void update_mouse_pointer(void)
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
HCURSOR cursor = LoadCursor(NULL, curstype);
|
HCURSOR cursor = LoadCursor(NULL, curstype);
|
||||||
SetClassLong(hwnd, GCL_HCURSOR, (LONG)cursor);
|
SetClassLongPtr(hwnd, GCLP_HCURSOR, (LONG_PTR)cursor);
|
||||||
SetCursor(cursor); /* force redraw of cursor at current posn */
|
SetCursor(cursor); /* force redraw of cursor at current posn */
|
||||||
}
|
}
|
||||||
if (force_visible != forced_visible) {
|
if (force_visible != forced_visible) {
|
||||||
|
@ -36,21 +36,38 @@ struct FontSpec {
|
|||||||
(fq) == FQ_NONANTIALIASED ? NONANTIALIASED_QUALITY : \
|
(fq) == FQ_NONANTIALIASED ? NONANTIALIASED_QUALITY : \
|
||||||
CLEARTYPE_QUALITY)
|
CLEARTYPE_QUALITY)
|
||||||
|
|
||||||
/* VC++ 6 doesn't have GetWindowLongPtr and friends. Degrade nicely. */
|
/*
|
||||||
|
* Where we can, we use GetWindowLongPtr and friends because they're
|
||||||
|
* more useful on 64-bit platforms, but they're a relatively recent
|
||||||
|
* innovation, missing from VC++ 6 and older MinGW. Degrade nicely.
|
||||||
|
* (NB that on some systems, some of these things are available but
|
||||||
|
* not others...)
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef GWLP_USERDATA
|
#ifndef GCLP_HCURSOR
|
||||||
|
/* GetClassLongPtr and friends */
|
||||||
|
#undef GetClassLongPtr
|
||||||
|
#define GetClassLongPtr GetClassLong
|
||||||
|
#undef SetClassLongPtr
|
||||||
|
#define SetClassLongPtr SetClassLong
|
||||||
|
#define GCLP_HCURSOR GCL_HCURSOR
|
||||||
|
/* GetWindowLongPtr and friends */
|
||||||
|
#undef GetWindowLongPtr
|
||||||
#define GetWindowLongPtr GetWindowLong
|
#define GetWindowLongPtr GetWindowLong
|
||||||
|
#undef SetWindowLongPtr
|
||||||
#define SetWindowLongPtr SetWindowLong
|
#define SetWindowLongPtr SetWindowLong
|
||||||
|
#undef GWLP_USERDATA
|
||||||
#define GWLP_USERDATA GWL_USERDATA
|
#define GWLP_USERDATA GWL_USERDATA
|
||||||
|
#undef DWLP_MSGRESULT
|
||||||
#define DWLP_MSGRESULT DWL_MSGRESULT
|
#define DWLP_MSGRESULT DWL_MSGRESULT
|
||||||
|
/* Since we've clobbered the above functions, we should clobber the
|
||||||
|
* associated type regardless of whether it's defined. */
|
||||||
|
#undef LONG_PTR
|
||||||
|
#define LONG_PTR LONG
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define BOXFLAGS DLGWINDOWEXTRA
|
#define BOXFLAGS DLGWINDOWEXTRA
|
||||||
#ifdef LONG_PTR
|
|
||||||
#define BOXRESULT (DLGWINDOWEXTRA + sizeof(LONG_PTR))
|
#define BOXRESULT (DLGWINDOWEXTRA + sizeof(LONG_PTR))
|
||||||
#else
|
|
||||||
#define BOXRESULT (DLGWINDOWEXTRA + 4)
|
|
||||||
#endif
|
|
||||||
#define DF_END 0x0001
|
#define DF_END 0x0001
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user