--- linux-2.6.20/include/linux/aio_abi.h.orig 2007-02-04 19:44:54.000000000 +0100 +++ linux-2.6.20/include/linux/aio_abi.h 2007-04-02 21:27:18.150605175 +0200 @@ -27,7 +27,11 @@ #ifndef __LINUX__AIO_ABI_H #define __LINUX__AIO_ABI_H +#ifdef __KERNEL__ #include +#else +#include +#endif typedef unsigned long aio_context_t; @@ -53,6 +57,7 @@ __s64 res2; /* secondary result */ }; +#ifdef __KERNEL__ #if defined(__LITTLE_ENDIAN) #define PADDED(x,y) x, y #elif defined(__BIG_ENDIAN) @@ -60,6 +65,15 @@ #else #error edit for your odd byteorder. #endif +#else /* __KERNEL__ */ +#if __BYTE_ORDER == __LITTLE_ENDIAN +#define PADDED(x,y) x, y +#elif __BYTE_ORDER == __BIG_ENDIAN +#define PADDED(x,y) y, x +#else +#error edit for your odd byteorder. +#endif +#endif /* __KERNEL__ */ /* * we always use a 64bit off_t when communicating --- linux-2.6.20/include/linux/raid/md_p.h.orig 2007-02-04 19:44:54.000000000 +0100 +++ linux-2.6.20/include/linux/raid/md_p.h 2007-04-02 21:32:46.657325707 +0200 @@ -15,6 +15,10 @@ #ifndef _MD_P_H #define _MD_P_H +#ifndef __KERNEL__ +#include +#endif + /* * RAID superblock. * @@ -146,7 +150,7 @@ __u32 failed_disks; /* 4 Number of failed disks */ __u32 spare_disks; /* 5 Number of spare disks */ __u32 sb_csum; /* 6 checksum of the whole superblock */ -#ifdef __BIG_ENDIAN +#if (defined(__KERNEL__) && defined(__BIG_ENDIAN)) || (!defined(__KERNEL__) && (__BYTE_ORDER == __BIG_ENDIAN)) __u32 events_hi; /* 7 high-order of superblock update count */ __u32 events_lo; /* 8 low-order of superblock update count */ __u32 cp_events_hi; /* 9 high-order of checkpoint update count */