]> Savannah Git Hosting - gnulib.git/commitdiff
Assume wchar_t.
authorBruno Haible <bruno@clisp.org>
Thu, 13 Jun 2024 22:28:45 +0000 (00:28 +0200)
committerBruno Haible <bruno@clisp.org>
Thu, 13 Jun 2024 22:28:45 +0000 (00:28 +0200)
* lib/stddef.in.h (wchar_t): Remove fallback definition.
* m4/stddef_h.m4 (gl_STDDEF_H): Don't require gt_TYPE_WCHAR_T. Assume
gt_cv_c_wchar_t is 'yes'.
(gl_STDDEF_H_DEFAULTS): Don't initialize HAVE_WCHAR_T.
* modules/stddef (Files): Remove m4/wchar_t.m4.
(Makefile.am): Don't substitute HAVE_WCHAR_T.
* doc/posix-headers/stddef.texi: Don't mention the problem of a missing
wchar_t.

* lib/printf-args.h (arg_type): Assume HAVE_WCHAR_T is 1.
* lib/printf-args.c (PRINTF_FETCHARGS): Likewise.
* lib/printf-parse.c (PRINTF_PARSE): Likewise.
* lib/vasnprintf.c: Likewise.
* m4/vasnprintf.m4 (gl_PREREQ_PRINTF_ARGS, gl_PREREQ_PRINTF_PARSE,
gl_PREREQ_VASNXPRINTF): Don't require gt_TYPE_WCHAR_T.
* modules/c-vasnprintf (Files): Remove m4/wchar_t.m4.
* modules/vasnprintf (Files): Likewise.
* modules/vasnwprintf (Files): Likewise.
* modules/unistdio/u16-u16-vasnprintf (Files): Likewise.
* modules/unistdio/u16-vasnprintf (Files): Likewise.
* modules/unistdio/u32-u32-vasnprintf (Files): Likewise.
* modules/unistdio/u32-vasnprintf (Files): Likewise.
* modules/unistdio/u8-u8-vasnprintf (Files): Likewise.
* modules/unistdio/u8-vasnprintf (Files): Likewise.
* modules/unistdio/ulc-vasnprintf (Files): Likewise.
* tests/test-sprintf-posix.h (test_function): Assume HAVE_WCHAR_T is 1.
* tests/test-snprintf-posix.h (test_function): Likewise.
* tests/test-vasnprintf-posix.c (test_function): Likewise.
* tests/test-vasnwprintf-posix.c (test_function): Likewise.
* tests/test-vasprintf-posix.c (test_function): Likewise.

* m4/wcwidth.m4 (gl_FUNC_WCWIDTH): Don't require gt_TYPE_WCHAR_T.
* modules/wcwidth (Files): Remove m4/wchar_t.m4.

* tests/test-stdint.c: Assume HAVE_WCHAR_T is 1.
* modules/stdint-tests (Files): Remove m4/wchar_t.m4.
(configure.ac): Don't require gt_TYPE_WCHAR_T.

* m4/wchar_t.m4: Remove file.

30 files changed:
ChangeLog
doc/posix-headers/stddef.texi
lib/printf-args.c
lib/printf-args.h
lib/printf-parse.c
lib/stddef.in.h
lib/vasnprintf.c
m4/stddef_h.m4
m4/vasnprintf.m4
m4/wchar_t.m4 [deleted file]
m4/wcwidth.m4
modules/c-vasnprintf
modules/stddef
modules/stdint-tests
modules/unistdio/u16-u16-vasnprintf
modules/unistdio/u16-vasnprintf
modules/unistdio/u32-u32-vasnprintf
modules/unistdio/u32-vasnprintf
modules/unistdio/u8-u8-vasnprintf
modules/unistdio/u8-vasnprintf
modules/unistdio/ulc-vasnprintf
modules/vasnprintf
modules/vasnwprintf
modules/wcwidth
tests/test-snprintf-posix.h
tests/test-sprintf-posix.h
tests/test-stdint.c
tests/test-vasnprintf-posix.c
tests/test-vasnwprintf-posix.c
tests/test-vasprintf-posix.c

