C testing framework. ASCII/Unicode portable version

Alexandre Julliard julliard at winehq.com
Wed Jan 23 11:49:19 CST 2002


"Dimitrie O. Paun" <dimi at cs.toronto.edu> writes:

> Sorry, maybe I miss something, but I don't understand why it wouldn't:
> 
> BOOL      WINAPI CopyFileA(LPCSTR,LPCSTR,BOOL);
> BOOL      WINAPI CopyFileW(LPCWSTR,LPCWSTR,BOOL);
> #define     CopyFile WINELIB_NAME_AW(CopyFile)
> 
> which means that if we use the explicit A or W versions, it will compile
> no matter what mode we're using.

Sure, in isolation it will work, but try integrating that in a test
using TCHARs. For instance:

TSTR filename = _T("some_file");

handle = CreateFile(filename,...);
WriteFile( handle, ...);
etc.
CopyFile( filename, _T("newfile"), FALSE );
/* now test some Unicode chars */
CopyFileW( filename, L"unicode_file_name", FALSE );

This won't work because you can't pass a TSTR to a W function. So you
either need #ifdefs, or you need to use W functions and WCHAR
throughout, which means you don't need TCHAR at all.

-- 
Alexandre Julliard
julliard at winehq.com




More information about the wine-devel mailing list