diff --git a/cf/vararray.m4 b/cf/vararray.m4 new file mode 100644 index 000000000..bc218d6ba --- /dev/null +++ b/cf/vararray.m4 @@ -0,0 +1,17 @@ +dnl +dnl $Id$ +dnl +dnl Test for variable size arrays. +dnl + +AC_DEFUN([rk_C_VARARRAY], [ + AC_CACHE_CHECK([if the compiler supports variable-length arrays],[rk_cv_c_vararray],[ + AC_TRY_COMPILE([], + [int x = 0; { int y[x]; }], + [rk_cv_c_vararray=yes], + [rk_cv_c_vararray=no])]) + if test "$rk_cv_c_vararray" = yes; then + AC_DEFINE([HAVE_VARIABLE_LENGTH_ARRAY], [1], + [Define if your compiler supports variable-length arrays.]) + fi +])