I think there is issue with _T(x). I have this line in my Windows app that I'm compiling with WineLib (I'm using -fshort-wchar):
const TCHAR *Name() const { return _T("my_name"); };
The compiler gives me an error of:
cannot convert `const __wchar_t *' to `const TCHAR *' in return
It similarly complains about converting _T("foo") to a const WCHAR *. Both of these things work under Windows.
Changing the definition of _T(x) from L##x to (TCHAR *) L##x avoids these problems, but then something like _T("foo") _T("bar") doesn't concatenate those strings like it does in Windows.
-Steve
--- steve.lustbader@philips.com wrote:
Are _tprintf and it's related functions (_ftprintf, _stprintf) implemented? I found a tchar.h in the source tree that defines these functions, but it wasn't in my /usr/local/include/wine directory.
I'm fixing the build process to install the header. For now you can copy it manually to the /usr/local/include/wine directory. Actually _ftprintf and _stprintf are not functions, but macros which are mapped in tchar.h to corresponding ASCII or Unicode function. The underlying functions should be implemented.
These functions aren't important for wine, since they're simply defined as the ASCII or Unicode version, but they are important for WineLib.
What is the overall status of using Unicode with WineLib? What needs to be defined and what headers need to be included to get the functionality from Windows' tchar.h (_T(), TCHAR, the above functions, etc)?
Unicode is supported relatively well in Wine. Please report if you have any issues with it.
Andriy
__________________________________________________ Do you Yahoo!? Yahoo! News - Today's headlines http://news.yahoo.com
--- steve.lustbader@philips.com wrote:
I think there is issue with _T(x). I have this line in my Windows app that I'm compiling with WineLib (I'm using -fshort-wchar):
const TCHAR *Name() const { return _T("my_name"); };
The compiler gives me an error of:
cannot convert `const __wchar_t *' to `const TCHAR *' in return
It similarly complains about converting _T("foo") to a const WCHAR *. Both of these things work under Windows.
Changing the definition of _T(x) from L##x to (TCHAR *) L##x avoids these problems, but then something like _T("foo") _T("bar") doesn't concatenate those strings like it does in Windows.
-Steve
There are some issues with differences in compiler Unicode strings support one has to work around using Winelib. I'm not very good at it, probably other developers can give you more information.
Did you check out the Winelib User's Guide: http://www.winehq.org/docs/winelib-user/unicode.shtml
Andriy
__________________________________________________ Do you Yahoo!? Yahoo! News - Today's headlines http://news.yahoo.com
On Thu, 12 Sep 2002 steve.lustbader@philips.com wrote:
I think there is issue with _T(x). I have this line in my Windows app that I'm compiling with WineLib (I'm using -fshort-wchar):
const TCHAR *Name() const { return _T("my_name"); };
The compiler gives me an error of:
cannot convert `const __wchar_t *' to `const TCHAR *' in return
If you are using --fshort-wchar you should also use WINE_UNICODE_NATIVE so that WCHAR gets defined to wchar_t. From winnt.h:
#ifdef WINE_UNICODE_NATIVE typedef wchar_t WCHAR, *PWCHAR; #else typedef unsigned short WCHAR, *PWCHAR; #endif
and further down:
/* Define WINE_UNICODE_NATIVE if: * - your compiler provides a 16bit wchar_t type, e.g. gcc >= 2.96 with * -fshort-wchar option * - or if you decide to use the native 32bit Unix wchar_t type. Be aware * though that the Wine APIs only support 16bit WCHAR characters for * binary compatibility reasons. * - or define nothing at all if you don't use Unicode, and blissfully * ignore the issue :-) */
Does that help?
-- Francois Gouget fgouget@free.fr http://fgouget.free.fr/ May your Tongue stick to the Roof of your Mouth with the Force of a Thousand Caramels.