svn commit: r228878 - head/include

David Chisnall theraven at FreeBSD.org
Fri Dec 30 17:45:20 UTC 2011


On 30 Dec 2011, at 16:52, Sean C. Farley wrote:

>> My quick googling didn't show anything at all about the C++ standard and stdbool.h or __bool_true_false_are_defined.  It was probably originally set because bool, true, and false are all C++ keywords so certain code that wanted to ifdef on them didn't also need to check __cplusplus.
> 
> I did not find anything definitive either.

It's usually a better idea to check the spec than Google...

stdbool.h is not part of the C++ standard, and so it is free to contain anything in C++ mode, just as any other non-standard header is.  The <cstdbool> header is defined by the C++11 spec as containing JUST the __bool_true_false_are_defined macro.  The purpose of this header in C++ mode is to allow the inclusion of C++ headers that expect to be able to use true and false and guard this by the use of the __bool_true_false_are_defined macro.

David


More information about the svn-src-head mailing list