maint: update copyright
[gnulib.git] / m4 / vararrays.m4
1 # Check for variable-length arrays.
2
3 # serial 4
4
5 # From Paul Eggert
6
7 # Copyright (C) 2001, 2009-2014 Free Software Foundation, Inc.
8 # This file is free software; the Free Software Foundation
9 # gives unlimited permission to copy and/or distribute it,
10 # with or without modifications, as long as this notice is preserved.
11
12 AC_DEFUN([AC_C_VARARRAYS],
13 [
14   AC_CACHE_CHECK([for variable-length arrays],
15     ac_cv_c_vararrays,
16     [AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
17          [],
18          [[static int x; char a[++x]; a[sizeof a - 1] = 0; return a[0];]])],
19        ac_cv_c_vararrays=yes,
20        ac_cv_c_vararrays=no)])
21   if test $ac_cv_c_vararrays = yes; then
22     AC_DEFINE([HAVE_C_VARARRAYS], [1],
23       [Define to 1 if C supports variable-length arrays.])
24   fi
25 ])