1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-06-30 19:12:48 -05:00

Make HelpCtx a per-platform type, not an intorptr.

Partly, this just seems more sensible, since it may well vary per
platform beyond the ability of intorptr to specify. But more
immediately it means the definition of the HELPCTX macro doesn't have
to use the P() function from dialog.h, which isn't defined in any
circumstances outside the config subsystem. And I'm about to want to
put a help context well outside that subsystem.
This commit is contained in:
Simon Tatham
2022-07-05 18:11:54 +01:00
parent a77040afa1
commit d8f8c8972a
7 changed files with 37 additions and 32 deletions

View File

@ -2131,12 +2131,12 @@ bool winctrl_context_help(struct dlgparam *dp, HWND hwnd, int id)
/*
* This is the Windows front end, so we're allowed to assume
* `helpctx.p' is a context string.
* `helpctx' is a context string.
*/
if (!c->ctrl || !c->ctrl->helpctx.p)
if (!c->ctrl || !c->ctrl->helpctx)
return false; /* no help available for this ctrl */
launch_help(hwnd, c->ctrl->helpctx.p);
launch_help(hwnd, c->ctrl->helpctx);
return true;
}

View File

@ -9,7 +9,9 @@
/* These are used in the cross-platform configuration dialog code. */
#define HELPCTX(x) P(WINHELP_CTX_ ## x)
typedef const char *HelpCtx;
#define NULL_HELPCTX NULL
#define HELPCTX(x) WINHELP_CTX_ ## x
#define WINHELP_CTX_no_help NULL