index 0b7c85c0e8b3020b7b963ad7638bff7466d00099..a46eb4f1e5e5e5a2d87fd0e731a7688a1d1db88e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,46 @@
+2024-06-13  Bruno Haible  <bruno@clisp.org>
+
+       Assume wchar_t.
+       * lib/stddef.in.h (wchar_t): Remove fallback definition.
+       * m4/stddef_h.m4 (gl_STDDEF_H): Don't require gt_TYPE_WCHAR_T. Assume
+       gt_cv_c_wchar_t is 'yes'.
+       (gl_STDDEF_H_DEFAULTS): Don't initialize HAVE_WCHAR_T.
+       * modules/stddef (Files): Remove m4/wchar_t.m4.
+       (Makefile.am): Don't substitute HAVE_WCHAR_T.
+       * doc/posix-headers/stddef.texi: Don't mention the problem of a missing
+       wchar_t.
+       --
+       * lib/printf-args.h (arg_type): Assume HAVE_WCHAR_T is 1.
+       * lib/printf-args.c (PRINTF_FETCHARGS): Likewise.
+       * lib/printf-parse.c (PRINTF_PARSE): Likewise.
+       * lib/vasnprintf.c: Likewise.
+       * m4/vasnprintf.m4 (gl_PREREQ_PRINTF_ARGS, gl_PREREQ_PRINTF_PARSE,
+       gl_PREREQ_VASNXPRINTF): Don't require gt_TYPE_WCHAR_T.
+       * modules/c-vasnprintf (Files): Remove m4/wchar_t.m4.
+       * modules/vasnprintf (Files): Likewise.
+       * modules/vasnwprintf (Files): Likewise.
+       * modules/unistdio/u16-u16-vasnprintf (Files): Likewise.
+       * modules/unistdio/u16-vasnprintf (Files): Likewise.
+       * modules/unistdio/u32-u32-vasnprintf (Files): Likewise.
+       * modules/unistdio/u32-vasnprintf (Files): Likewise.
+       * modules/unistdio/u8-u8-vasnprintf (Files): Likewise.
+       * modules/unistdio/u8-vasnprintf (Files): Likewise.
+       * modules/unistdio/ulc-vasnprintf (Files): Likewise.
+       * tests/test-sprintf-posix.h (test_function): Assume HAVE_WCHAR_T is 1.
+       * tests/test-snprintf-posix.h (test_function): Likewise.
+       * tests/test-vasnprintf-posix.c (test_function): Likewise.
+       * tests/test-vasnwprintf-posix.c (test_function): Likewise.
+       * tests/test-vasprintf-posix.c (test_function): Likewise.
+       --
+       * m4/wcwidth.m4 (gl_FUNC_WCWIDTH): Don't require gt_TYPE_WCHAR_T.
+       * modules/wcwidth (Files): Remove m4/wchar_t.m4.
+       --
+       * tests/test-stdint.c: Assume HAVE_WCHAR_T is 1.
+       * modules/stdint-tests (Files): Remove m4/wchar_t.m4.
+       (configure.ac): Don't require gt_TYPE_WCHAR_T.
+       --
+       * m4/wchar_t.m4: Remove file.
+
 2024-06-13  Yves Orton  <demerphq@gmail.com>
 
        gitlog-to-changelog: Ensure that use of keys() is deterministic.
index 4d0e171b8d73a87fd2b6871447074ff097409cec..f04b842f8d278f5f56a37730fb74300e6d620b14 100644 (file)
@@ -19,9 +19,6 @@ NetBSD 8.0, Solaris 11.0, and others.
 @code{max_align_t} does not have the expected alignment on some platforms:
 NetBSD 8.0/x86, AIX 7.2 with xlc in 64-bit mode.
 
-@item
-Some old platforms fail to provide @code{wchar_t}.
-
 @item
 Some platforms provide a @code{NULL} macro that cannot be used in arbitrary
 expressions:
index eb0d2cdc0f4b596a0804c36aa0257f680d7922d8..c20225039d2042564b029d03a3cbcf4046382087 100644 (file)
@@ -198,7 +198,6 @@ PRINTF_FETCHARGS (va_list args, arguments *a)
         if (ap->a.a_string == NULL)
           ap->a.a_string = "(NULL)";
         break;
-#if HAVE_WCHAR_T
       case TYPE_WIDE_STRING:
         ap->a.a_wide_string = va_arg (args, const wchar_t *);
         /* A null pointer is an invalid argument for "%ls", but in practice
@@ -216,7 +215,6 @@ PRINTF_FETCHARGS (va_list args, arguments *a)
             ap->a.a_wide_string = wide_null_string;
           }
         break;
-#endif
       case TYPE_POINTER:
         ap->a.a_pointer = va_arg (args, void *);
         break;
index 9b80bb39290616a0bc6d3729f6fa51427fbcbe45..24a86748b15906c25aa61da02335c0d0e4136e7b 100644 (file)
 # define PRINTF_FETCHARGS printf_fetchargs
 #endif
 
-/* Get size_t.  */
+/* Get size_t, wchar_t.  */
 #include <stddef.h>
 
-/* Get wchar_t.  */
-#if HAVE_WCHAR_T
-# include <stddef.h>
-#endif
-
 /* Get wint_t.  */
 #if HAVE_WINT_T
 # include <wchar.h>
@@ -89,9 +84,7 @@ typedef enum
   TYPE_WIDE_CHAR,
 #endif
   TYPE_STRING,
-#if HAVE_WCHAR_T
   TYPE_WIDE_STRING,
-#endif
   TYPE_POINTER,
   TYPE_COUNT_SCHAR_POINTER,
   TYPE_COUNT_SHORT_POINTER,
@@ -154,9 +147,7 @@ typedef struct
     wint_t                      a_wide_char;
 #endif
     const char*                 a_string;
-#if HAVE_WCHAR_T
     const wchar_t*              a_wide_string;
-#endif
     void*                       a_pointer;
     signed char *               a_count_schar_pointer;
     short *                     a_count_short_pointer;
