From: Bruno Haible Date: Wed, 6 May 2026 18:20:46 +0000 (+0200) Subject: stdckdint-h, stdcountof-h, uchar-h: Simplify for when C++ is not used. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=71cc23ddc86162e73efc29cc6ffda9e7dc88416d;p=thirdparty%2Fgnulib.git stdckdint-h, stdcountof-h, uchar-h: Simplify for when C++ is not used. Reported by Pádraig Brady in . * m4/stdckdint_h.m4 (gl_STDCKDINT_H): When $CXX is empty, don't run C++ specific tests. * m4/stdcountof_h.m4 (gl_STDCOUNTOF_H): Likewise. * m4/uchar_h.m4 (gl_UCHAR_H): Likewise. --- diff --git a/ChangeLog b/ChangeLog index 0aef212c36..9a5266197d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2026-05-06 Bruno Haible + + stdckdint-h, stdcountof-h, uchar-h: Simplify for when C++ is not used. + Reported by Pádraig Brady in + . + * m4/stdckdint_h.m4 (gl_STDCKDINT_H): When $CXX is empty, don't run C++ + specific tests. + * m4/stdcountof_h.m4 (gl_STDCOUNTOF_H): Likewise. + * m4/uchar_h.m4 (gl_UCHAR_H): Likewise. + 2026-05-06 Paul Eggert regex-tests: minor memory cleanup diff --git a/m4/stdckdint_h.m4 b/m4/stdckdint_h.m4 index eb8c858a2d..0abeb982b4 100644 --- a/m4/stdckdint_h.m4 +++ b/m4/stdckdint_h.m4 @@ -1,5 +1,5 @@ # stdckdint_h.m4 -# serial 1 +# serial 2 dnl Copyright 2025-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -52,7 +52,7 @@ AC_DEFUN_ONCE([gl_STDCKDINT_H], HAVE_C_STDCKDINT_H=0 HAVE_WORKING_C_STDCKDINT_H=0 fi - if test "$CXX" != no; then + if test -n "$CXX" && test "$CXX" != no; then AC_CACHE_CHECK([whether stdckdint.h can be included in C++], [gl_cv_header_cxx_stdckdint_h], [dnl We can't use AC_LANG_PUSH([C++]) and AC_LANG_POP([C++]) here, due to @@ -114,7 +114,7 @@ EOF AC_SUBST([HAVE_CXX_STDCKDINT_H]) AC_SUBST([HAVE_WORKING_CXX_STDCKDINT_H]) - if test "$CXX" != no; then + if test -n "$CXX" && test "$CXX" != no; then dnl We might need the header for C or C++. if test $HAVE_C_STDCKDINT_H = 1 \ && test $HAVE_WORKING_C_STDCKDINT_H = 1 \ diff --git a/m4/stdcountof_h.m4 b/m4/stdcountof_h.m4 index 74fa626088..6a888e2d97 100644 --- a/m4/stdcountof_h.m4 +++ b/m4/stdcountof_h.m4 @@ -1,5 +1,5 @@ # stdcountof_h.m4 -# serial 2 +# serial 3 dnl Copyright 2025-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -21,7 +21,7 @@ AC_DEFUN_ONCE([gl_STDCOUNTOF_H], dnl it uses _Countof, which is not a compiler built-in in C++ mode. m4_ifdef([gl_ANSI_CXX], [AC_REQUIRE([gl_ANSI_CXX])]) CXX_HAVE_STDCOUNTOF_H=1 - if test "$CXX" != no; then + if test -n "$CXX" && test "$CXX" != no; then AC_CACHE_CHECK([whether the C++ compiler has ], [gl_cv_cxx_have_stdcountof_h], [dnl We can't use AC_LANG_PUSH([C++]) and AC_LANG_POP([C++]) here, due to diff --git a/m4/uchar_h.m4 b/m4/uchar_h.m4 index 20b63b6cdf..508f544c3d 100644 --- a/m4/uchar_h.m4 +++ b/m4/uchar_h.m4 @@ -1,5 +1,5 @@ # uchar_h.m4 -# serial 32 +# serial 33 dnl Copyright (C) 2019-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -27,7 +27,7 @@ AC_DEFUN_ONCE([gl_UCHAR_H], dnl header." m4_ifdef([gl_ANSI_CXX], [AC_REQUIRE([gl_ANSI_CXX])]) CXX_HAVE_UCHAR_H=0 - if test "$CXX" != no; then + if test -n "$CXX" && test "$CXX" != no; then AC_CACHE_CHECK([whether the C++ compiler has ], [gl_cv_cxx_have_uchar_h], [dnl We can't use AC_LANG_PUSH([C++]) and AC_LANG_POP([C++]) here, due to @@ -61,7 +61,7 @@ EOF m4_ifdef([gl_ANSI_CXX], [AC_REQUIRE([gl_ANSI_CXX])]) CXX_HAS_UCHAR_TYPES=0 if test $HAVE_UCHAR_H = 0; then - if test "$CXX" != no; then + if test -n "$CXX" && test "$CXX" != no; then AC_CACHE_CHECK([whether the C++ compiler predefines the types], [gl_cv_cxx_has_uchar_types], [dnl We can't use AC_LANG_PUSH([C++]) and AC_LANG_POP([C++]) here, due to @@ -87,7 +87,7 @@ EOF AC_SUBST([CXX_HAS_UCHAR_TYPES]) CXX_HAS_CHAR8_TYPE=0 if test $HAVE_UCHAR_H = 0; then - if test "$CXX" != no; then + if test -n "$CXX" && test "$CXX" != no; then AC_CACHE_CHECK([whether the C++ compiler predefines the char8_t type], [gl_cv_cxx_has_char8_type], [dnl We can't use AC_LANG_PUSH([C++]) and AC_LANG_POP([C++]) here, due to