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:
Václav Slavík
2007-06-10 17:14:14 +00:00
parent c475be6dfa
commit 52de37c78f
31 changed files with 1742 additions and 1643 deletions

View File

@@ -56,7 +56,11 @@
#ifdef __REG_NOFRONT
# define WXREGEX_USING_BUILTIN
# define WXREGEX_IF_NEED_LEN(x) ,x
# define WXREGEX_CHAR(x) x
# if wxUSE_UNICODE
# define WXREGEX_CHAR(x) x.wc_str()
# else
# define WXREGEX_CHAR(x) x.mb_str()
# endif
#else
# ifdef HAVE_RE_SEARCH
# define WXREGEX_IF_NEED_LEN(x) ,x
@@ -67,7 +71,7 @@
# if wxUSE_UNICODE
# define WXREGEX_CONVERT_TO_MB
# endif
# define WXREGEX_CHAR(x) wxConvertWX2MB(x)
# define WXREGEX_CHAR(x) x.mb_str()
# define wx_regfree regfree
# define wx_regerror regerror
#endif
@@ -293,8 +297,11 @@ bool wxRegExImpl::Compile(const wxString& expr, int flags)
// compile it
#ifdef WXREGEX_USING_BUILTIN
bool conv = true;
int errorcode = wx_re_comp(&m_RegEx, expr, expr.length(), flagsRE);
// FIXME-UTF8: use wc_str() after removing ANSI build
int errorcode = wx_re_comp(&m_RegEx, expr.c_str(), expr.length(), flagsRE);
#else
// FIXME-UTF8: this is potentially broken, we shouldn't even try it
// and should always use builtin regex library (or PCRE?)
const wxWX2MBbuf conv = expr.mbc_str();
int errorcode = conv ? regcomp(&m_RegEx, conv, flagsRE) : REG_BADPAT;
#endif