index a33e27a0b8fd60be736db9972d1bb4c7e8805078..7628cb2335978ede4cbf28aa6a96d0f5af9524b8 100644 (file)
@@ -600,20 +600,14 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
                 if (signed_type == TYPE_LONGINT
                     /* For backward compatibility only.  */
                     || signed_type == TYPE_LONGLONGINT)
-#if HAVE_WCHAR_T
                   type = TYPE_WIDE_STRING;
-#else
-                  goto error;
-#endif
                 else
                   type = TYPE_STRING;
                 break;
-#if HAVE_WCHAR_T
               case 'S':
                 type = TYPE_WIDE_STRING;
                 c = 's';
                 break;
-#endif
               case 'p':
                 type = TYPE_POINTER;
                 break;
index 63bb500e2621faf2774a8b369a0aed055c7c8cf6..0abc44970433110928922134341d433d4b7d1e46 100644 (file)
@@ -149,11 +149,6 @@ typedef long max_align_t;
 # endif
 #endif
 
-/* Some platforms lack wchar_t.  */
-#if !@HAVE_WCHAR_T@
-# define wchar_t int
-#endif
-
 /* Some platforms lack max_align_t.  The check for _GCC_MAX_ALIGN_T is
    a hack in case the configure-time test was done with g++ even though
    we are currently compiling with gcc.
index ac8dc8619e554ca409e13266d3fe9c78d7b1bbd4..03a7da71f9e5ae73a6f1c626e08a804f5c641e6e 100644 (file)
@@ -247,7 +247,7 @@ local_strnlen (const char *string, size_t maxlen)
 # endif
 #endif
 
-#if (((!USE_SNPRINTF || WIDE_CHAR_VERSION || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || NEED_WPRINTF_DIRECTIVE_LC) && WIDE_CHAR_VERSION) || ((!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || NEED_PRINTF_DIRECTIVE_LS) && !WIDE_CHAR_VERSION && DCHAR_IS_TCHAR)) && HAVE_WCHAR_T
+#if ((!USE_SNPRINTF || WIDE_CHAR_VERSION || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || NEED_WPRINTF_DIRECTIVE_LC) && WIDE_CHAR_VERSION) || ((!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || NEED_PRINTF_DIRECTIVE_LS) && !WIDE_CHAR_VERSION && DCHAR_IS_TCHAR)
 # if HAVE_WCSLEN
 #  define local_wcslen wcslen
 # else
@@ -270,7 +270,7 @@ local_wcslen (const wchar_t *s)
 # endif
 #endif
 
-#if (!USE_SNPRINTF || (WIDE_CHAR_VERSION && DCHAR_IS_TCHAR) || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF) && HAVE_WCHAR_T && WIDE_CHAR_VERSION
+#if (!USE_SNPRINTF || (WIDE_CHAR_VERSION && DCHAR_IS_TCHAR) || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF) && WIDE_CHAR_VERSION
 # if HAVE_WCSNLEN && HAVE_DECL_WCSNLEN
 #  define local_wcsnlen wcsnlen
 # else
@@ -289,7 +289,7 @@ local_wcsnlen (const wchar_t *s, size_t maxlen)
 # endif
 #endif
 
-#if (((!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || NEED_PRINTF_DIRECTIVE_LS || ENABLE_WCHAR_FALLBACK) && HAVE_WCHAR_T) || ((NEED_PRINTF_DIRECTIVE_LC || ENABLE_WCHAR_FALLBACK) && HAVE_WINT_T)) && !WIDE_CHAR_VERSION
+#if ((!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || NEED_PRINTF_DIRECTIVE_LS || ENABLE_WCHAR_FALLBACK) || ((NEED_PRINTF_DIRECTIVE_LC || ENABLE_WCHAR_FALLBACK) && HAVE_WINT_T)) && !WIDE_CHAR_VERSION
 # if ENABLE_WCHAR_FALLBACK
 static size_t
 wctomb_fallback (char *s, wchar_t wc)
@@ -2148,10 +2148,9 @@ MAX_ROOM_NEEDED (const arguments *ap, size_t arg_index, FCHAR_T conversion,
       break;
 
     case 's':
-# if HAVE_WCHAR_T
       if (type == TYPE_WIDE_STRING)
         {
-#  if WIDE_CHAR_VERSION
+# if WIDE_CHAR_VERSION
           /* ISO C says about %ls in fwprintf:
                "If the precision is not specified or is greater than the size
                 of the array, the array shall contain a null wide character."
@@ -2162,7 +2161,7 @@ MAX_ROOM_NEEDED (const arguments *ap, size_t arg_index, FCHAR_T conversion,
             tmp_length = local_wcsnlen (arg, precision);
           else
             tmp_length = local_wcslen (arg);
-#  else
+# else
           /* ISO C says about %ls in fprintf:
                "If a precision is specified, no more than that many bytes are
                 written (including shift sequences, if any), and the array
@@ -2173,10 +2172,9 @@ MAX_ROOM_NEEDED (const arguments *ap, size_t arg_index, FCHAR_T conversion,
              So if there is a precision, we must not use wcslen.  */
           /* This case has already been handled separately in VASNPRINTF.  */
           abort ();
