bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lib/stdbool_.h doesn't honor HAVE__BOOL


From: Paul Eggert
Subject: Re: lib/stdbool_.h doesn't honor HAVE__BOOL
Date: Sun, 27 Nov 2005 22:15:40 -0800
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

Albert Chin <address@hidden> writes:

> On Fri, Nov 25, 2005 at 11:11:05PM -0800, Paul Eggert wrote:
>> +#if defined __cplusplus || defined __BEOS__
>>  typedef bool _Bool;
>> +#else
>
> This will break on C++ compilers with bool _and_ _Bool, like the HP-UX
> 11.23/IA-64 aCC6 compiler.

I assume the following further patch would fix this?  If so, I can
prepare a standalone patch along these lines.

--- stdbool_.h.~1.6.~   2005-11-25 22:16:30.000000000 -0800
+++ stdbool_.h  2005-11-27 22:13:52.000000000 -0800
@@ -59,10 +59,10 @@
 # include <OS.h> /* defines bool but not _Bool */
 #endif
 
-/* C++ and BeOS have a reliable _Bool.  Otherwise, since this file is
-   being compiled, the system <stdbool.h> is not reliable so assume
-   that the system _Bool is not reliable either.  Under that
-   assumption, it is tempting to write
+/* C++ and BeOS have a reliable bool (and _Bool, if it exists).
+   Otherwise, since this file is being compiled, the system
+   <stdbool.h> is not reliable so assume that the system _Bool is not
+   reliable either.  Under that assumption, it is tempting to write
 
       typedef enum { false, true } _Bool;
 
@@ -88,7 +88,9 @@
    existing definition of _Bool and use our own.  */
 
 #if defined __cplusplus || defined __BEOS__
+# if !HAVE__BOOL
 typedef bool _Bool;
+# endif
 #else
 # define _Bool signed char
 #endif




reply via email to

[Prev in Thread] Current Thread [Next in Thread]