- wxASSERT_MSG( wcs, "NULL string in wxWCharBuffer" );
-
- m_wcs = wcs ? wcsdup(wcs) : (wchar_t *)NULL;
+ wxASSERT_MSG( wcs, wxT("NULL string in wxWCharBuffer") );
+
+ if (wcs) {
+#if (defined(__BORLANDC__) && (__BORLANDC__ > 0x530))
+ size_t siz = (std::wcslen(wcs)+1)*sizeof(wchar_t);
+#else
+ size_t siz = (::wcslen(wcs)+1)*sizeof(wchar_t);
+#endif
+ m_wcs = (wchar_t *)malloc(siz);
+ memcpy(m_wcs, wcs, siz);
+ }
+ else m_wcs = (wchar_t *)NULL;
+ }
+ wxWCharBuffer(size_t len)
+ {
+ m_wcs = (wchar_t *)malloc((len+1)*sizeof(wchar_t));
+ m_wcs[len] = L'\0';