Blame ETL/m4/cxx_macros.m4

darco b3016b
AC_DEFUN([AC_CXX_FUNCTION_NONTYPE_PARAMETERS],
darco b3016b
[AC_CACHE_CHECK(whether the compiler supports function templates with non-type parameters,
darco b3016b
ac_cv_cxx_function_nontype_parameters,
darco b3016b
[AC_LANG_SAVE
darco b3016b
 AC_LANG_CPLUSPLUS
darco b3016b
 AC_TRY_COMPILE([
darco b3016b
template<class int="" n="" t,=""> class A {};</class>
darco b3016b
template<class int="" n="" t,=""> int f(const A<t,n>& x) { return 0; }</t,n></class>
darco b3016b
],[A<double, 17=""> z; return f(z);],</double,>
darco b3016b
 ac_cv_cxx_function_nontype_parameters=yes, ac_cv_cxx_function_nontype_parameters=no)
darco b3016b
 AC_LANG_RESTORE
darco b3016b
])
darco b3016b
if test "$ac_cv_cxx_function_nontype_parameters" = yes; then
darco b3016b
  AC_DEFINE(HAVE_FUNCTION_NONTYPE_PARAMETERS,,
darco b3016b
            [define if the compiler supports function templates with non-type parameters])
darco b3016b
fi
darco b3016b
])
darco b3016b
darco b3016b
AC_DEFUN([AC_CXX_NAMESPACES],
darco b3016b
[AC_CACHE_CHECK(whether the compiler implements namespaces,
darco b3016b
ac_cv_cxx_namespaces,
darco b3016b
[AC_LANG_SAVE
darco b3016b
 AC_LANG_CPLUSPLUS
darco b3016b
 AC_TRY_COMPILE([namespace Outer { namespace Inner { int i = 0; }}],
darco b3016b
                [using namespace Outer::Inner; return i;],
darco b3016b
 ac_cv_cxx_namespaces=yes, ac_cv_cxx_namespaces=no)
darco b3016b
 AC_LANG_RESTORE
darco b3016b
])
darco b3016b
if test "$ac_cv_cxx_namespaces" = yes; then
darco b3016b
  AC_DEFINE(HAVE_NAMESPACES,,[define if the compiler implements namespaces])
darco b3016b
fi
darco b3016b
])
darco b3016b
darco b3016b
AC_DEFUN([AC_CXX_HAVE_COMPLEX],
darco b3016b
[AC_CACHE_CHECK(whether the compiler has complex<t>,</t>
darco b3016b
ac_cv_cxx_have_complex,
darco b3016b
[AC_REQUIRE([AC_CXX_NAMESPACES])
darco b3016b
 AC_LANG_SAVE
darco b3016b
 AC_LANG_CPLUSPLUS
darco b3016b
 AC_TRY_COMPILE([#include <complex></complex>
darco b3016b
#ifdef HAVE_NAMESPACES
darco b3016b
using namespace std;
darco b3016b
#endif],[complex<float> a; complex<double> b; return 0;],</double></float>
darco b3016b
 ac_cv_cxx_have_complex=yes, ac_cv_cxx_have_complex=no)
darco b3016b
 AC_LANG_RESTORE
darco b3016b
])
darco b3016b
if test "$ac_cv_cxx_have_complex" = yes; then
darco b3016b
  AC_DEFINE(HAVE_COMPLEX,,[define if the compiler has complex<t>])</t>
darco b3016b
fi
darco b3016b
])
darco b3016b
darco b3016b
AC_DEFUN([AC_CXX_HAVE_SSTREAM],
darco b3016b
[AC_CACHE_CHECK(whether the compiler has stringstream,
darco b3016b
ac_cv_cxx_have_sstream,
darco b3016b
[AC_REQUIRE([AC_CXX_NAMESPACES])
darco b3016b
 AC_LANG_SAVE
darco b3016b
 AC_LANG_CPLUSPLUS
darco b3016b
 AC_TRY_COMPILE([#include <sstream></sstream>
darco b3016b
#ifdef HAVE_NAMESPACES
darco b3016b
using namespace std;
darco b3016b
#endif],[stringstream message; message << "Hello"; return 0;],
darco b3016b
 ac_cv_cxx_have_sstream=yes, ac_cv_cxx_have_sstream=no)
darco b3016b
 AC_LANG_RESTORE
darco b3016b
])
darco b3016b
if test "$ac_cv_cxx_have_sstream" = yes; then
darco b3016b
  AC_DEFINE(HAVE_SSTREAM,,[define if the compiler has stringstream])
darco b3016b
fi
darco b3016b
])
darco b3016b
darco b3016b
AC_DEFUN([AC_CXX_MUTABLE],
darco b3016b
[AC_CACHE_CHECK(whether the compiler supports the mutable keyword,
darco b3016b
ac_cv_cxx_mutable,
darco b3016b
[AC_LANG_SAVE
darco b3016b
 AC_LANG_CPLUSPLUS
darco b3016b
 AC_TRY_COMPILE([
darco b3016b
class A { mutable int i;
darco b3016b
          public:
darco b3016b
          int f (int n) const { i = n; return i; }
darco b3016b
        };
darco b3016b
],[A a; return a.f (1);],
darco b3016b
 ac_cv_cxx_mutable=yes, ac_cv_cxx_mutable=no)
darco b3016b
 AC_LANG_RESTORE
darco b3016b
])
darco b3016b
if test "$ac_cv_cxx_mutable" = yes; then
darco b3016b
  AC_DEFINE(HAVE_MUTABLE,,[define if the compiler supports the mutable keyword])
darco b3016b
fi
darco b3016b
])
darco b3016b