[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Assume wchar_t
From: |
Bruno Haible |
Subject: |
Assume wchar_t |
Date: |
Fri, 14 Jun 2024 00:30:38 +0200 |
The vasnprintf module still has #if HAVE_WCHAR_T conditionals. But we haven't
seen a platform without wchar_t maybe 20 years. wchar_t was introduced
a couple of years before C99, and X11 relies on it extensively.
So, it's time to simplify things and assume that wchar_t exists.
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.
diff --git a/doc/posix-headers/stddef.texi b/doc/posix-headers/stddef.texi
index 4d0e171b8d..f04b842f8d 100644
--- a/doc/posix-headers/stddef.texi
+++ b/doc/posix-headers/stddef.texi
@@ -19,9 +19,6 @@
@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:
diff --git a/lib/printf-args.c b/lib/printf-args.c
index eb0d2cdc0f..c20225039d 100644
--- a/lib/printf-args.c
+++ b/lib/printf-args.c
@@ -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;
diff --git a/lib/printf-args.h b/lib/printf-args.h
index 9b80bb3929..24a86748b1 100644
--- a/lib/printf-args.h
+++ b/lib/printf-args.h
@@ -28,14 +28,9 @@
# 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;
diff --git a/lib/printf-parse.c b/lib/printf-parse.c
index a33e27a0b8..7628cb2335 100644
--- a/lib/printf-parse.c
+++ b/lib/printf-parse.c
@@ -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;
diff --git a/lib/stddef.in.h b/lib/stddef.in.h
index 63bb500e26..0abc449704 100644
--- a/lib/stddef.in.h
+++ b/lib/stddef.in.h
@@ -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.
diff --git a/lib/vasnprintf.c b/lib/vasnprintf.c
index ac8dc8619e..03a7da71f9 100644
--- a/lib/vasnprintf.c
+++ b/lib/vasnprintf.c
@@ -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;
diff --git a/m4/stddef_h.m4 b/m4/stddef_h.m4
index 998fe12fa8..c7f75b37fa 100644
--- a/m4/stddef_h.m4
+++ b/m4/stddef_h.m4
@@ -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 @@
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])
])
diff --git a/m4/vasnprintf.m4 b/m4/vasnprintf.m4
index 1ea2055ea8..5dc3fe0c4d 100644
--- a/m4/vasnprintf.m4
+++ b/m4/vasnprintf.m4
@@ -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 @@ AC_DEFUN_ONCE([gl_PREREQ_VASNWPRINTF]
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
index 968832cb29..0000000000
--- a/m4/wchar_t.m4
+++ /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
-])
diff --git a/m4/wcwidth.m4 b/m4/wcwidth.m4
index 1bf79ca167..f2fa198022 100644
--- a/m4/wcwidth.m4
+++ b/m4/wcwidth.m4
@@ -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])
diff --git a/modules/c-vasnprintf b/modules/c-vasnprintf
index 614e8346a7..f800ab19d1 100644
--- a/modules/c-vasnprintf
+++ b/modules/c-vasnprintf
@@ -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
diff --git a/modules/stddef b/modules/stddef
index 9a80db007b..96eeeaf88b 100644
--- a/modules/stddef
+++ b/modules/stddef
@@ -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
diff --git a/modules/stdint-tests b/modules/stdint-tests
index 44d9cdec6e..68e89cdf84 100644
--- a/modules/stdint-tests
+++ b/modules/stdint-tests
@@ -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:
diff --git a/modules/unistdio/u16-u16-vasnprintf
b/modules/unistdio/u16-u16-vasnprintf
index d749b13aa8..ef5886cb9d 100644
--- a/modules/unistdio/u16-u16-vasnprintf
+++ b/modules/unistdio/u16-u16-vasnprintf
@@ -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
diff --git a/modules/unistdio/u16-vasnprintf b/modules/unistdio/u16-vasnprintf
index 10221bd4ed..7769617562 100644
--- a/modules/unistdio/u16-vasnprintf
+++ b/modules/unistdio/u16-vasnprintf
@@ -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
diff --git a/modules/unistdio/u32-u32-vasnprintf
b/modules/unistdio/u32-u32-vasnprintf
index c89f08b4bb..587e4adf99 100644
--- a/modules/unistdio/u32-u32-vasnprintf
+++ b/modules/unistdio/u32-u32-vasnprintf
@@ -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
diff --git a/modules/unistdio/u32-vasnprintf b/modules/unistdio/u32-vasnprintf
index bba1616675..84466c8b87 100644
--- a/modules/unistdio/u32-vasnprintf
+++ b/modules/unistdio/u32-vasnprintf
@@ -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
diff --git a/modules/unistdio/u8-u8-vasnprintf
b/modules/unistdio/u8-u8-vasnprintf
index 4bef61efb5..d34f513485 100644
--- a/modules/unistdio/u8-u8-vasnprintf
+++ b/modules/unistdio/u8-u8-vasnprintf
@@ -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
diff --git a/modules/unistdio/u8-vasnprintf b/modules/unistdio/u8-vasnprintf
index 3546a4a741..dd71ae96a9 100644
--- a/modules/unistdio/u8-vasnprintf
+++ b/modules/unistdio/u8-vasnprintf
@@ -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
diff --git a/modules/unistdio/ulc-vasnprintf b/modules/unistdio/ulc-vasnprintf
index 6f223aada9..b2476b1e65 100644
--- a/modules/unistdio/ulc-vasnprintf
+++ b/modules/unistdio/ulc-vasnprintf
@@ -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
diff --git a/modules/vasnprintf b/modules/vasnprintf
index b436430520..cbca87f0c6 100644
--- a/modules/vasnprintf
+++ b/modules/vasnprintf
@@ -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
diff --git a/modules/vasnwprintf b/modules/vasnwprintf
index 67143e7455..2ef56d7cb6 100644
--- a/modules/vasnwprintf
+++ b/modules/vasnwprintf
@@ -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
diff --git a/modules/wcwidth b/modules/wcwidth
index 6738b644cc..8131765e92 100644
--- a/modules/wcwidth
+++ b/modules/wcwidth
@@ -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:
diff --git a/tests/test-snprintf-posix.h b/tests/test-snprintf-posix.h
index 40c45db1bb..cf6392daa2 100644
--- a/tests/test-snprintf-posix.h
+++ b/tests/test-snprintf-posix.h
@@ -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. */
diff --git a/tests/test-sprintf-posix.h b/tests/test-sprintf-posix.h
index 7c545dd345..4263e46ce9 100644
--- a/tests/test-sprintf-posix.h
+++ b/tests/test-sprintf-posix.h
@@ -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. */
diff --git a/tests/test-stdint.c b/tests/test-stdint.c
index 47bedc8959..b8799eafa0 100644
--- a/tests/test-stdint.c
+++ b/tests/test-stdint.c
@@ -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
diff --git a/tests/test-vasnprintf-posix.c b/tests/test-vasnprintf-posix.c
index 81a6fb313b..aafec425ae 100644
--- a/tests/test-vasnprintf-posix.c
+++ b/tests/test-vasnprintf-posix.c
@@ -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. */
diff --git a/tests/test-vasnwprintf-posix.c b/tests/test-vasnwprintf-posix.c
index 9b1380d1c2..a6db19d1d9 100644
--- a/tests/test-vasnwprintf-posix.c
+++ b/tests/test-vasnwprintf-posix.c
@@ -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. */
diff --git a/tests/test-vasprintf-posix.c b/tests/test-vasprintf-posix.c
index dab3c21649..d172a5c6ea 100644
--- a/tests/test-vasprintf-posix.c
+++ b/tests/test-vasprintf-posix.c
@@ -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. */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Assume wchar_t,
Bruno Haible <=