[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gnulib] lib/stdbool_.h doesn't honor HAVE__BOOL
From: |
Bruno Haible |
Subject: |
Re: [bug-gnulib] lib/stdbool_.h doesn't honor HAVE__BOOL |
Date: |
Tue, 24 Jan 2006 22:44:29 +0100 |
User-agent: |
KMail/1.5 |
Albert Chin wrote:
> The HP-UX 11.23/IA aCC6 compiler has bool and _Bool. This generates an
> error building something that includes gnulib's auto-generated stdbool.h:
> "../include/stdbool.h", line 84: error #2084: invalid combination of
> type specifiers
> typedef bool _Bool;
> ^
>
> Patch below fixes this.
Thanks, I've applied an equivalent of your patch. Sorry for the extremely
long delay.
Bruno
2006-01-24 Bruno Haible <address@hidden>
* stdbool_.h (_Bool) [__cplusplus]: Don't define if the compiler already
has it.
Report and patch by Albert Chin-A-Young <address@hidden> on
2005-11-26.
*** stdbool_.h 24 Jan 2006 21:44:37 -0000 1.7
--- stdbool_.h 24 Jan 2006 21:49:18 -0000
***************
*** 70,76 ****
(see ISO C 99 6.7.2.2.(4)); however, '_Bool' must promote to 'int'
(see ISO C 99 6.3.1.1.(2)). So we add a negative value to the
enum; this ensures that '_Bool' promotes to 'int'. */
! #if !(defined __cplusplus || defined __BEOS__)
# if @HAVE__BOOL@
# if defined __HP_cc || defined __xlc__
/* Some HP-UX cc and AIX IBM C compiler versions have compiler bugs when
--- 70,83 ----
(see ISO C 99 6.7.2.2.(4)); however, '_Bool' must promote to 'int'
(see ISO C 99 6.3.1.1.(2)). So we add a negative value to the
enum; this ensures that '_Bool' promotes to 'int'. */
! #if defined __cplusplus || defined __BEOS__
! /* A compiler known to have 'bool'. */
! /* If the compiler already has both 'bool' and '_Bool', we can assume they
! are the same types. */
! # if address@hidden@
! typedef bool _Bool;
! # endif
! #else
# if @HAVE__BOOL@
# if defined __HP_cc || defined __xlc__
/* Some HP-UX cc and AIX IBM C compiler versions have compiler bugs when
***************
*** 91,98 ****
typedef enum { _Bool_must_promote_to_int = -1, false = 0, true = 1 } _Bool;
# endif
# endif
- #else
- typedef bool _Bool;
#endif
#define bool _Bool
--- 98,103 ----
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [bug-gnulib] lib/stdbool_.h doesn't honor HAVE__BOOL,
Bruno Haible <=