-#  endif
+# endif
         }
       else
-# endif
         {
 # if WIDE_CHAR_VERSION
           /* ISO C says about %s in fwprintf:
@@ -2949,7 +2947,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                 }
               }
 #endif
-#if (!USE_SNPRINTF || WIDE_CHAR_VERSION || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || NEED_PRINTF_DIRECTIVE_LS || ENABLE_WCHAR_FALLBACK) && HAVE_WCHAR_T
+#if !USE_SNPRINTF || WIDE_CHAR_VERSION || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || NEED_PRINTF_DIRECTIVE_LS || ENABLE_WCHAR_FALLBACK
             else if (dp->conversion == 's'
 # if WIDE_CHAR_VERSION
                      && a.arg[dp->arg_index].type != TYPE_WIDE_STRING
@@ -6021,9 +6019,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                   #if HAVE_WINT_T
                   case TYPE_WIDE_CHAR:
                   #endif
-                  #if HAVE_WCHAR_T
                   case TYPE_WIDE_STRING:
-                  #endif
                     *fbp++ = 'l';
                     break;
                   case TYPE_LONGDOUBLE:
@@ -6395,14 +6391,12 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                           SNPRINTF_BUF (arg);
                         }
                         break;
-#if HAVE_WCHAR_T
                       case TYPE_WIDE_STRING:
                         {
                           const wchar_t *arg = a.arg[dp->arg_index].a.a_wide_string;
                           SNPRINTF_BUF (arg);
                         }
                         break;
-#endif
                       case TYPE_POINTER:
                         {
                           void *arg = a.arg[dp->arg_index].a.a_pointer;
@@ -6976,7 +6970,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
     errno = ENOMEM;
     goto fail_with_errno;
 
-#if ENABLE_UNISTDIO || ((!USE_SNPRINTF || WIDE_CHAR_VERSION || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || NEED_PRINTF_DIRECTIVE_LS || ENABLE_WCHAR_FALLBACK) && HAVE_WCHAR_T) || ((NEED_PRINTF_DIRECTIVE_LC || ENABLE_WCHAR_FALLBACK) && HAVE_WINT_T && !WIDE_CHAR_VERSION) || (NEED_WPRINTF_DIRECTIVE_C && WIDE_CHAR_VERSION)
+#if ENABLE_UNISTDIO || (!USE_SNPRINTF || WIDE_CHAR_VERSION || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || NEED_PRINTF_DIRECTIVE_LS || ENABLE_WCHAR_FALLBACK) || ((NEED_PRINTF_DIRECTIVE_LC || ENABLE_WCHAR_FALLBACK) && HAVE_WINT_T && !WIDE_CHAR_VERSION) || (NEED_WPRINTF_DIRECTIVE_C && WIDE_CHAR_VERSION)
   fail_with_EILSEQ:
     errno = EILSEQ;
     goto fail_with_errno;
index 998fe12fa83e9819954dfc46423f2b421ad3cedd..c7f75b37fa03d2b8d3c697f3514a0c14ef7efac5 100644 (file)
@@ -1,5 +1,5 @@
 # stddef_h.m4
-# serial 16
+# serial 17
 dnl Copyright (C) 2009-2024 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -10,7 +10,6 @@ dnl A placeholder for <stddef.h>, for platforms that have issues.
 AC_DEFUN_ONCE([gl_STDDEF_H],
 [
   AC_REQUIRE([gl_STDDEF_H_DEFAULTS])
-  AC_REQUIRE([gt_TYPE_WCHAR_T])
 
   dnl Persuade OpenBSD <stddef.h> to declare max_align_t.
   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
@@ -52,11 +51,6 @@ AC_DEFUN_ONCE([gl_STDDEF_H],
     GL_GENERATE_STDDEF_H=true
   fi
 
-  if test $gt_cv_c_wchar_t = no; then
-    HAVE_WCHAR_T=0
-    GL_GENERATE_STDDEF_H=true
-  fi
-
   AC_CACHE_CHECK([whether NULL can be used in arbitrary expressions],
     [gl_cv_decl_null_works],
     [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stddef.h>
@@ -148,5 +142,4 @@ AC_DEFUN([gl_STDDEF_H_DEFAULTS],
   STDDEF_NOT_IDEMPOTENT=0;       AC_SUBST([STDDEF_NOT_IDEMPOTENT])
   REPLACE_NULL=0;                AC_SUBST([REPLACE_NULL])
   HAVE_MAX_ALIGN_T=1;            AC_SUBST([HAVE_MAX_ALIGN_T])
-  HAVE_WCHAR_T=1;                AC_SUBST([HAVE_WCHAR_T])
 ])
index 1ea2055ea8a163230a9ca43f30c588046d200fbd..5dc3fe0c4d626c709dba37061cf46ba6bc849b4d 100644 (file)
@@ -1,5 +1,5 @@
 # vasnprintf.m4
-# serial 52
+# serial 53
 dnl Copyright (C) 2002-2004, 2006-2024 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -42,7 +42,6 @@ AC_DEFUN([gl_FUNC_VASNWPRINTF],
 # Prerequisites of lib/printf-args.h, lib/printf-args.c.
 AC_DEFUN([gl_PREREQ_PRINTF_ARGS],
 [
-  AC_REQUIRE([gt_TYPE_WCHAR_T])
   AC_REQUIRE([gt_TYPE_WINT_T])
 ])
 
@@ -51,7 +50,6 @@ AC_DEFUN([gl_PREREQ_PRINTF_ARGS],
 AC_DEFUN([gl_PREREQ_PRINTF_PARSE],
 [
   AC_REQUIRE([gl_FEATURES_H])
-  AC_REQUIRE([gt_TYPE_WCHAR_T])
   AC_REQUIRE([gt_TYPE_WINT_T])
   AC_REQUIRE([AC_TYPE_SIZE_T])
   AC_CHECK_TYPE([ptrdiff_t], ,
@@ -185,7 +183,6 @@ int main()
 AC_DEFUN_ONCE([gl_PREREQ_VASNXPRINTF],
 [
   AC_REQUIRE([AC_FUNC_ALLOCA])
-  AC_REQUIRE([gt_TYPE_WCHAR_T])
   AC_REQUIRE([gt_TYPE_WINT_T])
   AC_CHECK_FUNCS([wcslen])
   dnl Knowing DBL_EXPBIT0_WORD and DBL_EXPBIT0_BIT enables an optimization
diff --git a/m4/wchar_t.m4 b/m4/wchar_t.m4
deleted file mode 100644 (file)
index 968832c..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# wchar_t.m4
-# serial 4 (gettext-0.18.2)
-dnl Copyright (C) 2002-2003, 2008-2024 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl From Bruno Haible.
-dnl Test whether <stddef.h> has the 'wchar_t' type.
-dnl Prerequisite: AC_PROG_CC
-
-AC_DEFUN([gt_TYPE_WCHAR_T],
-[
-  AC_CACHE_CHECK([for wchar_t], [gt_cv_c_wchar_t],
-    [AC_COMPILE_IFELSE(
-       [AC_LANG_PROGRAM(
-          [[#include <stddef.h>
-            wchar_t foo = (wchar_t)'\0';]],
-          [[]])],
-       [gt_cv_c_wchar_t=yes],
-       [gt_cv_c_wchar_t=no])])
-  if test $gt_cv_c_wchar_t = yes; then
-    AC_DEFINE([HAVE_WCHAR_T], [1], [Define if you have the 'wchar_t' type.])
-  fi
-])
index 1bf79ca167436bd7a06bf5513bdc20d7420c5e80..f2fa198022ade1d53b949ff672defb6cfa51d47b 100644 (file)
@@ -1,5 +1,5 @@
 # wcwidth.m4
-# serial 37
+# serial 38
 dnl Copyright (C) 2006-2024 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -13,7 +13,6 @@ AC_DEFUN([gl_FUNC_WCWIDTH],
   dnl Persuade glibc <wchar.h> to declare wcwidth().
   AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
 
-  AC_REQUIRE([gt_TYPE_WCHAR_T])
   AC_REQUIRE([gt_TYPE_WINT_T])
 
   AC_CHECK_HEADERS_ONCE([wchar.h])
index 614e8346a7650d4a92924991fa2883e3da8e1d6f..f800ab19d12dfc6e8218a4ca0797080ba82daf1c 100644 (file)
@@ -11,7 +11,6 @@ lib/printf-parse.h
 lib/printf-parse.c
 lib/vasnprintf.h
 lib/vasnprintf.c
-m4/wchar_t.m4
 m4/wint_t.m4
 m4/intmax_t.m4
 m4/stdint_h.m4
index 9a80db007bf5fa0c5184c68c16ce67ba6ad4f62f..96eeeaf88bc3149ee3abc97b5666f1d7796a6b9a 100644 (file)
@@ -4,7 +4,6 @@ A <stddef.h> that works around platform issues.
 Files:
 lib/stddef.in.h
 m4/stddef_h.m4
-m4/wchar_t.m4
 
 Depends-on:
 gen-header
@@ -35,7 +34,6 @@ stddef.h: stddef.in.h $(top_builddir)/config.status
              -e 's|@''STDDEF_NOT_IDEMPOTENT''@|$(STDDEF_NOT_IDEMPOTENT)|g' \
              -e 's|@''REPLACE_NULL''@|$(REPLACE_NULL)|g' \
              -e 's|@''HAVE_MAX_ALIGN_T''@|$(HAVE_MAX_ALIGN_T)|g' \
-             -e 's|@''HAVE_WCHAR_T''@|$(HAVE_WCHAR_T)|g' \
              $(srcdir)/stddef.in.h > $@-t
        $(AM_V_at)mv $@-t $@
 else
index 44d9cdec6e35a90786129d4cd59b0056ffb6f77a..68e89cdf8487fa53872fd699f5a13421b759828f 100644 (file)
@@ -1,6 +1,5 @@
 Files:
 tests/test-stdint.c
-m4/wchar_t.m4
 m4/wint_t.m4
 
 Depends-on:
@@ -11,7 +10,6 @@ wchar
 stdint-c++-tests
 
 configure.ac:
-AC_REQUIRE([gt_TYPE_WCHAR_T])
 AC_REQUIRE([gt_TYPE_WINT_T])
 
 Makefile.am:
index d749b13aa86ae1602fb90b289f1c476566ecd50a..ef5886cb9d6a03ce60866371dbe18a59a8d5a2e1 100644 (file)
@@ -7,7 +7,6 @@ lib/vasnprintf.c
 m4/vasnprintf.m4
 m4/printf.m4
 m4/math_h.m4
-m4/wchar_t.m4
 m4/wint_t.m4
 m4/intmax_t.m4
 m4/stdint_h.m4
index 10221bd4edd8fd50306a760a84ed4ba464edbc19..776961756276c6723c3cb247fe22c88527cb9cde 100644 (file)
@@ -7,7 +7,6 @@ lib/vasnprintf.c
 m4/vasnprintf.m4
 m4/printf.m4
 m4/math_h.m4
-m4/wchar_t.m4
 m4/wint_t.m4
 m4/intmax_t.m4
 m4/stdint_h.m4
index c89f08b4bb07391c23b2c41fceff8c7ccd17fa93..587e4adf990aff51f94a501fb96f9b77b4ae49ec 100644 (file)
@@ -7,7 +7,6 @@ lib/vasnprintf.c
 m4/vasnprintf.m4
 m4/printf.m4
 m4/math_h.m4
-m4/wchar_t.m4
 m4/wint_t.m4
 m4/intmax_t.m4
 m4/stdint_h.m4
index bba1616675d0ea68696eb10be1651b9bc44895ff..84466c8b871e08fcb1060c0c80329d756025f22c 100644 (file)
@@ -7,7 +7,6 @@ lib/vasnprintf.c
 m4/vasnprintf.m4
 m4/printf.m4
 m4/math_h.m4
-m4/wchar_t.m4
 m4/wint_t.m4
 m4/intmax_t.m4
 m4/stdint_h.m4
index 4bef61efb580284be634f5c8a0dfc94cfd69fead..d34f513485fc57107073262d26ff17652a3ec42d 100644 (file)
@@ -7,7 +7,6 @@ lib/vasnprintf.c
 m4/vasnprintf.m4
 m4/printf.m4
 m4/math_h.m4
-m4/wchar_t.m4
 m4/wint_t.m4
 m4/intmax_t.m4
 m4/stdint_h.m4
index 3546a4a74139d95452785075fde071641eca6607..dd71ae96a9547d31632b356314b48e6ac894e56e 100644 (file)
@@ -7,7 +7,6 @@ lib/vasnprintf.c
 m4/vasnprintf.m4
 m4/printf.m4
 m4/math_h.m4
-m4/wchar_t.m4
 m4/wint_t.m4
 m4/intmax_t.m4
 m4/stdint_h.m4
index 6f223aada97da9c127956fab4681cab151d1308f..b2476b1e65e02642412d59bf67209dba1f096ccc 100644 (file)
@@ -7,7 +7,6 @@ lib/vasnprintf.c
 m4/vasnprintf.m4
 m4/printf.m4
 m4/math_h.m4
-m4/wchar_t.m4
 m4/wint_t.m4
 m4/intmax_t.m4
 m4/stdint_h.m4
index b436430520634a52d535fcc9d7260d03903f6205..cbca87f0c6a14bd759302ea4b1ba004634e01465 100644 (file)
@@ -10,7 +10,6 @@ lib/printf-parse.c
 lib/vasnprintf.h
 lib/vasnprintf.c
 lib/asnprintf.c
-m4/wchar_t.m4
 m4/wint_t.m4
 m4/intmax_t.m4
 m4/stdint_h.m4
index 67143e745533a0f818ac7de4db04411523a0ceb2..2ef56d7cb6ebcbc276a44cf455bc8c05eaca1284 100644 (file)
@@ -12,7 +12,6 @@ lib/vasnwprintf.h
 lib/vasnwprintf.c
 lib/vasnprintf.c
 lib/asnwprintf.c
-m4/wchar_t.m4
 m4/wint_t.m4
 m4/intmax_t.m4
 m4/stdint_h.m4
index 6738b644ccd87889d0541fe139e6e26ab8f3a41a..8131765e92dbd112e5f5ec7424d0edd657124667 100644 (file)
@@ -4,7 +4,6 @@ Determine the number of screen columns needed for a character.
 Files:
 lib/wcwidth.c
 m4/wcwidth.m4
-m4/wchar_t.m4
 m4/wint_t.m4
 
 Depends-on:
index 40c45db1bb67258b4b73f87a41d98404ec43770a..cf6392daa202484725b59020be9956eca6fa4972 100644 (file)
@@ -3019,7 +3019,6 @@ test_function (int (*my_snprintf) (char *, size_t, const char *, ...))
     ASSERT (retval == strlen (result));
   }
 
-#if HAVE_WCHAR_T
   static wchar_t L_xyz[4] = { 'x', 'y', 'z', 0 };
 
   { /* Width.  */
@@ -3049,7 +3048,6 @@ test_function (int (*my_snprintf) (char *, size_t, const char *, ...))
     ASSERT (strcmp (result, "xyz        33") == 0);
     ASSERT (retval == strlen (result));
   }
