From d61e43ca30f6798bd4b4cc8392d03331c6a9372c Mon Sep 17 00:00:00 2001 From: "Dimitrie O. Paun" Date: Thu, 30 Jan 2003 00:19:14 +0000 Subject: [PATCH] Remove writable-strings support. --- include/winnt.h | 40 +--------------------------------------- library/port.c | 31 ------------------------------- 2 files changed, 1 insertion(+), 70 deletions(-) diff --git a/include/winnt.h b/include/winnt.h index 25b4edb09d..8d62c843c6 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -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; diff --git a/library/port.c b/library/port.c index 8033934694..89caf58a02 100644 --- a/library/port.c +++ b/library/port.c @@ -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 -- 2.32.0.93.g670b81a890