]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Portability to FreeBSD: has wchar_t but no wint_t.
authorBruno Haible <bruno@clisp.org>
Tue, 14 Jan 2003 13:18:25 +0000 (13:18 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:08:55 +0000 (12:08 +0200)
ChangeLog
libasprintf/configure.in
libasprintf/printf-args.c
libasprintf/printf-args.h
libasprintf/printf-parse.c
libasprintf/vasnprintf.c
m4/ChangeLog
m4/Makefile.am
m4/wint_t.m4 [new file with mode: 0644]

index d93af6bf7117eb2312caab6406072281e074c491..383671d5d7d83b2500a9e9c2883d8579bdaaeab0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+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.
index a7759af962130b2de552ade8a2b71215915643cd..e0595c3a397b18da82c1fdf1dde82fe241788e33 100644 (file)
@@ -32,6 +32,7 @@ AC_TYPE_SIZE_T
 gt_TYPE_LONGLONG
 gt_TYPE_LONGDOUBLE
 gt_TYPE_WCHAR_T
+gt_TYPE_WINT_T
 AC_CHECK_TYPES(ptrdiff_t)
 gt_TYPE_INTMAX_T
 
index 85731302c80a2e555e0940ea361c92c7b894143f..f3919740236455f939f6ae262280dd7d99256e66 100644 (file)
@@ -1,5 +1,5 @@
 /* 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
@@ -78,7 +78,7 @@ printf_fetchargs (va_list args, arguments *a)
       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;
index 5fcbb2ced9a94cae362cea0e60d3bd0cacd7c6dd..35114a8fad43d9e496c009ad9e09bd60a26ca282 100644 (file)
@@ -1,5 +1,5 @@
 /* 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
 
@@ -49,7 +54,7 @@ typedef enum
   TYPE_LONGDOUBLE,
 #endif
   TYPE_CHAR,
-#ifdef HAVE_WCHAR_T
+#ifdef HAVE_WINT_T
   TYPE_WIDE_CHAR,
 #endif
   TYPE_STRING,
@@ -90,7 +95,7 @@ typedef struct
     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;
index 45ed1b60d55f98a35b3ac98c795c06983e3e8b03..bdfe88fe8f8942f57fe26295a34bd2bc5e35e9c2 100644 (file)
@@ -1,5 +1,5 @@
 /* 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
@@ -380,7 +380,7 @@ printf_parse (const char *format, char_directives *d, arguments *a)
                  break;
                case 'c':
                  if (flags >= 8)
-#ifdef HAVE_WCHAR_T
+#ifdef HAVE_WINT_T
                    type = TYPE_WIDE_CHAR;
 #else
                    goto error;
@@ -388,7 +388,7 @@ printf_parse (const char *format, char_directives *d, arguments *a)
                  else
                    type = TYPE_CHAR;
                  break;
-#ifdef HAVE_WCHAR_T
+#ifdef HAVE_WINT_T
                case 'C':
                  type = TYPE_WIDE_CHAR;
                  c = 'c';
index 806cc088de9fc6a2b7d3c7898a3d72d4b2ed9f2b..e2c1b1a9c74e31f57243fac81c741afc806a7235 100644 (file)
@@ -1,5 +1,5 @@
 /* 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
@@ -357,7 +357,7 @@ vasnprintf (char *resultbuf, size_t *lengthp, const char *format, va_list args)
                      break;
 
                    case 'c':
-# ifdef HAVE_WCHAR_T
+# ifdef HAVE_WINT_T
                      if (type == TYPE_WIDE_CHAR)
                        tmp_length = MB_CUR_MAX;
                      else
@@ -452,8 +452,10 @@ vasnprintf (char *resultbuf, size_t *lengthp, const char *format, va_list args)
 #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';
@@ -630,7 +632,7 @@ vasnprintf (char *resultbuf, size_t *lengthp, const char *format, va_list args)
                          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;
index 6c602ecf1f229d4065dd7120993cd5d06fb222b8..884e489f4763770f1f114ee3c7a5f5fafc210778 100644 (file)
@@ -1,3 +1,8 @@
+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
index baf0a2be60ca6b72b8b0d45ba887e97e97ae0ab7..b22a795fc0dea5f40388b9287ce88eae04db69ce 100644 (file)
@@ -14,4 +14,4 @@ javaexec.m4 lcmessage.m4 lib-ld.m4 lib-link.m4 lib-prefix.m4 libtool.m4 \
 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
diff --git a/m4/wint_t.m4 b/m4/wint_t.m4
new file mode 100644 (file)
index 0000000..9ed3c98
--- /dev/null
@@ -0,0 +1,22 @@
+# 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
+])