mirror of
https://github.com/OpenVPN/openvpn.git
synced 2025-05-09 05:31:05 +08:00
build: m4/ax_varargs.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
0fc5b8b339
commit
c5c3cef6d3
@ -6,17 +6,33 @@ dnl
|
|||||||
dnl @version
|
dnl @version
|
||||||
dnl @author James Yonan <jim@yonan.net>, Matthias Andree <matthias.andree@web.de>
|
dnl @author James Yonan <jim@yonan.net>, Matthias Andree <matthias.andree@web.de>
|
||||||
AC_DEFUN([AX_CPP_VARARG_MACRO_GCC], [dnl
|
AC_DEFUN([AX_CPP_VARARG_MACRO_GCC], [dnl
|
||||||
AS_VAR_PUSHDEF([VAR],[ax_cv_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_CACHE_CHECK(
|
||||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
|
[for GNU GCC vararg macro support],
|
||||||
#define macro(a, b...) func(a, b)
|
[VAR],
|
||||||
int func(int a, int b, int c);
|
[AC_COMPILE_IFELSE(
|
||||||
int test() { return macro(1, 2, 3); }
|
[AC_LANG_PROGRAM(
|
||||||
])], [ VAR=yes ], [VAR=no])])
|
,
|
||||||
if test $VAR = yes ; then
|
[[
|
||||||
AC_DEFINE([HAVE_CPP_VARARG_MACRO_GCC], 1,
|
#define macro(a, b...) func(a, b)
|
||||||
[Define to 1 if your compiler supports GNU GCC-style variadic macros])
|
int func(int a, int b, int c);
|
||||||
fi
|
int test() { return macro(1, 2, 3); }
|
||||||
|
]]
|
||||||
|
)],
|
||||||
|
[VAR=yes],
|
||||||
|
[VAR=no]
|
||||||
|
)]
|
||||||
|
)dnl
|
||||||
|
|
||||||
|
AS_VAR_IF(
|
||||||
|
[VAR],
|
||||||
|
[yes],
|
||||||
|
[AC_DEFINE(
|
||||||
|
[HAVE_CPP_VARARG_MACRO_GCC],
|
||||||
|
[1],
|
||||||
|
[Define to 1 if your compiler supports GNU GCC-style variadic macros]
|
||||||
|
)]
|
||||||
|
)dnl
|
||||||
AS_VAR_POPDEF([VAR])dnl
|
AS_VAR_POPDEF([VAR])dnl
|
||||||
])
|
])
|
||||||
|
|
||||||
@ -29,15 +45,31 @@ dnl @version
|
|||||||
dnl @author James Yonan <jim@yonan.net>, Matthias Andree <matthias.andree@web.de>
|
dnl @author James Yonan <jim@yonan.net>, Matthias Andree <matthias.andree@web.de>
|
||||||
AC_DEFUN([AX_CPP_VARARG_MACRO_ISO], [dnl
|
AC_DEFUN([AX_CPP_VARARG_MACRO_ISO], [dnl
|
||||||
AS_VAR_PUSHDEF([VAR],[ax_cv_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_CACHE_CHECK(
|
||||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
|
[for ISO C 1999 vararg macro support],
|
||||||
|
[VAR],
|
||||||
|
[AC_COMPILE_IFELSE(
|
||||||
|
[AC_LANG_PROGRAM(
|
||||||
|
,
|
||||||
|
[[
|
||||||
#define macro(a, ...) func(a, __VA_ARGS__)
|
#define macro(a, ...) func(a, __VA_ARGS__)
|
||||||
int func(int a, int b, int c);
|
int func(int a, int b, int c);
|
||||||
int test() { return macro(1, 2, 3); }
|
int test() { return macro(1, 2, 3); }
|
||||||
])], [ VAR=yes ], [VAR=no])])
|
]]
|
||||||
if test $VAR = yes ; then
|
)],
|
||||||
AC_DEFINE([HAVE_CPP_VARARG_MACRO_ISO], 1,
|
[VAR=yes],
|
||||||
[Define to 1 if your compiler supports ISO C99 variadic macros])
|
[VAR=no]
|
||||||
fi
|
)]
|
||||||
|
)dnl
|
||||||
|
|
||||||
|
AS_VAR_IF(
|
||||||
|
[VAR],
|
||||||
|
[yes],
|
||||||
|
[AC_DEFINE(
|
||||||
|
[HAVE_CPP_VARARG_MACRO_ISO],
|
||||||
|
[1],
|
||||||
|
[Define to 1 if your compiler supports ISO C99 variadic macros]
|
||||||
|
)]
|
||||||
|
)dnl
|
||||||
AS_VAR_POPDEF([VAR])dnl
|
AS_VAR_POPDEF([VAR])dnl
|
||||||
])
|
])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user