]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
langinfo-h: Remove support for IRIX.
authorBruno Haible <bruno@clisp.org>
Wed, 10 Sep 2025 20:53:35 +0000 (22:53 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 10 Sep 2025 20:53:35 +0000 (22:53 +0200)
* 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 <langinfo.h>. Don't
test for YESEXPR.
* lib/rpmatch.c: Test HAVE_LANGINFO_H instead of HAVE_LANGINFO_YESEXPR.

ChangeLog
lib/langinfo.in.h
lib/nl_langinfo.c
lib/rpmatch.c
m4/langinfo_h.m4
m4/nl_langinfo.m4
m4/rpmatch.m4
modules/langinfo-h

index d1cbc4326cbba33cf29c243a9a6fd8b5c94eb7d2..ec463ca8a704592a8dc13b5232fa478a94f2963c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,19 @@
 2025-09-10  Bruno Haible  <bruno@clisp.org>
 
+       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 <langinfo.h>. 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,
index e16c95b3dd4d09b68836825e4db3a537d93b27e9..1b46759831ca4334fccafeeed8a69f67e88e38d0 100644 (file)
@@ -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.  */
index b87066bbfddacf62669fb0c19b38a7df3e5a0d06..df824a61f81013e89abc4ec1c0254e264a930ac4 100644 (file)
@@ -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;
index b1f06e3a54b7f1891988d45dd7fab460ad694ecb..febefb2a029fa396d34f15224097200783d3d94d 100644 (file)
@@ -28,7 +28,7 @@
 # include <sys/types.h>
 # include <limits.h>
 # include <string.h>
-# if HAVE_LANGINFO_YESEXPR
+# if HAVE_LANGINFO_H
 #  include <langinfo.h>
 # endif
 # include <regex.h>
@@ -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
 
index 69f936f00cb44340875672ded901dee3d38691db..9b3b4db16ee5e759be27929833a1c6f3a0a3a91d 100644 (file)
@@ -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 <langinfo.h> 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 <langinfo.h> 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 <langinfo.h>
-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 <langinfo.h>
-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.
index aeee0c1e36af0afd7d6d1cbd6a59a628c5093161..8459fa4530549b0b0e210c4eeafa795f863c061b 100644 (file)
@@ -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 <langinfo.h>
-]], [[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
index 450e4b06fbbca69de48b01b88c845c60b5e3271d..9b69676d1c5d2352c1f6e62c03e3c51ba6ef184d 100644 (file)
@@ -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 <langinfo.h>]],
-       [[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 <langinfo.h> and nl_langinfo(YESEXPR).])
-  fi
+  AC_CHECK_HEADERS_ONCE([langinfo.h])
 ])
index 5370015a50b1daf0bfd82158ae3cca67ba895e31..d09617a811df53458eb336677a8ff34f53c4b168 100644 (file)
@@ -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)' \