summaryrefslogtreecommitdiffstats
path: root/m4/ax_emptyarray.m4
diff options
context:
space:
mode:
authorAlon Bar-Lev <alon.barlev@gmail.com>2012-02-29 22:11:52 +0200
committerDavid Sommerseth <davids@redhat.com>2012-03-22 22:07:07 +0100
commit0fc5b8b3390797b67bc48036649109a78f36a186 (patch)
tree0ac132ca273c76f11d8407639e093184befa01f9 /m4/ax_emptyarray.m4
parentd313dc950308d960f550279a69f445e712244beb (diff)
downloadopenvpn-0fc5b8b3390797b67bc48036649109a78f36a186.tar.gz
openvpn-0fc5b8b3390797b67bc48036649109a78f36a186.tar.xz
openvpn-0fc5b8b3390797b67bc48036649109a78f36a186.zip
build: split acinclude.m4 into m4/*
ax_emptyarray.m4 ax_openvpn_lib.m4 ax_socklen_t.m4 ax_varargs.m4 Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com> Acked-by: Adriaan de Jong <dejong@fox-it.com> Signed-off-by: David Sommerseth <davids@redhat.com>
Diffstat (limited to 'm4/ax_emptyarray.m4')
-rw-r--r--m4/ax_emptyarray.m427
1 files changed, 27 insertions, 0 deletions
diff --git a/m4/ax_emptyarray.m4 b/m4/ax_emptyarray.m4
new file mode 100644
index 0000000..0a8755c
--- /dev/null
+++ b/m4/ax_emptyarray.m4
@@ -0,0 +1,27 @@
+dnl @synopsis AX_EMPTY_ARRAY
+dnl
+dnl Define EMPTY_ARRAY_SIZE to be either "0"
+dnl or "" depending on which syntax the compiler
+dnl prefers for empty arrays in structs.
+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])
+ ])
+ ])
+ ]
+)