From 880cd395b7c38cb2ad4140f52cff18ba3c88da08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Gouget?= Date: Wed, 28 Feb 2001 05:18:54 +0000 Subject: [PATCH] WINE_UNICODE_TEXT was incorrect. Dropped support for WINE_UNICODE_TEXT('c') in C. --- include/winnt.h | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/include/winnt.h b/include/winnt.h index b13d8948d47..a1428ce910b 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -287,6 +287,13 @@ typedef const WCHAR *PCWSTR, *LPCWSTR; */ #ifndef __WINE__ # ifdef WINE_UNICODE_REWRITE + +/* Use this if your compiler does not provide a 16bit wchar_t type. + * Note that you will need to specify -fwritable-strings or an option + * to this effect. + * In C++ both WINE_UNICODE_TEXT('c') and WINE_UNICODE_TEXT("str") are + * supported, but only the string form can be supported in C. + */ EXTERN_C unsigned short* wine_rewrite_s4tos2(const wchar_t* str4); # ifdef __cplusplus inline WCHAR* wine_unicode_text(const wchar_t* str4) @@ -299,13 +306,22 @@ inline WCHAR wine_unicode_text(wchar_t chr4) } # define WINE_UNICODE_TEXT(x) wine_unicode_text(L##x) # else /* __cplusplus */ -# define WINE_UNICODE_TEXT(x) ((sizeof(x)==1) || (sizeof(L##x)>4) ? \ - (WCHAR*)wine_rewrite_s4tos2(L##x) : \ - ((WCHAR)L##x)) +# define WINE_UNICODE_TEXT(x) ((WCHAR*)wine_rewrite_s4tos2(L##x)) # endif /* __cplusplus */ + # else /* WINE_UNICODE_REWRITE */ -/* WINE_UNICODE_NATIVE or nothing at all */ + +/* 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 :-) + */ # define WINE_UNICODE_TEXT(string) L##string + # endif /* WINE_UNICODE_REWRITE */ # ifdef UNICODE