forked from OpenVPN/openvpn
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Alon Bar-Lev <[email protected]> Acked-by: David Sommerseth <[email protected]> Signed-off-by: David Sommerseth <[email protected]>
- Loading branch information
Showing
1 changed file
with
31 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,21 +7,34 @@ dnl | |
dnl @version | ||
dnl @author James Yonan <[email protected]> | ||
AC_DEFUN([AX_EMPTY_ARRAY], [ | ||
AC_MSG_RESULT([checking for C compiler empty array support]) | ||
AC_COMPILE_IFELSE([AC_LANG_SOURCE( | ||
[ | ||
struct { int foo; int bar[[0]]; } mystruct; | ||
])], [ | ||
AC_DEFINE_UNQUOTED(EMPTY_ARRAY_SIZE, 0, [Dimension to use for empty array declaration]) | ||
], [ | ||
AC_COMPILE_IFELSE([AC_LANG_SOURCE( | ||
[ | ||
struct { int foo; int bar[[]]; } mystruct; | ||
])], [ | ||
AC_DEFINE_UNQUOTED(EMPTY_ARRAY_SIZE,, [Dimension to use for empty array declaration]) | ||
], [ | ||
AC_MSG_ERROR([C compiler is unable to creaty empty arrays]) | ||
]) | ||
]) | ||
] | ||
) | ||
AS_VAR_PUSHDEF([VAR],[ax_cv_c_empty_array])dnl | ||
AC_CACHE_CHECK( | ||
[for C compiler empty array size], | ||
[VAR], | ||
[AC_COMPILE_IFELSE( | ||
[AC_LANG_PROGRAM( | ||
, | ||
[[ | ||
struct { int foo; int bar[0]; } mystruct; | ||
]] | ||
)], | ||
[VAR=0], | ||
[AC_COMPILE_IFELSE( | ||
[AC_LANG_PROGRAM( | ||
, | ||
[[ | ||
struct { int foo; int bar[]; } mystruct; | ||
]] | ||
)], | ||
[VAR=], | ||
[AC_MSG_ERROR([C compiler is unable to creaty empty arrays])] | ||
)] | ||
)] | ||
)dnl | ||
AC_DEFINE_UNQUOTED( | ||
[EMPTY_ARRAY_SIZE], | ||
[$VAR], | ||
[Dimension to use for empty array declaration] | ||
)dnl | ||
AS_VAR_POPDEF([VAR])dnl | ||
]) |