linking fix for wxUSE_WCHAR_T=0: always provide wxStrtok() unless HAVE_STRTOK_R is defined
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18866 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
545d1e6050
commit
33a7c3dd0b
@ -937,6 +937,8 @@ int wxVsprintf( wxChar *str, const wxChar *format, va_list argptr )
|
||||
|
||||
#endif // wxNEED_PRINTF_CONVERSION
|
||||
|
||||
#if wxUSE_WCHAR_T
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// ctype.h stuff (currently unused)
|
||||
// ----------------------------------------------------------------------------
|
||||
@ -1010,39 +1012,6 @@ int WXDLLEXPORT wxStrnicmp(const wxChar *s1, const wxChar *s2, size_t n)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef wxStrtok
|
||||
WXDLLEXPORT wxChar * wxStrtok(wxChar *psz, const wxChar *delim, wxChar **save_ptr)
|
||||
{
|
||||
if (!psz)
|
||||
{
|
||||
psz = *save_ptr;
|
||||
if ( !psz )
|
||||
return NULL;
|
||||
}
|
||||
|
||||
psz += wxStrspn(psz, delim);
|
||||
if (!*psz)
|
||||
{
|
||||
*save_ptr = (wxChar *)NULL;
|
||||
return (wxChar *)NULL;
|
||||
}
|
||||
|
||||
wxChar *ret = psz;
|
||||
psz = wxStrpbrk(psz, delim);
|
||||
if (!psz)
|
||||
{
|
||||
*save_ptr = (wxChar*)NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
*psz = wxT('\0');
|
||||
*save_ptr = psz + 1;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif // wxStrtok
|
||||
|
||||
#ifndef wxSetlocale
|
||||
WXDLLEXPORT wxWCharBuffer wxSetlocale(int category, const wxChar *locale)
|
||||
{
|
||||
@ -1310,7 +1279,7 @@ int WXDLLEXPORT wxSystem(const wxChar *psz)
|
||||
return system(wxConvLocal.cWX2MB(psz));
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif // wxNEED_WX_STDLIB_H
|
||||
|
||||
#ifdef wxNEED_WX_TIME_H
|
||||
WXDLLEXPORT size_t wxStrftime(wxChar *s, size_t max, const wxChar *fmt, const struct tm *tm)
|
||||
@ -1332,4 +1301,46 @@ WXDLLEXPORT size_t wxStrftime(wxChar *s, size_t max, const wxChar *fmt, const
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif // wxNEED_WX_TIME_H
|
||||
|
||||
#endif // wxUSE_WCHAR_T
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// functions which we may need even if !wxUSE_WCHAR_T
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#ifndef wxStrtok
|
||||
|
||||
WXDLLEXPORT wxChar * wxStrtok(wxChar *psz, const wxChar *delim, wxChar **save_ptr)
|
||||
{
|
||||
if (!psz)
|
||||
{
|
||||
psz = *save_ptr;
|
||||
if ( !psz )
|
||||
return NULL;
|
||||
}
|
||||
|
||||
psz += wxStrspn(psz, delim);
|
||||
if (!*psz)
|
||||
{
|
||||
*save_ptr = (wxChar *)NULL;
|
||||
return (wxChar *)NULL;
|
||||
}
|
||||
|
||||
wxChar *ret = psz;
|
||||
psz = wxStrpbrk(psz, delim);
|
||||
if (!psz)
|
||||
{
|
||||
*save_ptr = (wxChar*)NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
*psz = wxT('\0');
|
||||
*save_ptr = psz + 1;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif // wxStrtok
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user