comparison acinclude.m4 @ 10380:60acc47c203f

configure checks for complex element setter/reference accessor methods
author John W. Eaton <jwe@octave.org>
date Mon, 01 Mar 2010 15:02:25 -0500
parents 6a50aa2cdf00
children bcabc1c4f20c
comparison
equal deleted inserted replaced
10379:f578e6468d0c 10380:60acc47c203f
100 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], 100 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],
101 [[void test(char *); int length(); char x[length()]; test(x);]])], 101 [[void test(char *); int length(); char x[length()]; test(x);]])],
102 octave_cv_dynamic_auto_arrays=yes, octave_cv_dynamic_auto_arrays=no)]) 102 octave_cv_dynamic_auto_arrays=yes, octave_cv_dynamic_auto_arrays=no)])
103 if test $octave_cv_dynamic_auto_arrays = yes; then 103 if test $octave_cv_dynamic_auto_arrays = yes; then
104 AC_DEFINE(HAVE_DYNAMIC_AUTO_ARRAYS,1,[Define if C++ supports dynamic auto arrays]) 104 AC_DEFINE(HAVE_DYNAMIC_AUTO_ARRAYS,1,[Define if C++ supports dynamic auto arrays])
105 fi
106 AC_LANG_POP(C++)
107 ])
108 dnl
109 dnl See if the C++ library has functions to set real and imaginary
110 dnl parts of complex numbers independently.
111 dnl
112 AC_DEFUN([OCTAVE_CXX_COMPLEX_SETTERS],
113 [AC_CACHE_CHECK([whether complex class can set components independently],
114 octave_cv_cxx_complex_setters,
115 [AC_LANG_PUSH(C++)
116 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <complex>]],
117 [[std::complex<double> x; x.real (1.0); x.imag (2.0);]])],
118 octave_cv_cxx_complex_setters=yes, octave_cv_cxx_complex_setters=no)])
119 if test $octave_cv_cxx_complex_setters = yes; then
120 AC_DEFINE(HAVE_CXX_COMPLEX_SETTERS,1,[Define if C++ complex class has void real (T) and void imag (T) methods])
121 fi
122 AC_LANG_POP(C++)
123 ])
124 dnl
125 dnl See if the C++ library has functions to access real and imaginary
126 dnl parts of complex numbers independently via references.
127 dnl
128 AC_DEFUN([OCTAVE_CXX_COMPLEX_REFERENCE_ACCESSORS],
129 [AC_CACHE_CHECK([whether complex class can reference components independently],
130 octave_cv_cxx_complex_reference_accessors,
131 [AC_LANG_PUSH(C++)
132 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <complex>]],
133 [[std::complex<double> x; x.real () = 1.0; x.imag () = 1.0;]])],
134 octave_cv_cxx_complex_reference_accessors=yes, octave_cv_cxx_complex_reference_accessors=no)])
135 if test $octave_cv_cxx_complex_reference_accessors = yes; then
136 AC_DEFINE(HAVE_CXX_COMPLEX_REFERENCE_ACCESSORS,1,[Define if C++ complex class has T& real (void) and T& imag (void) methods])
105 fi 137 fi
106 AC_LANG_POP(C++) 138 AC_LANG_POP(C++)
107 ]) 139 ])
108 dnl 140 dnl
109 dnl The following test is from Karl Berry's Kpathseach library. I'm 141 dnl The following test is from Karl Berry's Kpathseach library. I'm