Assume sizeof(wchar_t) is always 4 under OS X.

wchar_t used to be 2 bytes in Mach-O builds but they're not supported any
longer so remove the code checking for sizeof(wchar_t) and just assume it's
always 4.

Closes #10442.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66028 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2010-11-05 21:38:25 +00:00
parent f40377bedc
commit b7db378853
4 changed files with 5 additions and 39 deletions

View File

@@ -696,10 +696,6 @@ wxString wxCFStringRef::AsString( NSString* ref, wxFontEncoding encoding )
wxMacUniCharBuffer::wxMacUniCharBuffer( const wxString &str )
{
m_chars = str.length() ;
m_ubuf = NULL ;
#if SIZEOF_WCHAR_T == 4
wxMBConvUTF16 converter ;
#if wxUSE_UNICODE
size_t unicharlen = converter.WC2MB( NULL , str.wc_str() , 0 ) ;
@@ -712,17 +708,6 @@ wxMacUniCharBuffer::wxMacUniCharBuffer( const wxString &str )
converter.WC2MB( (char*) m_ubuf , wchar.data() , unicharlen + 2 ) ;
#endif
m_chars = unicharlen / 2 ;
#else // SIZEOF_WCHAR_T is then 2
#if wxUSE_UNICODE
m_ubuf = malloc( m_chars * 2 + 2 ) ;
memcpy( m_ubuf , (UniChar*) str.wc_str() , m_chars * 2 + 2 ) ;
#else
wxWCharBuffer wchar = str.wc_str( wxConvLocal ) ;
m_chars = wxWcslen( wchar.data() ) ;
m_ubuf = malloc( m_chars * 2 + 2 ) ;
memcpy( m_ubuf , (UniChar*) wchar.data() , m_chars * 2 + 2 ) ;
#endif
#endif
}
wxMacUniCharBuffer::~wxMacUniCharBuffer()