You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
879 B

  1. dnl @synopsis AC_CXX_HAVE_BOOL
  2. dnl
  3. dnl If the compiler recognizes bool as a separate built-in type, define
  4. dnl HAVE_BOOL. Note that a typedef is not a separate type since you
  5. dnl cannot overload a function such that it accepts either the basic
  6. dnl type or the typedef.
  7. dnl
  8. dnl @category Cxx
  9. dnl @author Todd Veldhuizen
  10. dnl @author Luc Maisonobe <luc@spaceroots.org>
  11. dnl @version 2004-02-04
  12. dnl @license AllPermissive
  13. AC_DEFUN([AC_CXX_HAVE_BOOL],
  14. [AC_CACHE_CHECK(whether the compiler recognizes bool as a built-in type,
  15. ac_cv_cxx_have_bool,
  16. [AC_LANG_SAVE
  17. AC_LANG_CPLUSPLUS
  18. AC_TRY_COMPILE([
  19. int f(int x){return 1;}
  20. int f(char x){return 1;}
  21. int f(bool x){return 1;}
  22. ],[bool b = true; return f(b);],
  23. ac_cv_cxx_have_bool=yes, ac_cv_cxx_have_bool=no)
  24. AC_LANG_RESTORE
  25. ])
  26. if test "$ac_cv_cxx_have_bool" = yes; then
  27. AC_DEFINE(HAVE_BOOL,,[define if bool is a built-in type])
  28. fi
  29. ])