+2003-08-11 Bruno Haible <bruno@clisp.org>
+
+ * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
+ (vasnprintf): Use it instead of wcslen.
+
2003-08-11 Bruno Haible <bruno@clisp.org>
* stdbool_.h (_Bool): Undo last change; instead use a negative enum
# define freea(p) free (p)
#endif
+#ifdef HAVE_WCHAR_T
+# ifdef HAVE_WCSLEN
+# define local_wcslen wcslen
+# else
+ /* Solaris 2.5.1 has wcslen() in a separate library libw.so. To avoid
+ a dependency towards this library, here is a local substitute. */
+static size_t
+local_wcslen (const wchar_t *s)
+{
+ const wchar_t *ptr;
+
+ for (ptr = s; *ptr != (wchar_t) 0; ptr++)
+ ;
+ return ptr - s;
+}
+# endif
+#endif
+
char *
vasnprintf (char *resultbuf, size_t *lengthp, const char *format, va_list args)
{
# ifdef HAVE_WCHAR_T
if (type == TYPE_WIDE_STRING)
tmp_length =
- wcslen (a.arg[dp->arg_index].a.a_wide_string)
+ local_wcslen (a.arg[dp->arg_index].a.a_wide_string)
* MB_CUR_MAX;
else
# endif
+2003-08-11 Bruno Haible <bruno@clisp.org>
+
+ * vasnprintf.m4 (gl_PREREQ_VASNPRINTF): Also check for wcslen.
+
2003-08-09 Paul Eggert <eggert@twinsun.com>
* regex.m4 (jm_INCLUDED_REGEX): Change "\201" to "\371";
-# vasnprintf.m4 serial 1
+# vasnprintf.m4 serial 2
dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
dnl This file is free software, distributed under the terms of the GNU
dnl General Public License. As a special exception to the GNU General
AC_REQUIRE([gt_TYPE_LONGDOUBLE])
AC_REQUIRE([gt_TYPE_WCHAR_T])
AC_REQUIRE([gt_TYPE_WINT_T])
- AC_CHECK_FUNCS(snprintf)
+ AC_CHECK_FUNCS(snprintf wcslen)
])
# Prerequisites of lib/asnprintf.c.