summaryrefslogtreecommitdiff
path: root/packages/nbd/files/cross-compile.patch
blob: 654a3d7a4874072ff0b6bd206c0367eff284b3a6 (plain)
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
55
56
57
58
59
60
61
Cross Compile fixes:
    The sanitized kernel headers use __u32 and __u64
    let us define those.


Index: nbd-2.8.4/configure.ac
===================================================================
--- nbd-2.8.4.orig/configure.ac	2006-02-26 15:52:03.000000000 +0100
+++ nbd-2.8.4/configure.ac	2006-05-25 21:35:26.000000000 +0200
@@ -68,7 +68,8 @@
               man8_MANS=nbd-client.8
 	      AC_MSG_RESULT(yes)
               ;;
-     *) AC_MSG_RESULT(no) ;;
+     dnl uname is a pretty stupid idea... we could be on freeBSD,OS X...
+     *) AC_MSG_RESULT(yes) ;;
 esac
 AC_MSG_CHECKING(where to find a working nbd.h)
 dnl We need to check for NBD_CMD_DISC, but that's part of an enum, it is not
@@ -82,8 +83,8 @@
 [int foo=NBD_CMD_DISC], 
   [AC_DEFINE(NBD_H_LOCAL, 1, Set to 1 if a (kernel 2.6) nbd.h can be found in the current directory)
     NBD_H='"nbd.h"'],
-  AC_TRY_COMPILE([#define u32 int
-#define u64 int
+  AC_TRY_COMPILE([#define __u32 int
+#define __u64 int
 #include <linux/nbd.h>
   ],
 [int foo=NBD_CMD_DISC],
Index: nbd-2.8.4/cliserv.h
===================================================================
--- nbd-2.8.4.orig/cliserv.h	2006-01-06 18:02:03.000000000 +0100
+++ nbd-2.8.4/cliserv.h	2006-05-25 21:41:25.000000000 +0200
@@ -17,20 +17,26 @@
 
 #if SIZEOF_UNSIGNED_SHORT_INT==4
 typedef unsigned short u32;
+typedef unsigned short __u32;
 #elif SIZEOF_UNSIGNED_INT==4
 typedef unsigned int u32;
+typedef unsigned int __u32;
 #elif SIZEOF_UNSIGNED_LONG_INT==4
 typedef unsigned long u32;
+typedef unsigned long __u32;
 #else
 #error I need at least some 32-bit type
 #endif
 
 #if SIZEOF_UNSIGNED_INT==8
 typedef unsigned int u64;
+typedef unsigned int __u64;
 #elif SIZEOF_UNSIGNED_LONG_INT==8
 typedef unsigned long u64;
+typedef unsigned long __u64;
 #elif SIZEOF_UNSIGNED_LONG_LONG_INT==8
 typedef unsigned long long u64;
+typedef unsigned long long __u64;
 #else
 #error I need at least some 64-bit type
 #endif