+2003-01-12 Bruno Haible <bruno@clisp.org>
+
+ Portability to FreeBSD.
+ * configure.in: Invoke gt_TYPE_WINT_T.
+ * printf-args.h: Use HAVE_WINT_T, not HAVE_WCHAR_T, to check for
+ availability of wint_t.
+ * printf-argc.c: Likewise.
+ * printf-parse.c: Likewise.
+ * vasnprintf.c: Likewise.
+
2002-12-16 Bruno Haible <bruno@clisp.org>
* configure.in: Add test for <utime.h>. Needed for mingw32.
gt_TYPE_LONGLONG
gt_TYPE_LONGDOUBLE
gt_TYPE_WCHAR_T
+gt_TYPE_WINT_T
AC_CHECK_TYPES(ptrdiff_t)
gt_TYPE_INTMAX_T
/* Decomposed printf argument list.
- Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
case TYPE_CHAR:
ap->a.a_char = va_arg (args, int);
break;
-#ifdef HAVE_WCHAR_T
+#ifdef HAVE_WINT_T
case TYPE_WIDE_CHAR:
ap->a.a_wide_char = va_arg (args, wint_t);
break;
/* Decomposed printf argument list.
- Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
#ifndef _PRINTF_ARGS_H
#define _PRINTF_ARGS_H
-/* Get wint_t. */
+/* Get wchar_t. */
#ifdef HAVE_WCHAR_T
+# include <stddef.h>
+#endif
+
+/* Get wint_t. */
+#ifdef HAVE_WINT_T
# include <wchar.h>
#endif
TYPE_LONGDOUBLE,
#endif
TYPE_CHAR,
-#ifdef HAVE_WCHAR_T
+#ifdef HAVE_WINT_T
TYPE_WIDE_CHAR,
#endif
TYPE_STRING,
long double a_longdouble;
#endif
int a_char;
-#ifdef HAVE_WCHAR_T
+#ifdef HAVE_WINT_T
wint_t a_wide_char;
#endif
const char* a_string;
/* Formatted output to strings.
- Copyright (C) 1999-2000, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999-2000, 2002-2003 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
break;
case 'c':
if (flags >= 8)
-#ifdef HAVE_WCHAR_T
+#ifdef HAVE_WINT_T
type = TYPE_WIDE_CHAR;
#else
goto error;
else
type = TYPE_CHAR;
break;
-#ifdef HAVE_WCHAR_T
+#ifdef HAVE_WINT_T
case 'C':
type = TYPE_WIDE_CHAR;
c = 'c';
/* vsprintf with automatic memory allocation.
- Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
break;
case 'c':
-# ifdef HAVE_WCHAR_T
+# ifdef HAVE_WINT_T
if (type == TYPE_WIDE_CHAR)
tmp_length = MB_CUR_MAX;
else
#endif
case TYPE_LONGINT:
case TYPE_ULONGINT:
-#ifdef HAVE_WCHAR_T
+#ifdef HAVE_WINT_T
case TYPE_WIDE_CHAR:
+#endif
+#ifdef HAVE_WCHAR_T
case TYPE_WIDE_STRING:
#endif
*p++ = 'l';
SNPRINTF_BUF (arg);
}
break;
-#ifdef HAVE_WCHAR_T
+#ifdef HAVE_WINT_T
case TYPE_WIDE_CHAR:
{
wint_t arg = a.arg[dp->arg_index].a.a_wide_char;
+2003-01-12 Bruno Haible <bruno@clisp.org>
+
+ * wint_t.m4: New file.
+ * Makefile.am (EXTRA_DIST): Add it.
+
2003-01-08 Bruno Haible <bruno@clisp.org>
* gettext.m4 (AM_PO_SUBDIRS): Avoid warning when there are at least
longdouble.m4 longlong.m4 mbrtowc.m4 mbstate_t.m4 mbswidth.m4 mkdtemp.m4 \
progtest.m4 setenv.m4 setlocale.m4 siginfo.m4 signalblocking.m4 signed.m4 \
ssize_t.m4 stdbool.m4 stdint_h.m4 tmpdir.m4 uintmax_t.m4 ulonglong.m4 \
-unionwait.m4 wchar_t.m4
+unionwait.m4 wchar_t.m4 wint_t.m4
--- /dev/null
+# wint_t.m4 serial 1
+dnl Copyright (C) 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
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Bruno Haible.
+dnl Test whether <wchar.h> has the 'wint_t' type.
+dnl Prerequisite: AC_PROG_CC
+
+AC_DEFUN([gt_TYPE_WINT_T],
+[
+ AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t,
+ [AC_TRY_COMPILE([#include <wchar.h>
+ wint_t foo = (wchar_t)'\0';], ,
+ gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)])
+ if test $gt_cv_c_wint_t = yes; then
+ AC_DEFINE(HAVE_WINT_T, 1, [Define if you have the 'wint_t' type.])
+ fi
+])