[PATCH 0/2] MR308: Add "wine/str.h", use "wine/heap.h" and it in winemenubuilder

Davide Beatrici (@davidebeatrici) wine at gitlab.winehq.org
Fri Jun 24 15:19:09 CDT 2022


> It doesn't reduce complexity in the usage to have two sets of functions that do the same thing only with subtle differences. Obviously you are not going to get rid of the Win32 APIs, so now you'd have to keep both sets of functions in your head to be able to understand the code.

My idea was to replace all calls to the other functions, but it would probably be a shock to anyone used to the current code.

In retrospective it's probably not worth it since, as you said, there are only subtle differences and not actual improvements.

> Note also that the vast majority of Unicode functions take character counts, so adding helpers that take byte counts would make it even harder to get right.

I actually think it's the opposite, especially when allocating memory: it's very easy to forget to multiply by `sizeof(WCHAR)`.

I'm still convinced the UTF conversion functions provided in this PR would be a great addition, but ideally they should live in `unicode.h` and not a new header.

What's the reason for the header being blocked from coexisting with `msvcrt`? Function naming conflict?

-- 
https://gitlab.winehq.org/wine/wine/-/merge_requests/308#note_2669



More information about the wine-devel mailing list