I tried to get the ReactOS NEWDEV.DLL to compile on wine, and there were many problems.
Firstly, why can't winelibs include <windows.h> and <tchar.h>? Are TCHARs even usable in winelibs?
Secondly, what the whole story with WCHARs? Why do L"Unicode string" type strings work in wine apps but not in winelibs?
And NEWDEV.DLL needs GWL_USERDATA, DWL_MSGRESULT and PSH_WIZARD97, all of which are within "#ifndef __WINESRC__" sections. Does wine assume DLLs never do user-interface stuff?
__________________________________________ Yahoo! DSL Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com
Damjan Jovanovic wrote:
Firstly, why can't winelibs include <windows.h> and <tchar.h>? Are TCHARs even usable in winelibs?
Because we need to explicitly say whether we're write a function that is ASCII or Unicode. If you use TCHARs, you can define UNICODE, and compile your program as a unicode, or not define it, and compile as ASCII. Wine needs to be both, so what should we define it to?
Secondly, what the whole story with WCHARs? Why do L"Unicode string" type strings work in wine apps but not in winelibs?
Some compilers do not support L"string". Older versions of gcc assume a wide character is 32 bytes, not 16. For compatibility with those older compilers, we are restricted to using array initializers for WCHAR strings.
And NEWDEV.DLL needs GWL_USERDATA, DWL_MSGRESULT and PSH_WIZARD97, all of which are within "#ifndef __WINESRC__" sections. Does wine assume DLLs never do user-interface stuff?
Try GWLP_USERDATA instead of GWL_USERDATA, and PSH_WIZARD97_(NEW/OLD) instead of PSH_WIZARD97. Looks like Microsoft decided to change the value of PSH_WIZARD97, as Wine needs to know both values, there needs to be a way to distinguish between them.
Mike
Mike McCormack wrote:
Secondly, what the whole story with WCHARs? Why do L"Unicode string" type strings work in wine apps but not in winelibs?
Some compilers do not support L"string". Older versions of gcc assume a wide character is 32 bytes, not 16. For compatibility with those older compilers, we are restricted to using array initializers for WCHAR strings.
In my opinion this is most unfortunate. 1. These Older versions of ... are none existent. I have never actually encountered them. Say I, some one that has one actually used. 2. It should take 10 minutes to write a Perl (/pick your script) script that pre-parses the code and changes any occurrence of above to arrays. And if it is slower than the user can take the time and do 3. 3. If a supported platform is identified that absolutely does not support compilation of 16-bit chars. We can make available gcc patches that do. 4. ./configure should check for it and add the proper make magic 5. winegcc since it was compiled with the same compiler can make it all automatic.
But in no way do I see why we have to throw away good code for bad one. Why do a compiler job?
Free Life Boaz