1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-01 03:22:48 -05:00

Add platform-independent Unicode setup function.

Similarly to the one I just added for FontSpec: in a cross-platform
main source file, you don't really want to mess about with
per-platform ifdefs just to initialise a 'struct unicode_data' from a
Conf. But until now, you had to, because init_ucs had a different
prototype on Windows and Unix.

I plan to use this in future test programs. But an immediate positive
effect is that it removes the only platform-dependent call from
fuzzterm.c. So now that could be built on Windows too, given only an
appropriate cmake stanza. (Not that I have much idea if it's useful to
fuzz the terminal separately on multiple platforms, but it's nice to
know that it's possible if anyone does need to.)
This commit is contained in:
Simon Tatham
2023-02-18 14:10:01 +00:00
parent 4341ba6d5c
commit edce3fb9da
4 changed files with 18 additions and 3 deletions

View File

@ -21,9 +21,7 @@ int main(int argc, char **argv)
conf = conf_new();
do_defaults(NULL, conf);
init_ucs(&ucsdata, conf_get_str(conf, CONF_line_codepage),
conf_get_bool(conf, CONF_utf8_override),
CS_NONE, conf_get_int(conf, CONF_vtmode));
init_ucs_generic(conf, &ucsdata);
term = term_init(conf, &ucsdata, &termwin);
term_size(term, 24, 80, 10000);