improve the ZERO_LENGTH_ARRAY test and fall back to using [1] if neither [0]

nor [] work.
This commit is contained in:
Bill Currie 2001-02-08 20:55:45 +00:00
parent 5f5456d2c0
commit 5b2561720e
1 changed files with 7 additions and 2 deletions

View File

@ -228,9 +228,14 @@ AC_TRY_COMPILE(
AC_MSG_CHECKING(for zero length array syntax)
AC_TRY_COMPILE(
[],
[int foo[0];],
[struct { int foo; int bar[0]; } foo;],
AC_DEFINE(ZERO_LENGTH_ARRAY,0) AC_MSG_RESULT([0]),
AC_DEFINE(ZERO_LENGTH_ARRAY,) AC_MSG_RESULT([])
AC_TRY_COMPILE(
[],
[struct { int foo; int bar[]; } foo;],
AC_DEFINE(ZERO_LENGTH_ARRAY,) AC_MSG_RESULT([]),
AC_DEFINE(ZERO_LENGTH_ARRAY,1) AC_MSG_RESULT([1] sorry about the waste)
)
)
dnl ==================================================================