1. made CRT wrappers definitions indepenent of wxUSE_UNICODE: both ANSI and Unicode variants are now defined
2. split wxcrt.h into wxcrtbase.h with lowlevel compiler-specific definitions and wxcrt.h with ANSI- and Unicode-compatible wx wrappers git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@46390 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -13,17 +13,12 @@
|
||||
#define _WX_BUFFER_H
|
||||
|
||||
#include "wx/chartype.h"
|
||||
#include "wx/wxcrt.h"
|
||||
#include "wx/wxcrtbase.h"
|
||||
|
||||
#include <stdlib.h> // malloc() and free()
|
||||
|
||||
class WXDLLIMPEXP_BASE wxCStrData;
|
||||
|
||||
inline char *wxStrDup(const char *s) { return wxStrdupA(s); }
|
||||
#if wxUSE_WCHAR_T
|
||||
inline wchar_t *wxStrDup(const wchar_t *ws) { return wxStrdupW(ws); }
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Special classes for (wide) character strings: they use malloc/free instead
|
||||
// of new/delete
|
||||
@@ -36,7 +31,7 @@ public:
|
||||
typedef T CharType;
|
||||
|
||||
wxCharTypeBuffer(const CharType *str = NULL)
|
||||
: m_str(str ? wxStrDup(str) : NULL),
|
||||
: m_str(str ? wxStrdup(str) : NULL),
|
||||
m_owned(true)
|
||||
{
|
||||
}
|
||||
@@ -103,7 +98,7 @@ public:
|
||||
{
|
||||
if ( m_owned )
|
||||
free(m_str);
|
||||
m_str = str ? wxStrDup(str) : NULL;
|
||||
m_str = str ? wxStrdup(str) : NULL;
|
||||
m_owned = true;
|
||||
return *this;
|
||||
}
|
||||
|
Reference in New Issue
Block a user