diff --git a/dialog.c b/dialog.c index 88173aee..511331d3 100644 --- a/dialog.c +++ b/dialog.c @@ -392,8 +392,8 @@ dlgcontrol *ctrl_draglist(struct controlset *s, const char *label, } dlgcontrol *ctrl_filesel(struct controlset *s, const char *label, - char shortcut, const char *filter, bool write, - const char *title, HelpCtx helpctx, + char shortcut, FILESELECT_FILTER_TYPE filter, + bool write, const char *title, HelpCtx helpctx, handler_fn handler, intorptr context) { dlgcontrol *c = ctrl_new(s, CTRL_FILESELECT, helpctx, handler, context); diff --git a/dialog.h b/dialog.h index ef9a9dfe..5ef20637 100644 --- a/dialog.h +++ b/dialog.h @@ -362,7 +362,7 @@ struct dlgcontrol { * particular platform might choose to cast integers into * this pointer type... */ - char const *filter; + FILESELECT_FILTER_TYPE filter; /* * Some systems like to know whether a file selector is * choosing a file to read or one to write (and possibly @@ -552,8 +552,8 @@ dlgcontrol *ctrl_draglist(struct controlset *, const char *label, char shortcut, HelpCtx helpctx, handler_fn handler, intorptr context); dlgcontrol *ctrl_filesel(struct controlset *, const char *label, - char shortcut, const char *filter, bool write, - const char *title, HelpCtx helpctx, + char shortcut, FILESELECT_FILTER_TYPE filter, + bool write, const char *title, HelpCtx helpctx, handler_fn handler, intorptr context); dlgcontrol *ctrl_fontsel(struct controlset *, const char *label, char shortcut, HelpCtx helpctx, diff --git a/unix/platform.h b/unix/platform.h index a75d70a6..51b89b2e 100644 --- a/unix/platform.h +++ b/unix/platform.h @@ -81,6 +81,8 @@ extern const struct BackendVtable pty_backend; typedef void *HelpCtx; #define NULL_HELPCTX ((HelpCtx)NULL) #define HELPCTX(x) NULL + +typedef const char *FILESELECT_FILTER_TYPE; #define FILTER_KEY_FILES NULL /* FIXME */ #define FILTER_DYNLIB_FILES NULL /* FIXME */ diff --git a/windows/platform.h b/windows/platform.h index 9463be4e..409aa824 100644 --- a/windows/platform.h +++ b/windows/platform.h @@ -286,6 +286,7 @@ void write_aclip(HWND hwnd, int clipboard, char *, int); * these strings are of exactly the type needed to go in * `lpstrFilter' in an OPENFILENAME structure. */ +typedef const char *FILESELECT_FILTER_TYPE; #define FILTER_KEY_FILES ("PuTTY Private Key Files (*.ppk)\0*.ppk\0" \ "All Files (*.*)\0*\0\0\0") #define FILTER_WAVE_FILES ("Wave Files (*.wav)\0*.WAV\0" \