Contrary to the comment in wx/wxcrtbase.h, wcsftime() doesn't seem to be
available under quite all the systems, notably it doesn't seem to be present
in OpenBSD at all, even in the very latest version.
Add a configure test for this function and fall back to our own implementation
if the system doesn't have it.
Closes #12766.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66446
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
-for ac_func in wcsdup strnlen wcsnlen wcscasecmp wcsncasecmp
+
+for ac_func in wcsdup wcsftime strnlen wcsnlen wcscasecmp wcsncasecmp
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
{ echo "$as_me:$LINENO: checking for $ac_func" >&5
AC_DEFINE(HAVE_WCSLEN)
fi
-AC_CHECK_FUNCS([wcsdup strnlen wcsnlen wcscasecmp wcsncasecmp])
+AC_CHECK_FUNCS([wcsdup wcsftime strnlen wcsnlen wcscasecmp wcsncasecmp])
dnl On HP-UX aCC need this define to find mbstrtowcs() &c
dnl Can't be used for g++ since the mbstate_t in wchar.h can conflict
_xpg5_wcsftime(wchar_t *, size_t, const wchar_t *, const struct tm * );
#define wxCRT_StrftimeW _xpg5_wcsftime
#else
- #ifndef __WXPALMOS__
- // assume it's always available, this does seem to be the case for now
+ // Assume it's always available under non-Unix systems with the exception
+ // of Palm OS, this does seem to be the case for now. And under Unix we
+ // trust configure to detect it (except for SGI special case above).
+ #if defined(HAVE_WCSFTIME) || \
+ !(defined(__UNIX__) || defined(__WXPALMOS__))
#define wxCRT_StrftimeW wcsftime
#endif /* ! __WXPALMOS__ */
#endif
/* Define if you have wcsdup function */
#undef HAVE_WCSDUP
+/* Define if you have wcsftime() function */
+#undef HAVE_WCSFTIME
+
/* Define if you have strnlen() function */
#undef HAVE_STRNLEN
/* Define if you have wcsdup function */
#undef HAVE_WCSDUP
+/* Define if you have wcsftime() function */
+#define HAVE_WCSFTIME 1
+
/* Define if you have strnlen() function */
#define HAVE_STRNLEN 1