On 11/30/2009 10:19 PM, Ralf Wildenhues wrote:
- AC_HEADER_STDBOOL
   probably a macro bug, haven't investigated yet.

Not necessarily; _Bool is not provided by g++ unless stdbool.h is included. Can be fixed by the attached patch, but it's better declared a feature given that the suggested snippet in the documentation uses HAVE__BOOL only if stdbool.h is not found.

Paolo
>From 480aade50f27e18a0e3d6731b856d70752bb15d4 Mon Sep 17 00:00:00 2001
From: Paolo Bonzini <bonz...@gnu.org>
Date: Tue, 1 Dec 2009 11:38:19 +0100
Subject: [PATCH] Fix _Bool detection under G++.

* lib/autoconf/headers.m4 (AC_HEADER_STDBOOL): Include stdbool.h
when testing for _Bool.
---
 ChangeLog               |    6 ++++++
 lib/autoconf/headers.m4 |    4 +++-
 2 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 572d645..71c6182 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-12-01  Paolo Bonzini  <bonz...@gnu.org>
+
+       Fix _Bool detection under G++.
+       * lib/autoconf/headers.m4 (AC_HEADER_STDBOOL): Include stdbool.h
+       when testing for _Bool.
+
 2009-11-27  Paolo Bonzini  <bonz...@gnu.org>
 
        Bump m4.m4 serial number.
diff --git a/lib/autoconf/headers.m4 b/lib/autoconf/headers.m4
index 5c35ab5..d9e291d 100644
--- a/lib/autoconf/headers.m4
+++ b/lib/autoconf/headers.m4
@@ -674,7 +674,9 @@ AC_DEFUN([AC_HEADER_STDBOOL],
       ]])],
       [ac_cv_header_stdbool_h=yes],
       [ac_cv_header_stdbool_h=no])])
-AC_CHECK_TYPES([_Bool])
+AC_CHECK_TYPES([_Bool], , ,
+[AC_INCLUDES_DEFAULT
+#include <stdbool.h>])
 if test $ac_cv_header_stdbool_h = yes; then
   AC_DEFINE(HAVE_STDBOOL_H, 1, [Define to 1 if stdbool.h conforms to C99.])
 fi
-- 
1.6.5.2

Reply via email to