Thomas Weidenmueller wrote:
- sz = strlenW(fmt) + 1;
- sz = wcslen(fmt) + 1;
libc and wine may have differing interpretations of what wchar_t. Specifically, if -fshort-wchar is not used, wchar_t will be int, won't it?
You'd be better off using lstrlenW() than wcslen(), but that will be slow since it has an exception handler. Alexandre was talking about making an inline wine only version of lstrlenW() without the exception handler to solve that problem.
Mike
Mike McCormack wrote:
Thomas Weidenmueller wrote:
- sz = strlenW(fmt) + 1;
- sz = wcslen(fmt) + 1;
libc and wine may have differing interpretations of what wchar_t. Specifically, if -fshort-wchar is not used, wchar_t will be int, won't it?
You'd be better off using lstrlenW() than wcslen(), but that will be slow since it has an exception handler. Alexandre was talking about making an inline wine only version of lstrlenW() without the exception handler to solve that problem.
Mike
I'm sorry I don't know how these things are handled in wine. I basically made these patches so we don't depend on libunicode in reactos anymore as these things are supported by the native api. However, these functions should now basically either link to ntdll (or in the "worst" case to msvcrt). I can't even compile and link wine because I haven't managed to setup a build environment... it however works fine in reactos compiling with mingw. As I'm not familiar with libc and the other stuff wine depends on, I'd appreciate if someone who has better knowledge in this area to "fix" these patches.
It'd however be great if these libraries can be built without libunicode because it's something obsolete for reactos (and libunicode has been bugging some of us devs).
Best Regards, Thomas
Thomas Weidenmueller wrote:
I'm sorry I don't know how these things are handled in wine. I basically made these patches so we don't depend on libunicode in reactos anymore as these things are supported by the native api. However, these functions should now basically either link to ntdll (or in the "worst" case to msvcrt). I can't even compile and link wine because I haven't managed to setup a build environment... it however works fine in reactos compiling with mingw. As I'm not familiar with libc and the other stuff wine depends on, I'd appreciate if someone who has better knowledge in this area to "fix" these patches.
It'd however be great if these libraries can be built without libunicode because it's something obsolete for reactos (and libunicode has been bugging some of us devs).
How about this for ReactOS: 1. Create a replacement for include/wine/unicode.h that has the following: #define strlenW wcslen #define strcpyW wcscpy ... 2. Apply a patch to each of the DLLs that currently link with libunicode to instead link with ntdll or msvcrt.
This should have the advantage that: a. It won't break things for Wine. b. It shouldn't cause that many conflicts for ReactOS as imports don't change very often at all. c. It should pacify these touchy ReactOS developers that have a problem with libunicode.
Do you see any problems with this approach?
Rob
Robert Shearman wrote:
How about this for ReactOS:
- Create a replacement for include/wine/unicode.h that has the
following: #define strlenW wcslen #define strcpyW wcscpy ... 2. Apply a patch to each of the DLLs that currently link with libunicode to instead link with ntdll or msvcrt.
That's actually how I did it, i wasn't aware that wine/unicode.h had this stuff for the ports. It works fine this way, anyways sorry for any inconvenience.
Best Regards, Thomas
"Mike McCormack" mike@codeweavers.com wrote:
Thomas Weidenmueller wrote:
- sz = strlenW(fmt) + 1;
- sz = wcslen(fmt) + 1;
libc and wine may have differing interpretations of what wchar_t. Specifically, if -fshort-wchar is not used, wchar_t will be int, won't it?
You'd be better off using lstrlenW() than wcslen(), but that will be slow since it has an exception handler. Alexandre was talking about making an inline wine only version of lstrlenW() without the exception handler to solve that problem.
Or even better make strlenW resolve to wcslen when compiling under ReactOS.