use ifdef, not if, to test for HAVE_WCSRTOMBS
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35103 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
33349a2073
commit
fe19000379
@ -65,7 +65,7 @@ using namespace std ;
|
|||||||
size_t WXDLLEXPORT wxMB2WC(wchar_t *buf, const char *psz, size_t n)
|
size_t WXDLLEXPORT wxMB2WC(wchar_t *buf, const char *psz, size_t n)
|
||||||
{
|
{
|
||||||
// assume that we have mbsrtowcs() too if we have wcsrtombs()
|
// assume that we have mbsrtowcs() too if we have wcsrtombs()
|
||||||
#if HAVE_WCSRTOMBS
|
#ifdef HAVE_WCSRTOMBS
|
||||||
mbstate_t mbstate;
|
mbstate_t mbstate;
|
||||||
memset(&mbstate, 0, sizeof(mbstate_t));
|
memset(&mbstate, 0, sizeof(mbstate_t));
|
||||||
#endif
|
#endif
|
||||||
@ -91,7 +91,7 @@ size_t WXDLLEXPORT wxMB2WC(wchar_t *buf, const char *psz, size_t n)
|
|||||||
|
|
||||||
size_t WXDLLEXPORT wxWC2MB(char *buf, const wchar_t *pwz, size_t n)
|
size_t WXDLLEXPORT wxWC2MB(char *buf, const wchar_t *pwz, size_t n)
|
||||||
{
|
{
|
||||||
#if HAVE_WCSRTOMBS
|
#ifdef HAVE_WCSRTOMBS
|
||||||
mbstate_t mbstate;
|
mbstate_t mbstate;
|
||||||
memset(&mbstate, 0, sizeof(mbstate_t));
|
memset(&mbstate, 0, sizeof(mbstate_t));
|
||||||
#endif
|
#endif
|
||||||
@ -102,14 +102,14 @@ size_t WXDLLEXPORT wxWC2MB(char *buf, const wchar_t *pwz, size_t n)
|
|||||||
if (n) *buf = '\0';
|
if (n) *buf = '\0';
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#if HAVE_WCSRTOMBS
|
#ifdef HAVE_WCSRTOMBS
|
||||||
return wcsrtombs(buf, &pwz, n, &mbstate);
|
return wcsrtombs(buf, &pwz, n, &mbstate);
|
||||||
#else
|
#else
|
||||||
return wxWcstombs(buf, pwz, n);
|
return wxWcstombs(buf, pwz, n);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if HAVE_WCSRTOMBS
|
#ifdef HAVE_WCSRTOMBS
|
||||||
return wcsrtombs((char *) NULL, &pwz, 0, &mbstate);
|
return wcsrtombs((char *) NULL, &pwz, 0, &mbstate);
|
||||||
#else
|
#else
|
||||||
return wxWcstombs((char *) NULL, pwz, 0);
|
return wxWcstombs((char *) NULL, pwz, 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user