]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
wchar-h: Remove support for IRIX.
authorBruno Haible <bruno@clisp.org>
Wed, 10 Sep 2025 21:18:40 +0000 (23:18 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 10 Sep 2025 21:18:40 +0000 (23:18 +0200)
* lib/wchar.in.h: Don't set or test
_@GUARD_PREFIX@_ALREADY_INCLUDING_WCHAR_H.
(rpl_mbstate_t): Remove type.
(wctob): Test HAVE_WCTOB instead of HAVE_DECL_WCTOB.
* m4/wchar_h.m4 (gl_WCHAR_H_DEFAULTS): Initialize HAVE_WCTOB instead of
HAVE_DECL_WCTOB.
* modules/wchar-h (Makefile.am): Substitute HAVE_WCTOB instead of
HAVE_DECL_WCTOB.
* m4/wctob.m4 (gl_FUNC_WCTOB): Don't set HAVE_DECL_WCTOB.

ChangeLog
lib/wchar.in.h
m4/wchar_h.m4
m4/wctob.m4
modules/wchar-h

index be83bbc813b9b87c93146d4f2c11b67c9d004c90..2c7f0da715174d39c0c871d2eecba6b738097ea5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
 2025-09-10  Bruno Haible  <bruno@clisp.org>
 
+       wchar-h: Remove support for IRIX.
+       * lib/wchar.in.h: Don't set or test
+       _@GUARD_PREFIX@_ALREADY_INCLUDING_WCHAR_H.
+       (rpl_mbstate_t): Remove type.
+       (wctob): Test HAVE_WCTOB instead of HAVE_DECL_WCTOB.
+       * m4/wchar_h.m4 (gl_WCHAR_H_DEFAULTS): Initialize HAVE_WCTOB instead of
+       HAVE_DECL_WCTOB.
+       * modules/wchar-h (Makefile.am): Substitute HAVE_WCTOB instead of
+       HAVE_DECL_WCTOB.
+       * m4/wctob.m4 (gl_FUNC_WCTOB): Don't set HAVE_DECL_WCTOB.
+
        unicodeio: Remove support for IRIX.
        * lib/unicodeio.c (unicode_to_mb): Remove code for IRIX.
 
index 23d8b3c5bf6f94cd6d1efeee7a86cc398836d760..ab602a2811788534f97f4cb5a8e9e2ee35fac982 100644 (file)
@@ -36,8 +36,7 @@
          && ((defined _INTTYPES_INCLUDED                                \
               && !defined _GL_FINISHED_INCLUDING_SYSTEM_INTTYPES_H)     \
              || defined _GL_JUST_INCLUDE_SYSTEM_WCHAR_H))               \
-     || (defined __MINGW32__ && defined __STRING_H_SOURCED__)           \
-     || defined _@GUARD_PREFIX@_ALREADY_INCLUDING_WCHAR_H)
+     || (defined __MINGW32__ && defined __STRING_H_SOURCED__))
 /* Special invocation convention:
    - Inside glibc and uClibc header files, but not MinGW.
    - On HP-UX 11.00 we have a sequence of nested includes
      therefore we cannot provide the function overrides; instead include only
      the system's <wchar.h>.
    - With MinGW 3.22, when <string.h> includes <wchar.h>, only some part of
-     <wchar.h> is actually processed, and that doesn't include 'mbstate_t'.
-   - On IRIX 6.5, similarly, we have an include <wchar.h> -> <wctype.h>, and
-     the latter includes <wchar.h>.  But here, we have no way to detect whether
-     <wctype.h> is completely included or is still being included.  */
+     <wchar.h> is actually processed, and that doesn't include 'mbstate_t'.  */
 
 #@INCLUDE_NEXT@ @NEXT_WCHAR_H@
 /* The glibc 2.5 /usr/include/wchar.h defines __need_wint_t but never undefines
@@ -62,8 +58,6 @@
 
 #ifndef _@GUARD_PREFIX@_WCHAR_H
 
-#define _@GUARD_PREFIX@_ALREADY_INCLUDING_WCHAR_H
-
 #if @HAVE_FEATURES_H@
 # include <features.h> /* for __GLIBC__ */
 #endif
@@ -82,8 +76,6 @@
 # @INCLUDE_NEXT@ @NEXT_WCHAR_H@
 #endif
 
-#undef _@GUARD_PREFIX@_ALREADY_INCLUDING_WCHAR_H
-
 #ifndef _@GUARD_PREFIX@_WCHAR_H
 #define _@GUARD_PREFIX@_WCHAR_H
 
@@ -211,18 +203,11 @@ typedef unsigned int rpl_wint_t;
 
 
 /* Override mbstate_t if it is too small.
-   On IRIX 6.5, sizeof (mbstate_t) == 1, which is not sufficient for
-   implementing mbrtowc for encodings like UTF-8.
    On AIX, MSVC, and OpenBSD 6.0, mbrtowc needs to be overridden, but
    mbstate_t exists and is large enough and overriding it would cause problems
    in C++ mode.  */
 #if !(((defined _WIN32 && !defined __CYGWIN__) || @HAVE_MBSINIT@) && @HAVE_MBRTOWC@) || @REPLACE_MBSTATE_T@
 # if !GNULIB_defined_mbstate_t
