From: Bruno Haible Date: Wed, 10 Sep 2025 20:53:35 +0000 (+0200) Subject: langinfo-h: Remove support for IRIX. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=54ce3820160e8b4c923aa1d9c7bcf6dc806205c8;p=thirdparty%2Fgnulib.git langinfo-h: Remove support for IRIX. * lib/langinfo.in.h (T_FMT_AMPM, GNULIB_defined_T_FMT_AMPM, YESEXPR, NOEXPR, GNULIB_defined_YESEXPR): Remove macros. * m4/langinfo_h.m4 (gl_LANGINFO_H): Don't set HAVE_LANGINFO_T_FMT_AMPM, HAVE_LANGINFO_YESEXPR. * modules/langinfo-h (Makefile.am): Don't substitute HAVE_LANGINFO_T_FMT_AMPM, HAVE_LANGINFO_YESEXPR. * m4/nl_langinfo.m4 (gl_FUNC_NL_LANGINFO): Don't test against IRIX bug. * lib/nl_langinfo.c (rpl_nl_langinfo): Remove fallback code for T_FMT_AMPM, YESEXPR, NOEXPR. * m4/rpmatch.m4 (gl_PREREQ_RPMATCH): Just test for . Don't test for YESEXPR. * lib/rpmatch.c: Test HAVE_LANGINFO_H instead of HAVE_LANGINFO_YESEXPR. --- diff --git a/ChangeLog b/ChangeLog index d1cbc4326c..ec463ca8a7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,19 @@ 2025-09-10 Bruno Haible + langinfo-h: Remove support for IRIX. + * lib/langinfo.in.h (T_FMT_AMPM, GNULIB_defined_T_FMT_AMPM, YESEXPR, + NOEXPR, GNULIB_defined_YESEXPR): Remove macros. + * m4/langinfo_h.m4 (gl_LANGINFO_H): Don't set HAVE_LANGINFO_T_FMT_AMPM, + HAVE_LANGINFO_YESEXPR. + * modules/langinfo-h (Makefile.am): Don't substitute + HAVE_LANGINFO_T_FMT_AMPM, HAVE_LANGINFO_YESEXPR. + * m4/nl_langinfo.m4 (gl_FUNC_NL_LANGINFO): Don't test against IRIX bug. + * lib/nl_langinfo.c (rpl_nl_langinfo): Remove fallback code for + T_FMT_AMPM, YESEXPR, NOEXPR. + * m4/rpmatch.m4 (gl_PREREQ_RPMATCH): Just test for . Don't + test for YESEXPR. + * lib/rpmatch.c: Test HAVE_LANGINFO_H instead of HAVE_LANGINFO_YESEXPR. + errno-iter, strerrorname_np: Remove support for IRIX. * lib/errno-iter.c (errno_iterate): Remove cases for EBADFILT, EBADRSPEC, EBADTSPEC, EBDHDL, EBUFSIZE, ECANTEXTENT, ECELLDOWN, ECKPT, diff --git a/lib/langinfo.in.h b/lib/langinfo.in.h index e16c95b3dd..1b46759831 100644 --- a/lib/langinfo.in.h +++ b/lib/langinfo.in.h @@ -162,11 +162,6 @@ typedef int nl_item; # define GNULIB_defined_CODESET 1 # endif -# if !@HAVE_LANGINFO_T_FMT_AMPM@ -# define T_FMT_AMPM 10006 -# define GNULIB_defined_T_FMT_AMPM 1 -# endif - # if !@HAVE_LANGINFO_ALTMON@ # define ALTMON_1 10200 # define ALTMON_2 (ALTMON_1 + 1) @@ -223,12 +218,6 @@ typedef int nl_item; # define GNULIB_defined_ERA 1 # endif -# if !@HAVE_LANGINFO_YESEXPR@ -# define YESEXPR 10053 -# define NOEXPR 10054 -# define GNULIB_defined_YESEXPR 1 -# endif - #endif /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ diff --git a/lib/nl_langinfo.c b/lib/nl_langinfo.c index b87066bbfd..df824a61f8 100644 --- a/lib/nl_langinfo.c +++ b/lib/nl_langinfo.c @@ -295,10 +295,6 @@ rpl_nl_langinfo (nl_item item) case CODESET: return ctype_codeset (); # endif -# if GNULIB_defined_T_FMT_AMPM - case T_FMT_AMPM: - return (char *) "%I:%M:%S %p"; -# endif # if GNULIB_defined_ALTMON case ALTMON_1: case ALTMON_2: @@ -360,12 +356,6 @@ rpl_nl_langinfo (nl_item item) /* The format is not standardized. In glibc it is a sequence of 10 strings, appended in memory. */ return (char *) "\0\0\0\0\0\0\0\0\0\0"; -# endif -# if GNULIB_defined_YESEXPR || !FUNC_NL_LANGINFO_YESEXPR_WORKS - case YESEXPR: - return (char *) "^[yY]"; - case NOEXPR: - return (char *) "^[nN]"; # endif default: break; diff --git a/lib/rpmatch.c b/lib/rpmatch.c index b1f06e3a54..febefb2a02 100644 --- a/lib/rpmatch.c +++ b/lib/rpmatch.c @@ -28,7 +28,7 @@ # include # include # include -# if HAVE_LANGINFO_YESEXPR +# if HAVE_LANGINFO_H # include # endif # include @@ -36,7 +36,7 @@ # define _(msgid) dgettext (GNULIB_TEXT_DOMAIN, msgid) # define N_(msgid) gettext_noop (msgid) -# if HAVE_LANGINFO_YESEXPR +# if HAVE_LANGINFO_H /* Return the localized regular expression pattern corresponding to ENGLISH_PATTERN. NL_INDEX can be used with nl_langinfo. The resulting string may only be used until the next nl_langinfo call. */ @@ -133,7 +133,7 @@ rpmatch (const char *response) static char *last_yesexpr, *last_noexpr; static regex_t cached_yesre, cached_nore; -# if HAVE_LANGINFO_YESEXPR +# if HAVE_LANGINFO_H bool posixly_correct = (getenv ("POSIXLY_CORRECT") != NULL); # endif diff --git a/m4/langinfo_h.m4 b/m4/langinfo_h.m4 index 69f936f00c..9b3b4db16e 100644 --- a/m4/langinfo_h.m4 +++ b/m4/langinfo_h.m4 @@ -1,5 +1,5 @@ # langinfo_h.m4 -# serial 13 +# serial 14 dnl Copyright (C) 2009-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, @@ -18,18 +18,15 @@ AC_DEFUN_ONCE([gl_LANGINFO_H], dnl Determine whether exists. It is missing on mingw and BeOS. HAVE_LANGINFO_CODESET=0 - HAVE_LANGINFO_T_FMT_AMPM=0 HAVE_LANGINFO_ALTMON=0 HAVE_LANGINFO_ABALTMON=0 HAVE_LANGINFO_ERA=0 - HAVE_LANGINFO_YESEXPR=0 AC_CHECK_HEADERS_ONCE([langinfo.h]) if test $ac_cv_header_langinfo_h = yes; then HAVE_LANGINFO_H=1 dnl Determine what defines. dnl CODESET is missing on OpenBSD 3.8. dnl ERA etc. are missing on OpenBSD 6.7. - dnl T_FMT_AMPM and YESEXPR, NOEXPR are missing on IRIX 5.3. dnl ALTMON_* are missing on glibc 2.26 and many other systems. dnl ABALTMON_* are missing on glibc 2.41 and many other systems. AC_CACHE_CHECK([whether langinfo.h defines CODESET], @@ -44,18 +41,6 @@ int a = CODESET; if test $gl_cv_header_langinfo_codeset = yes; then HAVE_LANGINFO_CODESET=1 fi - AC_CACHE_CHECK([whether langinfo.h defines T_FMT_AMPM], - [gl_cv_header_langinfo_t_fmt_ampm], - [AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([[#include -int a = T_FMT_AMPM; -]])], - [gl_cv_header_langinfo_t_fmt_ampm=yes], - [gl_cv_header_langinfo_t_fmt_ampm=no]) - ]) - if test $gl_cv_header_langinfo_t_fmt_ampm = yes; then - HAVE_LANGINFO_T_FMT_AMPM=1 - fi AC_CACHE_CHECK([whether langinfo.h defines ALTMON_1], [gl_cv_header_langinfo_altmon], [AC_COMPILE_IFELSE( @@ -92,28 +77,14 @@ int a = ERA; if test $gl_cv_header_langinfo_era = yes; then HAVE_LANGINFO_ERA=1 fi - AC_CACHE_CHECK([whether langinfo.h defines YESEXPR], - [gl_cv_header_langinfo_yesexpr], - [AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([[#include -int a = YESEXPR; -]])], - [gl_cv_header_langinfo_yesexpr=yes], - [gl_cv_header_langinfo_yesexpr=no]) - ]) - if test $gl_cv_header_langinfo_yesexpr = yes; then - HAVE_LANGINFO_YESEXPR=1 - fi else HAVE_LANGINFO_H=0 fi AC_SUBST([HAVE_LANGINFO_H]) AC_SUBST([HAVE_LANGINFO_CODESET]) - AC_SUBST([HAVE_LANGINFO_T_FMT_AMPM]) AC_SUBST([HAVE_LANGINFO_ALTMON]) AC_SUBST([HAVE_LANGINFO_ABALTMON]) AC_SUBST([HAVE_LANGINFO_ERA]) - AC_SUBST([HAVE_LANGINFO_YESEXPR]) dnl Check for declarations of anything we want to poison if the dnl corresponding gnulib module is not in use. diff --git a/m4/nl_langinfo.m4 b/m4/nl_langinfo.m4 index aeee0c1e36..8459fa4530 100644 --- a/m4/nl_langinfo.m4 +++ b/m4/nl_langinfo.m4 @@ -1,5 +1,5 @@ # nl_langinfo.m4 -# serial 12 +# serial 13 dnl Copyright (C) 2009-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, @@ -16,31 +16,6 @@ AC_DEFUN([gl_FUNC_NL_LANGINFO], AC_REQUIRE([gl_PTHREADLIB]) AC_CHECK_HEADERS_ONCE([threads.h]) if test $ac_cv_func_nl_langinfo = yes; then - # On Irix 6.5, YESEXPR is defined, but nl_langinfo(YESEXPR) is broken. - AC_CACHE_CHECK([whether YESEXPR works], - [gl_cv_func_nl_langinfo_yesexpr_works], - [AC_RUN_IFELSE( - [AC_LANG_PROGRAM([[#include -]], [[return !*nl_langinfo(YESEXPR); -]])], - [gl_cv_func_nl_langinfo_yesexpr_works=yes], - [gl_cv_func_nl_langinfo_yesexpr_works=no], - [ - case "$host_os" in - # Guess no on irix systems. - irix*) gl_cv_func_nl_langinfo_yesexpr_works="guessing no";; - # Guess yes elsewhere. - *) gl_cv_func_nl_langinfo_yesexpr_works="guessing yes";; - esac - ]) - ]) - case $gl_cv_func_nl_langinfo_yesexpr_works in - *yes) FUNC_NL_LANGINFO_YESEXPR_WORKS=1 ;; - *) FUNC_NL_LANGINFO_YESEXPR_WORKS=0 ;; - esac - AC_DEFINE_UNQUOTED([FUNC_NL_LANGINFO_YESEXPR_WORKS], - [$FUNC_NL_LANGINFO_YESEXPR_WORKS], - [Define to 1 if nl_langinfo (YESEXPR) returns a non-empty string.]) # On Solaris 10 and Solaris 11.3, nl_langinfo is not multithread-safe. case "$host_os" in solaris*) NL_LANGINFO_MTSAFE=0 ;; @@ -49,11 +24,9 @@ AC_DEFUN([gl_FUNC_NL_LANGINFO], AC_DEFINE_UNQUOTED([NL_LANGINFO_MTSAFE], [$NL_LANGINFO_MTSAFE], [Define to 1 if nl_langinfo is multithread-safe.]) if test $HAVE_LANGINFO_CODESET = 1 \ - && test $HAVE_LANGINFO_T_FMT_AMPM = 1 \ && test $HAVE_LANGINFO_ALTMON = 1 \ && test $HAVE_LANGINFO_ABALTMON = 1 \ && test $HAVE_LANGINFO_ERA = 1 \ - && test $FUNC_NL_LANGINFO_YESEXPR_WORKS = 1 \ && test $NL_LANGINFO_MTSAFE = 1; then : else diff --git a/m4/rpmatch.m4 b/m4/rpmatch.m4 index 450e4b06fb..9b69676d1c 100644 --- a/m4/rpmatch.m4 +++ b/m4/rpmatch.m4 @@ -1,5 +1,5 @@ # rpmatch.m4 -# serial 10 +# serial 11 dnl Copyright (C) 2002-2003, 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, @@ -20,14 +20,5 @@ AC_DEFUN([gl_FUNC_RPMATCH], # Prerequisites of lib/rpmatch.c. AC_DEFUN([gl_PREREQ_RPMATCH], [ - AC_CACHE_CHECK([for nl_langinfo and YESEXPR], [gl_cv_langinfo_yesexpr], - [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], - [[char* cs = nl_langinfo(YESEXPR); return !cs;]])], - [gl_cv_langinfo_yesexpr=yes], - [gl_cv_langinfo_yesexpr=no]) - ]) - if test $gl_cv_langinfo_yesexpr = yes; then - AC_DEFINE([HAVE_LANGINFO_YESEXPR], [1], - [Define if you have and nl_langinfo(YESEXPR).]) - fi + AC_CHECK_HEADERS_ONCE([langinfo.h]) ]) diff --git a/modules/langinfo-h b/modules/langinfo-h index 5370015a50..d09617a811 100644 --- a/modules/langinfo-h +++ b/modules/langinfo-h @@ -33,11 +33,9 @@ langinfo.h: langinfo.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_U -e 's|@''NEXT_LANGINFO_H''@|$(NEXT_LANGINFO_H)|g' \ -e 's/@''GNULIB_NL_LANGINFO''@/$(GNULIB_NL_LANGINFO)/g' \ -e 's|@''HAVE_LANGINFO_CODESET''@|$(HAVE_LANGINFO_CODESET)|g' \ - -e 's|@''HAVE_LANGINFO_T_FMT_AMPM''@|$(HAVE_LANGINFO_T_FMT_AMPM)|g' \ -e 's|@''HAVE_LANGINFO_ALTMON''@|$(HAVE_LANGINFO_ALTMON)|g' \ -e 's|@''HAVE_LANGINFO_ABALTMON''@|$(HAVE_LANGINFO_ABALTMON)|g' \ -e 's|@''HAVE_LANGINFO_ERA''@|$(HAVE_LANGINFO_ERA)|g' \ - -e 's|@''HAVE_LANGINFO_YESEXPR''@|$(HAVE_LANGINFO_YESEXPR)|g' \ -e 's|@''HAVE_NL_LANGINFO''@|$(HAVE_NL_LANGINFO)|g' \ -e 's|@''REPLACE_NL_LANGINFO''@|$(REPLACE_NL_LANGINFO)|g' \ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \