1 dnl --------------------------------------------------------------------------
4 dnl Find if typeof() exists, or an equivalent (__typeof__, decltype,
6 dnl --------------------------------------------------------------------------
7 AC_DEFUN([PA_C_TYPEOF],
8 [AC_CACHE_CHECK([if $CC supports typeof], [pa_cv_typeof],
10 for pa_typeof_try in typeof __typeof __typeof__ decltype __decltype __decltype__ _Decltype
12 AS_IF([test $pa_cv_typeof = no],
13 [AC_COMPILE_IFELSE([AC_LANG_SOURCE([
18 $pa_typeof_try(x) y = x*x;
22 [pa_cv_typeof=$pa_typeof_try])])
25 AS_IF([test $pa_cv_typeof = no],
27 [AC_DEFINE([HAVE_TYPEOF], 1,
28 [Define to 1 if you have some version of the typeof operator.])
29 AS_IF([test $pa_cv_typeof = typeof],
31 [AC_DEFINE_UNQUOTED([typeof], [$pa_cv_typeof],
32 [Define if your typeof operator is not named `typeof'.])])])])