Attempts to make this wchar_t business compile with Borland C++ 4.52.

(While I was at it, I made the macro usage even more confus...
I mean portable... than before.)


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2232 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Ove Kaaven
1999-04-19 16:07:51 +00:00
parent 67246edee2
commit 853d7d3dc9
2 changed files with 140 additions and 55 deletions

View File

@@ -14,8 +14,8 @@
#ifndef _WX_BUFFER_H
#define _WX_BUFFER_H
#include "wx/wxchar.h"
#include <string.h> // strdup
#include <wchar.h> // wchar_t
// ----------------------------------------------------------------------------
// Special classes for (wide) character strings: they use malloc/free instead
@@ -66,9 +66,12 @@ public:
{
wxASSERT_MSG( wcs, _T("NULL string in wxWCharBuffer") );
m_wcs = wcs ? (wchar_t *)malloc((wcslen(wcs)+1)*sizeof(wchar_t))
: (wchar_t *)NULL;
if (m_wcs) wcscpy(m_wcs, wcs);
if (wcs) {
size_t siz = (wcslen(wcs)+1)*sizeof(wchar_t);
m_wcs = (wchar_t *)malloc(siz);
memcpy(m_wcs, wcs, siz);
}
else m_wcs = (wchar_t *)NULL;
}
wxWCharBuffer(size_t len)
{