summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2019-12-07 15:13:57 +0100
committerBruno Haible <bruno@clisp.org>2019-12-07 15:13:57 +0100
commit615c8bccb001feafc1253a332a0a069c9037aab0 (patch)
tree8d4d599c2c973e27ae14658dcffc22cae5a7f87f
parentb943dd6649ea85729999d67a684988c2711a83e6 (diff)
downloadgnulib-615c8bccb001feafc1253a332a0a069c9037aab0.tar.gz
gnulib-615c8bccb001feafc1253a332a0a069c9037aab0.tar.bz2
Fix compilation errors in C++ mode on Solaris 10.
* m4/stdbool.m4 (AM_STDBOOL_H): Require AC_CANONICAL_HOST. Set STDBOOL_H to non-empty on Solaris with a non-GCC compiler. * doc/posix-headers/stdbool.texi: Mention the Solaris issue.
-rw-r--r--ChangeLog7
-rw-r--r--doc/posix-headers/stdbool.texi3
-rw-r--r--m4/stdbool.m422
3 files changed, 28 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index df9aecc44e..a9882c23fa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2019-12-07 Bruno Haible <bruno@clisp.org>
+ Fix compilation errors in C++ mode on Solaris 10.
+ * m4/stdbool.m4 (AM_STDBOOL_H): Require AC_CANONICAL_HOST. Set STDBOOL_H
+ to non-empty on Solaris with a non-GCC compiler.
+ * doc/posix-headers/stdbool.texi: Mention the Solaris issue.
+
+2019-12-07 Bruno Haible <bruno@clisp.org>
+
Reword NEWS entry.
* NEWS: Reword the latest NEWS entry.
diff --git a/doc/posix-headers/stdbool.texi b/doc/posix-headers/stdbool.texi
index 5a2ff6a9dc..5b7ed0753f 100644
--- a/doc/posix-headers/stdbool.texi
+++ b/doc/posix-headers/stdbool.texi
@@ -11,6 +11,9 @@ Portability problems fixed by Gnulib:
This header file is missing on some platforms:
AIX 5.1, HP-UX 11, IRIX 6.5.
@item
+This header file is not usable in C++ mode with the vendor compiler
+on Solaris 10.
+@item
Some compilers have bugs relating to @samp{bool}.
@item
This header file defines @code{true} incorrectly on some platforms:
diff --git a/m4/stdbool.m4 b/m4/stdbool.m4
index acb852244f..b470b05c54 100644
--- a/m4/stdbool.m4
+++ b/m4/stdbool.m4
@@ -5,18 +5,32 @@ 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 8
# Prepare for substituting <stdbool.h> if it is not supported.
AC_DEFUN([AM_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
+ STDBOOL_H='stdbool.h'
+ else
+ STDBOOL_H=''
+ fi
+ ;;
+ *)
+ STDBOOL_H=''
+ ;;
+ esac
else
STDBOOL_H='stdbool.h'
fi

Return to:

Send suggestions and report system problems to the System administrator.