diff options
author | Alon Bar-Lev | 2012-02-29 22:11:54 +0200 |
---|---|---|
committer | David Sommerseth | 2012-03-22 22:07:07 +0100 |
commit | bdd80be1fed0f4b3956246a44082a4226362074d (patch) | |
tree | 71b5823542a539f08b3ea5e8e43b62aa1ee98b8f /m4 | |
parent | c5c3cef6d374108ca230d701c86fe0b812e2cd3f (diff) | |
download | openvpn-bdd80be1fed0f4b3956246a44082a4226362074d.zip openvpn-bdd80be1fed0f4b3956246a44082a4226362074d.tar.gz |
build: m4/ax_emptyarray.m4: cleanup
Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
Diffstat (limited to 'm4')
-rw-r--r-- | m4/ax_emptyarray.m4 | 49 |
1 files changed, 31 insertions, 18 deletions
diff --git a/m4/ax_emptyarray.m4 b/m4/ax_emptyarray.m4 index 0a8755c..c6781c1 100644 --- a/m4/ax_emptyarray.m4 +++ b/m4/ax_emptyarray.m4 @@ -7,21 +7,34 @@ dnl dnl @version dnl @author James Yonan <jim@yonan.net> 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 +]) |