mirror of
https://github.com/OpenVPN/openvpn.git
synced 2024-09-19 19:42:30 +02:00
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>
This commit is contained in:
parent
c5c3cef6d3
commit
bdd80be1fe
@ -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
|
||||
])
|
||||
|
Loading…
Reference in New Issue
Block a user