File: cxx_have_bool.m4

package info (click to toggle)
xerces-c 3.2.4%2Bdebian-1.3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 19,948 kB
  • sloc: cpp: 167,201; xml: 23,619; sh: 4,789; ansic: 3,988; makefile: 1,438; perl: 355; javascript: 18
file content (30 lines) | stat: -rw-r--r-- 879 bytes parent folder | download | duplicates (14)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
dnl @synopsis AC_CXX_HAVE_BOOL
dnl
dnl If the compiler recognizes bool as a separate built-in type, define
dnl HAVE_BOOL. Note that a typedef is not a separate type since you
dnl cannot overload a function such that it accepts either the basic
dnl type or the typedef.
dnl
dnl @category Cxx
dnl @author Todd Veldhuizen
dnl @author Luc Maisonobe <luc@spaceroots.org>
dnl @version 2004-02-04
dnl @license AllPermissive

AC_DEFUN([AC_CXX_HAVE_BOOL],
[AC_CACHE_CHECK(whether the compiler recognizes bool as a built-in type,
ac_cv_cxx_have_bool,
[AC_LANG_SAVE
 AC_LANG_CPLUSPLUS
 AC_TRY_COMPILE([
int f(int  x){return 1;}
int f(char x){return 1;}
int f(bool x){return 1;}
],[bool b = true; return f(b);],
 ac_cv_cxx_have_bool=yes, ac_cv_cxx_have_bool=no)
 AC_LANG_RESTORE
])
if test "$ac_cv_cxx_have_bool" = yes; then
  AC_DEFINE(HAVE_BOOL,,[define if bool is a built-in type])
fi
])