-#  if !(defined _AIX || defined _MSC_VER || defined __OpenBSD__)
-typedef int rpl_mbstate_t;
-#   undef mbstate_t
-#   define mbstate_t rpl_mbstate_t
-#  endif
 #  define GNULIB_defined_mbstate_t 1
 # endif
 #endif
@@ -365,8 +350,8 @@ _GL_WARN_ON_USE (btowc, "btowc is unportable - "
 _GL_FUNCDECL_RPL (wctob, int, (wint_t wc), _GL_ATTRIBUTE_PURE);
 _GL_CXXALIAS_RPL (wctob, int, (wint_t wc));
 # else
-#  if !defined wctob && !@HAVE_DECL_WCTOB@
-/* wctob is provided by gnulib, or wctob exists but is not declared.  */
+#  if !defined wctob && !@HAVE_WCTOB@
+/* wctob is provided by gnulib.  */
 _GL_FUNCDECL_SYS (wctob, int, (wint_t wc), _GL_ATTRIBUTE_PURE);
 #  endif
 _GL_CXXALIAS_SYS (wctob, int, (wint_t wc));
@@ -443,7 +428,7 @@ _GL_WARN_ON_USE (mbsinit, "mbsinit is unportable - "
    without considering what mbsinit() does, we get test failures such as
      assertion "mbsinit (&iter->state)" failed
  */
-# if GNULIB_defined_mbstate_t                             /* AIX, IRIX */
+# if GNULIB_defined_mbstate_t                             /* AIX */
 /* mbstate_t has at least 4 bytes.  They are used as coded in
    gnulib/lib/mbrtowc.c.  */
 #  define _GL_MBSTATE_INIT_SIZE 1
index f88294e7c4c9cfca9839eebb41c5b32aaa396620..70e9e33d42b7aebd13036b9e98711e05ff78db02 100644 (file)
@@ -1,5 +1,5 @@
 # wchar_h.m4
-# serial 65
+# serial 66
 dnl Copyright (C) 2007-2025 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -239,7 +239,7 @@ AC_DEFUN([gl_WCHAR_H_DEFAULTS],
   HAVE_WCSTOK=1;        AC_SUBST([HAVE_WCSTOK])
   HAVE_WCSWIDTH=1;      AC_SUBST([HAVE_WCSWIDTH])
   HAVE_WCSFTIME=1;      AC_SUBST([HAVE_WCSFTIME])
-  HAVE_DECL_WCTOB=1;    AC_SUBST([HAVE_DECL_WCTOB])
+  HAVE_WCTOB=1;         AC_SUBST([HAVE_WCTOB])
   HAVE_DECL_WCSDUP=1;   AC_SUBST([HAVE_DECL_WCSDUP])
   HAVE_DECL_WCWIDTH=1;  AC_SUBST([HAVE_DECL_WCWIDTH])
   REPLACE_MBSTATE_T=0;  AC_SUBST([REPLACE_MBSTATE_T])
index 5649c72d34e1ef6001bf22fad1055743cd9cc9cf..6506b0da03e7f7473195f8beaae442d896bc901a 100644 (file)
@@ -1,5 +1,5 @@
 # wctob.m4
-# serial 14
+# serial 15
 dnl Copyright (C) 2008-2025 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_WCTOB],
   AC_CHECK_FUNCS_ONCE([wctob])
   if test $ac_cv_func_wctob = no; then
     HAVE_WCTOB=0
-    HAVE_DECL_WCTOB=0
   else
     HAVE_WCTOB=1
 
@@ -92,16 +91,6 @@ int main ()
       *yes) ;;
       *) REPLACE_WCTOB=1 ;;
     esac
-    if test $REPLACE_WCTOB = 0; then
-
-      dnl IRIX 6.5 has the wctob() function but does not declare it.
-      AC_CHECK_DECLS([wctob], [], [], [[
-        #include <wchar.h>
-      ]])
-      if test $ac_cv_have_decl_wctob != yes; then
-        HAVE_DECL_WCTOB=0
-      fi
-    fi
   fi
 ])
 
index 8b733238f10c1400e6d62e4bd0995abe92cf19cc..e8b4756d700c09f9e0676df45223cad709de734c 100644 (file)
@@ -127,7 +127,7 @@ wchar.h: wchar.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H)
              -e 's|@''HAVE_WCSTOK''@|$(HAVE_WCSTOK)|g' \
              -e 's|@''HAVE_WCSWIDTH''@|$(HAVE_WCSWIDTH)|g' \
              -e 's|@''HAVE_WCSFTIME''@|$(HAVE_WCSFTIME)|g' \
-             -e 's|@''HAVE_DECL_WCTOB''@|$(HAVE_DECL_WCTOB)|g' \
+             -e 's|@''HAVE_WCTOB''@|$(HAVE_WCTOB)|g' \
              -e 's|@''HAVE_DECL_WCSDUP''@|$(HAVE_DECL_WCSDUP)|g' \
              -e 's|@''HAVE_DECL_WCWIDTH''@|$(HAVE_DECL_WCWIDTH)|g' \
              < $@-t1 > $@-t2