-#ifdef HAVE_STRPTIME
-
-#if wxUSE_UNIX && !defined(HAVE_STRPTIME_DECL)
- // configure detected that we had strptime() but not its declaration,
- // provide it ourselves
- extern "C" char *strptime(const char *, const char *, struct tm *);
-#endif
-
-// Unicode-friendly strptime() wrapper
-static const wxStringCharType *
-CallStrptime(const wxStringCharType *input, const char *fmt, tm *tm)
-{
- // the problem here is that strptime() returns pointer into the string we
- // passed to it while we're really interested in the pointer into the
- // original, Unicode, string so we try to transform the pointer back
-#if wxUSE_UNICODE_WCHAR
- wxCharBuffer inputMB(wxConvertWX2MB(input));
-#else // ASCII
- const char * const inputMB = input;
-#endif // Unicode/Ascii
-
- const char *result = strptime(inputMB, fmt, tm);
- if ( !result )
- return NULL;
-
-#if wxUSE_UNICODE_WCHAR
- // FIXME: this is wrong in presence of surrogates &c
- return input + (result - inputMB.data());
-#else // ASCII
- return result;
-#endif // Unicode/Ascii
-}
-
-#endif // HAVE_STRPTIME
-