]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
stdckdint-h, stdcountof-h, uchar-h: Simplify for when C++ is not used.
authorBruno Haible <bruno@clisp.org>
Wed, 6 May 2026 18:20:46 +0000 (20:20 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 6 May 2026 18:22:29 +0000 (20:22 +0200)
Reported by Pádraig Brady in
<https://lists.gnu.org/archive/html/bug-gnulib/2026-05/msg00032.html>.

* 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.

ChangeLog
m4/stdckdint_h.m4
m4/stdcountof_h.m4
m4/uchar_h.m4

index 0aef212c361a60ee45fc0521d333f2ed3580a7b7..9a5266197de9e5f307be15dc891a43ef86a50805 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2026-05-06  Bruno Haible  <bruno@clisp.org>
+
+       stdckdint-h, stdcountof-h, uchar-h: Simplify for when C++ is not used.
+       Reported by Pádraig Brady in
+       <https://lists.gnu.org/archive/html/bug-gnulib/2026-05/msg00032.html>.
+       * 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  <eggert@cs.ucla.edu>
 
        regex-tests: minor memory cleanup
index eb8c858a2dc4132a8c7ce5d1df3c62a8dfff4ac5..0abeb982b4cd736fcdded6d89ece9f9c9b8131d9 100644 (file)
@@ -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 \
index 74fa626088ca3bcb676185527a5a5dce41679233..6a888e2d97c5fdc1e2dc089e3687feac7e3fafc7 100644 (file)
@@ -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 <stdcountof.h>],
       [gl_cv_cxx_have_stdcountof_h],
       [dnl We can't use AC_LANG_PUSH([C++]) and AC_LANG_POP([C++]) here, due to
index 20b63b6cdf7f8f0497d476632195b8ff87361ec5..508f544c3d07331958113dbcb85e608e2a642066 100644 (file)
@@ -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 <uchar.h>],
       [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 <uchar.h> 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