source: icXML/icXML-devel/m4/cxx_have_bool.m4 @ 2723

Last change on this file since 2723 was 2723, checked in by cameron, 7 years ago

Add Xerces build system scripts

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