diff options
author | Alon Bar-Lev <alon.barlev@gmail.com> | 2012-02-29 22:11:52 +0200 |
---|---|---|
committer | David Sommerseth <davids@redhat.com> | 2012-03-22 22:07:07 +0100 |
commit | 0fc5b8b3390797b67bc48036649109a78f36a186 (patch) | |
tree | 0ac132ca273c76f11d8407639e093184befa01f9 /m4/ax_varargs.m4 | |
parent | d313dc950308d960f550279a69f445e712244beb (diff) | |
download | openvpn-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_varargs.m4')
-rw-r--r-- | m4/ax_varargs.m4 | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/m4/ax_varargs.m4 b/m4/ax_varargs.m4 new file mode 100644 index 0000000..fd5e8b0 --- /dev/null +++ b/m4/ax_varargs.m4 @@ -0,0 +1,43 @@ +dnl @synopsis AX_CPP_VARARG_MACRO_GCC +dnl +dnl Test if the preprocessor understands GNU GCC-style vararg macros. +dnl If it does, defines HAVE_CPP_VARARG_MACRO_GCC to 1. +dnl +dnl @version +dnl @author James Yonan <jim@yonan.net>, Matthias Andree <matthias.andree@web.de> +AC_DEFUN([AX_CPP_VARARG_MACRO_GCC], [dnl + AS_VAR_PUSHDEF([VAR],[ax_cv_cpp_vararg_macro_gcc])dnl + AC_CACHE_CHECK([for GNU GCC vararg macro support], VAR, [dnl + AC_COMPILE_IFELSE([AC_LANG_SOURCE([ + #define macro(a, b...) func(a, b) + int func(int a, int b, int c); + int test() { return macro(1, 2, 3); } + ])], [ VAR=yes ], [VAR=no])]) + if test $VAR = yes ; then + AC_DEFINE([HAVE_CPP_VARARG_MACRO_GCC], 1, + [Define to 1 if your compiler supports GNU GCC-style variadic macros]) + fi + AS_VAR_POPDEF([VAR])dnl +]) + +dnl @synopsis AX_CPP_VARARG_MACRO_ISO +dnl +dnl Test if the preprocessor understands ISO C 1999 vararg macros. +dnl If it does, defines HAVE_CPP_VARARG_MACRO_ISO to 1. +dnl +dnl @version +dnl @author James Yonan <jim@yonan.net>, Matthias Andree <matthias.andree@web.de> +AC_DEFUN([AX_CPP_VARARG_MACRO_ISO], [dnl + AS_VAR_PUSHDEF([VAR],[ax_cv_cpp_vararg_macro_iso])dnl + AC_CACHE_CHECK([for ISO C 1999 vararg macro support], VAR, [dnl + AC_COMPILE_IFELSE([AC_LANG_SOURCE([ +#define macro(a, ...) func(a, __VA_ARGS__) + int func(int a, int b, int c); + int test() { return macro(1, 2, 3); } + ])], [ VAR=yes ], [VAR=no])]) + if test $VAR = yes ; then + AC_DEFINE([HAVE_CPP_VARARG_MACRO_ISO], 1, + [Define to 1 if your compiler supports ISO C99 variadic macros]) + fi + AS_VAR_POPDEF([VAR])dnl +]) |