-#endif
 
   /* To verify that these tests succeed, it is necessary to run them under
      a tool that checks against invalid memory accesses, such as ElectricFence
@@ -3071,7 +3069,6 @@ test_function (int (*my_snprintf) (char *, size_t, const char *, ...))
         free (block);
       }
   }
-#if HAVE_WCHAR_T
   {
     size_t i;
 
@@ -3091,7 +3088,6 @@ test_function (int (*my_snprintf) (char *, size_t, const char *, ...))
         free (block);
       }
   }
-#endif
 
   /* Test the support of the %c format directive.  */
 
@@ -3143,7 +3139,6 @@ test_function (int (*my_snprintf) (char *, size_t, const char *, ...))
     ASSERT (retval == 6);
   }
 
-#if HAVE_WCHAR_T
   static wint_t L_x = (wchar_t) 'x';
 
   { /* Width.  */
@@ -3213,7 +3208,6 @@ test_function (int (*my_snprintf) (char *, size_t, const char *, ...))
                    "%10lc %d", L_invalid, 33, 44, 55);
     (void) retval;
   }
-#endif
 
   /* Test the support of the 'x' conversion specifier for hexadecimal output of
      integers.  */
index 7c545dd34581c440bb5483a69c0fb0aca351352c..4263e46ce9fb3a45609b48ffc49363aa234bfcdb 100644 (file)
@@ -3005,7 +3005,6 @@ test_function (int (*my_sprintf) (char *, const char *, ...))
     ASSERT (retval == strlen (result));
   }
 
