Mercurial > hg > octave-lojdl > gnulib-hg
changeset 14183:bbf9bddcef7d
stdbool-tests: accomodate Haiku
* tests/test-stdbool.c: Haiku's gcc 2.95 lacks native _Bool.
Signed-off-by: Eric Blake <eblake@redhat.com>
author | Eric Blake <eblake@redhat.com> |
---|---|
date | Wed, 19 Jan 2011 08:20:56 -0700 |
parents | f6ec6d171e52 |
children | 3cb76305b3e9 |
files | ChangeLog tests/test-stdbool.c |
diffstat | 2 files changed, 7 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2011-01-19 Eric Blake <eblake@redhat.com> + stdbool-tests: accomodate Haiku + * tests/test-stdbool.c: Haiku's gcc 2.95 lacks native _Bool. + binary-io: fix O_TEXT on Haiku * modules/binary-io (Depends-on): Add fcntl-h. * lib/binary-io.h (O_TEXT): Rely on replacement <fcntl.h> rather
--- a/tests/test-stdbool.c +++ b/tests/test-stdbool.c @@ -52,14 +52,14 @@ /* Several tests cannot be guaranteed with gnulib's <stdbool.h>, at least, not for all compilers and compiler options. */ -#if HAVE_STDBOOL_H || defined __GNUC__ +#if HAVE_STDBOOL_H || 3 <= __GNUC__ struct s { _Bool s: 1; _Bool t; } s; #endif char a[true == 1 ? 1 : -1]; char b[false == 0 ? 1 : -1]; char c[__bool_true_false_are_defined == 1 ? 1 : -1]; -#if HAVE_STDBOOL_H || defined __GNUC__ /* See above. */ +#if HAVE_STDBOOL_H || 3 <= __GNUC__ /* See above. */ char d[(bool) 0.5 == true ? 1 : -1]; # ifdef ADDRESS_CHECK_OKAY /* Avoid gcc warning. */ /* C99 may plausibly be interpreted as not requiring support for a cast from @@ -73,7 +73,7 @@ #endif char g[true]; char h[sizeof (_Bool)]; -#if HAVE_STDBOOL_H || defined __GNUC__ /* See above. */ +#if HAVE_STDBOOL_H || 3 <= __GNUC__ /* See above. */ char i[sizeof s.t]; #endif enum { j = false, k = true, l = false * true, m = true * 256 }; @@ -92,7 +92,7 @@ { int error = 0; -#if HAVE_STDBOOL_H || defined __GNUC__ /* See above. */ +#if HAVE_STDBOOL_H || 3 <= __GNUC__ /* See above. */ # ifdef ADDRESS_CHECK_OKAY /* Avoid gcc warning. */ /* A cast from a variable's address to bool is valid in expressions. */ {