X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/851630e4f39057d8679720da44678e622659d9a1..0ce742cf092c9244f27957e308c16f3c2631042d:/include/wx/buffer.h?ds=sidebyside diff --git a/include/wx/buffer.h b/include/wx/buffer.h index dea159f833..afc0776994 100644 --- a/include/wx/buffer.h +++ b/include/wx/buffer.h @@ -17,14 +17,6 @@ #include "wx/wxchar.h" #include // strdup -#ifdef HAVE_WCSTR_H -#include -#elif defined( HAVE_WCHAR_H ) -#include // wchar_t -#else -#pragma error "Don't know what to do!" -#endif - // ---------------------------------------------------------------------------- // Special classes for (wide) character strings: they use malloc/free instead // of new/delete @@ -62,11 +54,13 @@ public: } operator const char *() const { return m_str; } + char operator[](size_t n) const { return m_str[n]; } private: char *m_str; }; +#if wxUSE_WCHAR_T class wxWCharBuffer { public: @@ -105,10 +99,12 @@ public: } operator const wchar_t *() const { return m_wcs; } - + wchar_t operator[](size_t n) const { return m_wcs[n]; } + private: wchar_t *m_wcs; }; +#endif #if wxUSE_UNICODE #define wxMB2WXbuf wxWCharBuffer