487 |
])# AC_HEADER_STAT |
])# AC_HEADER_STAT |
488 |
|
|
489 |
|
|
490 |
|
# AC_HEADER_STDBOOL |
491 |
|
# ----------------- |
492 |
|
# Check for stdbool.h that conforms to C99. |
493 |
|
AN_IDENTIFIER([bool], [AC_HEADER_STDBOOL]) |
494 |
|
AN_IDENTIFIER([true], [AC_HEADER_STDBOOL]) |
495 |
|
AN_IDENTIFIER([false],[AC_HEADER_STDBOOL]) |
496 |
|
AC_DEFUN([AC_HEADER_STDBOOL], |
497 |
|
[AC_CACHE_CHECK([for stdbool.h that conforms to C99], |
498 |
|
[ac_cv_header_stdbool_h], |
499 |
|
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM( |
500 |
|
[[ |
501 |
|
#include <stdbool.h> |
502 |
|
#ifndef bool |
503 |
|
# error bool is not defined |
504 |
|
#endif |
505 |
|
#ifndef false |
506 |
|
# error false is not defined |
507 |
|
#endif |
508 |
|
#if false |
509 |
|
# error false is not 0 |
510 |
|
#endif |
511 |
|
#ifndef true |
512 |
|
# error false is not defined |
513 |
|
#endif |
514 |
|
#if true != 1 |
515 |
|
# error true is not 1 |
516 |
|
#endif |
517 |
|
#ifndef __bool_true_false_are_defined |
518 |
|
# error __bool_true_false_are_defined is not defined |
519 |
|
#endif |
520 |
|
|
521 |
|
struct s { _Bool s: 1; _Bool t; } s; |
522 |
|
|
523 |
|
char a[true == 1 ? 1 : -1]; |
524 |
|
char b[false == 0 ? 1 : -1]; |
525 |
|
char c[__bool_true_false_are_defined == 1 ? 1 : -1]; |
526 |
|
char d[(bool) -0.5 == true ? 1 : -1]; |
527 |
|
bool e = &s; |
528 |
|
char f[(_Bool) -0.0 == false ? 1 : -1]; |
529 |
|
char g[true]; |
530 |
|
char h[sizeof (_Bool)]; |
531 |
|
char i[sizeof s.t]; |
532 |
|
]], |
533 |
|
[[ return !a + !b + !c + !d + !e + !f + !g + !h + !i; ]])], |
534 |
|
[ac_cv_header_stdbool_h=yes], |
535 |
|
[ac_cv_header_stdbool_h=no])]) |
536 |
|
if test $ac_cv_header_stdbool_h = yes; then |
537 |
|
AC_DEFINE(HAVE_STDBOOL_H, 1, [Define to 1 if stdbool.h conforms to C99.]) |
538 |
|
fi |
539 |
|
])# AC_HEADER_STDBOOL |
540 |
|
|
541 |
|
|
542 |
# AC_HEADER_STDC |
# AC_HEADER_STDC |
543 |
# -------------- |
# -------------- |
544 |
# FIXME: I find this list very strange. It comes from the original |
# FIXME: I find this list very strange. It comes from the original |