Remove writable-strings support.

This commit is contained in:
Dimitrie O. Paun 2003-01-30 00:19:14 +00:00 committed by Alexandre Julliard
parent 07f773d917
commit d61e43ca30
2 changed files with 1 additions and 70 deletions

View File

@ -337,49 +337,11 @@ typedef const WCHAR *PCWSTR, *LPCWSTR;
* macro which only exists in the user's code.
*/
#ifndef __WINESRC__
# 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)
{
return (WCHAR*)wine_rewrite_s4tos2(str4);
}
inline WCHAR wine_unicode_text(wchar_t chr4)
{
return (WCHAR)chr4;
}
# define WINE_UNICODE_TEXT(x) wine_unicode_text(L##x)
# else /* __cplusplus */
# define WINE_UNICODE_TEXT(x) ((WCHAR*)wine_rewrite_s4tos2(L##x))
# endif /* __cplusplus */
# else /* WINE_UNICODE_REWRITE */
/* 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
typedef WCHAR TCHAR, *PTCHAR;
typedef LPWSTR PTSTR, LPTSTR;
typedef LPCWSTR PCTSTR, LPCTSTR;
# define __TEXT(string) WINE_UNICODE_TEXT(string)
# define __TEXT(string) L##string
# else /* UNICODE */
typedef CHAR TCHAR, *PTCHAR;
typedef LPSTR PTSTR, LPTSTR;

View File

@ -588,37 +588,6 @@ int wine_dlclose( void *handle, char *error, int errorsize )
#endif
}
/***********************************************************************
* wine_rewrite_s4tos2
*
* Convert 4 byte Unicode strings to 2 byte Unicode strings in-place.
* This is only practical if literal strings are writable.
*/
unsigned short* wine_rewrite_s4tos2(const wchar_t* str4 )
{
unsigned short *str2,*s2;
if (str4==NULL)
return NULL;
if ((*str4 & 0xffff0000) != 0) {
/* This string has already been converted. Return it as is */
return (unsigned short*)str4;
}
/* Note that we can also end up here if the string has a single
* character. In such a case we will convert the string over and
* over again. But this is harmless.
*/
str2=s2=(unsigned short*)str4;
do {
*s2=(unsigned short)*str4;
s2++;
} while (*str4++ != L'\0');
return str2;
}
#ifndef HAVE_ECVT
/***********************************************************************
* ecvt