File: cross.patch

package info (click to toggle)
apparix 11-062-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,336 kB
  • sloc: ansic: 10,376; sh: 782; makefile: 48
file content (54 lines) | stat: -rw-r--r-- 1,262 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
From: Nilesh Patra <nilesh@iki.fi>
Subject: Allow cross build
Bug-Debian: https://bugs.debian.org/1110332

--- a/acinclude.m4
+++ b/acinclude.m4
@@ -234,34 +234,9 @@
 dnl #   test program for va_copy() implementation
 changequote(<<,>>)
 m4_define(__va_copy_test, <<[
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
 #define DO_VA_COPY(d, s) $1
-void test(char *str, ...)
-{
-    va_list ap, ap2;
-    int i;
-    va_start(ap, str);
-    DO_VA_COPY(ap2, ap);
-    for (i = 1; i <= 9; i++) {
-        int k = (int)va_arg(ap, int);
-        if (k != i)
-            abort();
-    }
-    DO_VA_COPY(ap, ap2);
-    for (i = 1; i <= 9; i++) {
-        int k = (int)va_arg(ap, int);
-        if (k != i)
-            abort();
-    }
-    va_end(ap);
-}
-int main(int argc, char *argv[])
-{
-    test("test", 1, 2, 3, 4, 5, 6, 7, 8, 9);
-    exit(0);
-}
+va_list ap, ap2;
+DO_VA_COPY(ap2, ap);
 ]>>)
 changequote([,])
 
@@ -271,7 +246,9 @@
 [/* Predefined possible va_copy() implementation (id: $1) */
 #define __VA_COPY_USE_$1(d, s) $2])
     if test ".$ac_cv_va_copy" = .; then
-        AC_TRY_RUN(__va_copy_test($2), [ac_cv_va_copy="$1"])
+        AC_TRY_COMPILE([
+			#include <stdarg.h>
+			],__va_copy_test($2), [ac_cv_va_copy="$1"])
     fi
 ])