From: Bruno Haible Date: Wed, 10 Sep 2025 21:18:40 +0000 (+0200) Subject: wchar-h: Remove support for IRIX. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c5753f1bd53cdde1eb6b9caf2353e278fc28ce9c;p=thirdparty%2Fgnulib.git 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. --- diff --git a/ChangeLog b/ChangeLog index be83bbc813..2c7f0da715 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,16 @@ 2025-09-10 Bruno Haible + 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. diff --git a/lib/wchar.in.h b/lib/wchar.in.h index 23d8b3c5bf..ab602a2811 100644 --- a/lib/wchar.in.h +++ b/lib/wchar.in.h @@ -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 @@ -47,10 +46,7 @@ therefore we cannot provide the function overrides; instead include only the system's . - With MinGW 3.22, when includes , only some part of - is actually processed, and that doesn't include 'mbstate_t'. - - On IRIX 6.5, similarly, we have an include -> , and - the latter includes . But here, we have no way to detect whether - is completely included or is still being included. */ + 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 /* 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 diff --git a/m4/wchar_h.m4 b/m4/wchar_h.m4 index f88294e7c4..70e9e33d42 100644 --- a/m4/wchar_h.m4 +++ b/m4/wchar_h.m4 @@ -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]) diff --git a/m4/wctob.m4 b/m4/wctob.m4 index 5649c72d34..6506b0da03 100644 --- a/m4/wctob.m4 +++ b/m4/wctob.m4 @@ -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 - ]]) - if test $ac_cv_have_decl_wctob != yes; then - HAVE_DECL_WCTOB=0 - fi - fi fi ]) diff --git a/modules/wchar-h b/modules/wchar-h index 8b733238f1..e8b4756d70 100644 --- a/modules/wchar-h +++ b/modules/wchar-h @@ -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