-#if HAVE_WCHAR_T
   static wchar_t L_xyz[4] = { 'x', 'y', 'z', 0 };
 
   { /* Width.  */
@@ -3035,7 +3034,6 @@ test_function (int (*my_sprintf) (char *, const char *, ...))
     ASSERT (strcmp (result, "xyz        33") == 0);
     ASSERT (retval == strlen (result));
   }
-#endif
 
   /* To verify that these tests succeed, it is necessary to run them under
      a tool that checks against invalid memory accesses, such as ElectricFence
@@ -3057,7 +3055,6 @@ test_function (int (*my_sprintf) (char *, const char *, ...))
         free (block);
       }
   }
-#if HAVE_WCHAR_T
   {
     size_t i;
 
@@ -3077,7 +3074,6 @@ test_function (int (*my_sprintf) (char *, const char *, ...))
         free (block);
       }
   }
-#endif
 
   /* Test the support of the %c format directive.  */
 
@@ -3123,7 +3119,6 @@ test_function (int (*my_sprintf) (char *, const char *, ...))
     ASSERT (retval == 6);
   }
 
-#if HAVE_WCHAR_T
   static wint_t L_x = (wchar_t) 'x';
 
   { /* Width.  */
@@ -3192,7 +3187,6 @@ test_function (int (*my_sprintf) (char *, const char *, ...))
       my_sprintf (result, "%10lc %d", L_invalid, 33, 44, 55);
     (void) retval;
   }
