While adding tests for this I also find a couple of things related to previous MR 1111 which I am also fixing here:
- it turns out IPV6 loopback (as in "::1") should not be mapped to ipv4-mapped loopback, ipv6 and ipv4 loopbacks are different addresses. The mapping of that was also missing htonl() for INADDR_LOOPBACK so essentially didn't break anything;
- basically the same is for INADDR_ANY (ipv6 "any" doesn't prevent binding to ipv4 "any"), although that is different when SO_EXCLUSIVEADDRUSE is used: in that case ipv6 wildcard address actually blocks ipv4 INADDR_ANY.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1196
This increases the QoS class of the main Wine thread from default to user-interactive.
`pthread_attr_set_qos_class_np` was added in the 10.10 SDK, which is our minimum requirement already.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1232
Some fonts can end up with too low height for some sizes, resulting in ppem == 0, which can lead to some metrics becoming 0 too, especially tmHeight and tmAveCharWidth. This behavior is also observed on Windows, but on Linux it could lead to division by zero. This was noticed with the font `Emmentaler-Brace`, which comes with TexLive and GNU LilyPond, in the comctl32 status test.
This patch set also tries to make the Wine behavior closer to the Windows one by enabling tmAveCharWidth to be 0 and preventing it and tmHeight from causing divisions by zero. This is very much an edge case, and I don't know if it has caused problems in actual programs, so I don't know if it would be worth it to make the behavior match exactly. But this way at least the tests should pass if some incomplete/misconfigured fonts are installed.
I mainly limited myself to win32u. I'm not sure if these changes could affect behavior in other parts of the codebase, but the tests seems unchanged.
--
v2: win32u: Allow tmAveCharWidth to be 0.
win32u: Prevent division by 0 in get_transform_matrices().
win32u: check if tmAveCharWidth is 0 before division.
win32u: Do not use SCALE_NTM if TM.tmHeight == 0.
win32u: Warn when ppem == 0.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1192