commit 5261811d471 revamped the code around pcblist structures,
alas assumes a variable mib is always present on non-Apple, non-Linux
systems when it is not. And in any case, ARRAY_SIZE should be used for
the actual structure it applies to, not a similar one.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/6183
GCC always assembles `jmp 1f` to `eb 01`, as does Clang when using -O1
or higher optimization.
But with -O0, Clang outputs `e9 01 00 00 00`.
The `subq $0xb,0x70(%rcx)` line in __wine_syscall_dispatcher relies on
`jmp 1f` being 2 bytes.
Since Wine defaults to `-g -O2` for `CFLAGS`, this wouldn't show up with a default Clang build.
But the FreeBSD `wine-devel` port must override `CFLAGS`, it uses Clang for PE and was crashing on launch.
See <https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=280000>.
Here are compiler explorer links to see the difference: [PE](https://godbolt.org/z/35TxW8dK9) and [ELF](https://godbolt.org/z/1h3j4c4ja). Adding -O1 to the clang side will make them equivalent.
I may also report this as an LLVM bug, it doesn't seem like there's any reason why Clang would prefer the long form at `-O0`.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/6179
The listview bug is caused by passing the incorrect index to the LISTVIEW_SortItems callers custom compare function. If we pass the copied array indices, which are different because of the sorting, the caller is going to use those indices for their unsorted array which don't match.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56140
--
v5: comctl32: Fix sorting for listview.
comctl32/tests: Add test for listview sorting order.
https://gitlab.winehq.org/wine/wine/-/merge_requests/6160