-#endif
 
   /* Test the support of the 'x' conversion specifier for hexadecimal output of
      integers.  */
index 47bedc8959fe51307a4dbd24aca521de36d6d0a3..b8799eafa0956c56dedb5d46d789a6a4278f59a7 100644 (file)
@@ -297,17 +297,15 @@ verify_same_types (SIZE_MAX, (size_t) 0 + 0);
 err or;
 #endif
 
-#if HAVE_WCHAR_T
 verify (TYPE_MINIMUM (wchar_t) == WCHAR_MIN);
 verify (TYPE_MAXIMUM (wchar_t) == WCHAR_MAX);
 verify_same_types (WCHAR_MIN, (wchar_t) 0 + 0);
 verify_same_types (WCHAR_MAX, (wchar_t) 0 + 0);
 
-# if WCHAR_MIN != 17 && WCHAR_MAX
+#if WCHAR_MIN != 17 && WCHAR_MAX
 /* ok */
-# else
+#else
 err or;
-# endif
 #endif
 
 #if HAVE_WINT_T
index 81a6fb313bcd3f76eea9bcfc8a6e4d30d9e0a430..aafec425aee47fd09f30bdd0d18333807b9b82e0 100644 (file)
@@ -3887,7 +3887,6 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...))
     free (result);
   }
 
-#if HAVE_WCHAR_T
   static wchar_t L_xyz[4] = { 'x', 'y', 'z', 0 };
 
   { /* Width.  */
@@ -3929,7 +3928,6 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...))
     ASSERT (length == strlen (result));
     free (result);
   }
