xref: /minix3/crypto/external/bsd/heimdal/dist/cf/vararray.m4 (revision ebfedea0ce5bbe81e252ddf32d732e40fb633fae)
1*ebfedea0SLionel Sambucdnl
2*ebfedea0SLionel Sambucdnl Id
3*ebfedea0SLionel Sambucdnl
4*ebfedea0SLionel Sambucdnl Test for variable size arrays.
5*ebfedea0SLionel Sambucdnl
6*ebfedea0SLionel Sambuc
7*ebfedea0SLionel SambucAC_DEFUN([rk_C_VARARRAY], [
8*ebfedea0SLionel Sambuc	AC_CACHE_CHECK([if the compiler supports variable-length arrays],[rk_cv_c_vararray],[
9*ebfedea0SLionel Sambuc	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[int x = 0; { int y[x]; }]])],
10*ebfedea0SLionel Sambuc		[rk_cv_c_vararray=yes],
11*ebfedea0SLionel Sambuc		[rk_cv_c_vararray=no])])
12*ebfedea0SLionel Sambuc	if test "$rk_cv_c_vararray" = yes; then
13*ebfedea0SLionel Sambuc		AC_DEFINE([HAVE_VARIABLE_LENGTH_ARRAY], [1],
14*ebfedea0SLionel Sambuc			[Define if your compiler supports variable-length arrays.])
15*ebfedea0SLionel Sambuc	fi
16*ebfedea0SLionel Sambuc])
17