|
From: | David Seifert |
Subject: | Re: [PATCH] Amend AC_CHECK_HEADER_STDBOOL for C++11 and modern dialects |
Date: | Wed, 1 Jun 2016 10:29:46 +0200 |
On 31 May 2016, at 18:07, Paul Eggert <address@hidden> wrote:
Dear Paul, thanks for adding the patches, and yes, __bool_true_false_are_defined is defined in C++. I have been pondering the following improvements: stdbool.m4 is supposed to merely check that stdbool.h fulfills C99 requirements. Why does it then necessarily check whether bool is a defined _macro_? The reason why I am asking this, as clang++ currently gets rejected, as it only defines the macros when __GNUC__ is defined: /* Don't define bool, true, and false in C++, except as a GNU extension. */ #ifndef __cplusplus #define bool _Bool #define true 1 #define false 0 #elif defined(__GNUC__) && !defined(__STRICT_ANSI__) /* Define _Bool, bool, false, true as a GNU extension. */ #define _Bool bool #define bool bool #define false false #define true true #endif Wouldn't it be better to change the stdbool.m4 macro to instead try and use "bool" in a statement or as a type, instead of checking whether the macro "bool" is defined. This is more general and will work with more compilers. What do you think? Regards David |
[Prev in Thread] | Current Thread | [Next in Thread] |