// Created: 09/04/99
// RCS-ID: $Id$
// Copyright: (c) wxWindows copyright
-// Licence: wxWindows license
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
#include <winnt.h>
#endif
+#if defined(__MWERKS__) && __MSL__ >= 0x6000
+using namespace std ;
+#endif
+
#if wxUSE_WCHAR_T
size_t WXDLLEXPORT wxMB2WC(wchar_t *buf, const char *psz, size_t n)
{
bool WXDLLEXPORT wxOKlibc()
{
-#if wxUSE_WCHAR_T && defined(__UNIX__) && defined(__GLIBC__)
+#if wxUSE_WCHAR_T && defined(__UNIX__) && defined(__GLIBC__) && !defined(__WINE__)
// glibc 2.0 uses UTF-8 even when it shouldn't
wchar_t res = 0;
if ((MB_CUR_MAX == 2) &&
{
va_list argptr;
va_start(argptr, format);
-
int ret = vfwscanf(stream, wxFormatConverter(format), argptr);
va_end(argptr);
#endif // wxNEED_PRINTF_CONVERSION
+#if wxUSE_WCHAR_T
+
// ----------------------------------------------------------------------------
// ctype.h stuff (currently unused)
// ----------------------------------------------------------------------------
}
#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)
{
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)
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
+