-#endif
 
   /* To verify that these tests succeed, it is necessary to run them under
      a tool that checks against invalid memory accesses, such as ElectricFence
@@ -3954,7 +3952,6 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...))
         free (block);
       }
   }
-#if HAVE_WCHAR_T
   {
     size_t i;
 
@@ -3977,9 +3974,7 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...))
         free (block);
       }
   }
-#endif
 
-#if HAVE_WCHAR_T
   /* Test that converting an invalid wchar_t[] to char[] fails with EILSEQ.  */
   {
     static const wchar_t input[] = { (wchar_t) 1702057263, 114, 0 };
@@ -4017,7 +4012,6 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...))
     else
       free (result);
   }
-#endif
 
   /* Test the support of the %c format directive.  */
 
@@ -4085,7 +4079,6 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...))
     free (result);
   }
 
-#if HAVE_WCHAR_T
   static wint_t L_x = (wchar_t) 'x';
 
   { /* Width.  */
@@ -4169,7 +4162,6 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...))
       my_asnprintf (NULL, &length, "%10lc %d", L_invalid, 33, 44, 55);
     free (result);
   }
-#endif
 
   /* Test the support of the 'x' conversion specifier for hexadecimal output of
      integers.  */
index 9b1380d1c2b5b288aaad6cea3f8206506c2b5ecb..a6db19d1d9c0f0283b75716bc4de08998bf0f7d4 100644 (file)
@@ -3912,7 +3912,6 @@ test_function (wchar_t * (*my_asnwprintf) (wchar_t *, size_t *, const wchar_t *,
   }
 #endif
 
-#if HAVE_WCHAR_T
   static wchar_t L_xyz[4] = { 'x', 'y', 'z', 0 };
 
   { /* Width.  */
@@ -3954,7 +3953,6 @@ test_function (wchar_t * (*my_asnwprintf) (wchar_t *, size_t *, const wchar_t *,
     ASSERT (length == wcslen (result));
     free (result);
   }
-#endif
 
   /* To verify that these tests succeed, it is necessary to run them under
      a tool that checks against invalid memory accesses, such as ElectricFence
@@ -3984,7 +3982,6 @@ test_function (wchar_t * (*my_asnwprintf) (wchar_t *, size_t *, const wchar_t *,
         free (block);
       }
   }
-#if HAVE_WCHAR_T
   {
     size_t i;
 
@@ -4007,9 +4004,7 @@ test_function (wchar_t * (*my_asnwprintf) (wchar_t *, size_t *, const wchar_t *,
         free (block);
       }
   }
-#endif
 
-#if HAVE_WCHAR_T
   /* Test that converting an invalid wchar_t[] to char[] fails with EILSEQ.  */
   {
     static const wchar_t input[] = { (wchar_t) 1702057263, 114, 0 };
@@ -4047,7 +4042,6 @@ test_function (wchar_t * (*my_asnwprintf) (wchar_t *, size_t *, const wchar_t *,
     else
       free (result);
   }
-#endif
 
   /* Test the support of the %c format directive.  */
 
@@ -4135,7 +4129,6 @@ test_function (wchar_t * (*my_asnwprintf) (wchar_t *, size_t *, const wchar_t *,
   }
 #endif
 
-#if HAVE_WCHAR_T
   static wint_t L_x = (wchar_t) 'x';
 
   { /* Width.  */
@@ -4224,7 +4217,6 @@ test_function (wchar_t * (*my_asnwprintf) (wchar_t *, size_t *, const wchar_t *,
     ASSERT (length == 13);
     free (result);
   }
-#endif
 
   /* Test the support of the 'x' conversion specifier for hexadecimal output of
      integers.  */
index dab3c2164911ed10a7688d73e54d1d8f5b245317..d172a5c6eaae9cca9d31fe05e1bc4913b12d13a8 100644 (file)
@@ -3872,7 +3872,6 @@ test_function (int (*my_asprintf) (char **, const char *, ...))
     free (result);
   }
 
-#if HAVE_WCHAR_T
   static wchar_t L_xyz[4] = { 'x', 'y', 'z', 0 };
 
   { /* Width.  */
@@ -3914,7 +3913,6 @@ test_function (int (*my_asprintf) (char **, const char *, ...))
     ASSERT (retval == strlen (result));
     free (result);
   }
-#endif
 
   /* To verify that these tests succeed, it is necessary to run them under
      a tool that checks against invalid memory accesses, such as ElectricFence
@@ -3939,7 +3937,6 @@ test_function (int (*my_asprintf) (char **, const char *, ...))
         free (block);
       }
   }
-#if HAVE_WCHAR_T
   {
     size_t i;
 
@@ -3962,7 +3959,6 @@ test_function (int (*my_asprintf) (char **, const char *, ...))
         free (block);
       }
   }
-#endif
 
   /* Test the support of the %c format directive.  */
 
@@ -4024,7 +4020,6 @@ test_function (int (*my_asprintf) (char **, const char *, ...))
     free (result);
   }
 
-#if HAVE_WCHAR_T
   static wint_t L_x = (wchar_t) 'x';
 
   { /* Width.  */
@@ -4110,7 +4105,6 @@ test_function (int (*my_asprintf) (char **, const char *, ...))
     if (retval >= 0)
       free (result);
   }
-#endif
 
   /* Test the support of the 'x' conversion specifier for hexadecimal output of
      integers.  */