summaryrefslogtreecommitdiff
path: root/gnulib-m4/stdbool.m4
diff options
context:
space:
mode:
Diffstat (limited to 'gnulib-m4/stdbool.m4')
-rw-r--r--gnulib-m4/stdbool.m433
1 files changed, 21 insertions, 12 deletions
diff --git a/gnulib-m4/stdbool.m4 b/gnulib-m4/stdbool.m4
index f8c05776..3e6c4005 100644
--- a/gnulib-m4/stdbool.m4
+++ b/gnulib-m4/stdbool.m4
@@ -1,27 +1,39 @@
# Check for stdbool.h that conforms to C99.
-dnl Copyright (C) 2002-2006, 2009-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2006, 2009-2022 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
-#serial 7
+#serial 9
# Prepare for substituting <stdbool.h> if it is not supported.
-AC_DEFUN([AM_STDBOOL_H],
+AC_DEFUN([gl_STDBOOL_H],
[
AC_REQUIRE([AC_CHECK_HEADER_STDBOOL])
+ AC_REQUIRE([AC_CANONICAL_HOST])
- # Define two additional variables used in the Makefile substitution.
-
+ dnl On some platforms, <stdbool.h> does not exist or does not conform to C99.
+ dnl On Solaris 10 with CC=cc CXX=CC, <stdbool.h> exists but is not usable
+ dnl in C++ mode (and no <cstdbool> exists). In this case, we use our
+ dnl replacement, also in C mode (for binary compatibility between C and C++).
if test "$ac_cv_header_stdbool_h" = yes; then
- STDBOOL_H=''
+ case "$host_os" in
+ solaris*)
+ if test -z "$GCC"; then
+ GL_GENERATE_STDBOOL_H=true
+ else
+ GL_GENERATE_STDBOOL_H=false
+ fi
+ ;;
+ *)
+ GL_GENERATE_STDBOOL_H=false
+ ;;
+ esac
else
- STDBOOL_H='stdbool.h'
+ GL_GENERATE_STDBOOL_H=true
fi
- AC_SUBST([STDBOOL_H])
- AM_CONDITIONAL([GL_GENERATE_STDBOOL_H], [test -n "$STDBOOL_H"])
if test "$ac_cv_type__Bool" = yes; then
HAVE__BOOL=1
@@ -31,9 +43,6 @@ AC_DEFUN([AM_STDBOOL_H],
AC_SUBST([HAVE__BOOL])
])
-# AM_STDBOOL_H will be renamed to gl_STDBOOL_H in the future.
-AC_DEFUN([gl_STDBOOL_H], [AM_STDBOOL_H])
-
# This version of the macro is needed in autoconf <= 2.68.
AC_DEFUN([AC_CHECK_HEADER_STDBOOL],