ruby_check_va_copy.m4: for cross compiling
* tool/m4/ruby_check_va_copy.m4 (RUBY_CHECK_VA_COPY): use AC_TRY_LINK instead of AC_TRY_RUN for cross compiling. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62432 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
62916542b2
commit
2b1ba32514
@ -1,11 +1,11 @@
|
|||||||
# -*- Autoconf -*-
|
# -*- Autoconf -*-
|
||||||
AC_DEFUN([RUBY_CHECK_VA_COPY], [
|
AC_DEFUN([RUBY_CHECK_VA_COPY], [
|
||||||
if test "x$rb_cv_va_copy" = x; then
|
AS_IF([test "x$rb_cv_va_copy" = x], [dnl
|
||||||
AC_TRY_RUN(
|
AC_TRY_LINK(
|
||||||
[#include <stdlib.h>
|
[@%:@include <stdlib.h>
|
||||||
#include <stdarg.h>
|
@%:@include <stdarg.h>
|
||||||
#include <string.h>
|
@%:@include <string.h>
|
||||||
#define CONFTEST_VA_COPY(dst, src) $2
|
@%:@define CONFTEST_VA_COPY(dst, src) $2
|
||||||
void
|
void
|
||||||
conftest(int n, ...)
|
conftest(int n, ...)
|
||||||
{
|
{
|
||||||
@ -19,16 +19,12 @@ conftest(int n, ...)
|
|||||||
for (i = 0; i < n; i++) if ((int)va_arg(ap, int) != n - i - 1) abort();
|
for (i = 0; i < n; i++) if ((int)va_arg(ap, int) != n - i - 1) abort();
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
va_end(ap2);
|
va_end(ap2);
|
||||||
}
|
|
||||||
int
|
|
||||||
main()
|
|
||||||
{
|
|
||||||
conftest(10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
|
|
||||||
exit(0);
|
|
||||||
}],
|
}],
|
||||||
rb_cv_va_copy="$1",
|
[
|
||||||
rb_cv_va_copy="",
|
conftest(10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
|
||||||
rb_cv_va_copy="")dnl
|
],
|
||||||
fi
|
[rb_cv_va_copy="$1"],
|
||||||
|
[rb_cv_va_copy=""])dnl
|
||||||
|
])dnl
|
||||||
])dnl
|
])dnl
|
||||||
dnl
|
dnl
|
||||||
|
Loading…
x
Reference in New Issue
Block a user