Date: Fri, 11 Nov 2005 18:42:09 GMT From: Todd Miller <millert@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 86661 for review Message-ID: <200511111842.jABIg9gd026587@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=86661 Change 86661 by millert@millert_ibook on 2005/11/11 18:41:54 Fix yesterday's change here by explicitly including endian and byte order includes again. They are implicitly included by the BSD sys/types but *not* by the mach sys/types. Affected files ... .. //depot/projects/trustedbsd/sedarwin7/src/sedarwin/sedarwin/linux-compat.h#10 edit Differences ... ==== //depot/projects/trustedbsd/sedarwin7/src/sedarwin/sedarwin/linux-compat.h#10 (text+ko) ==== @@ -43,7 +43,9 @@ * diffs to the SELinux tree will be quite a bit smaller. */ -#include <sys/types.h> +#include <sys/types.h> /* NOTE: mach sys/types, not BSD one. */ +#include <machine/endian.h> /* We need to explicitly include */ +#include <architecture/byte_order.h> /* byte order includes for mach. */ typedef u_int64_t u64; typedef u_int32_t u32; @@ -51,16 +53,20 @@ typedef u_int8_t u8; -#if BYTE_ORDER == LITTLE_ENDIAN +#if !defined(BYTE_ORDER) +#error BYTE_ORDER not defined +#elif BYTE_ORDER == LITTLE_ENDIAN #define cpu_to_le32(x) ((__uint32_t)(x)) #define cpu_to_le64(x) ((__uint64_t)(x)) #define le32_to_cpu(x) ((__uint32_t)(x)) #define le64_to_cpu(x) ((__uint64_t)(x)) -#else /* BYTE_ORDER != LITTLE_ENDIAN */ +#elif BYTE_ORDER == BIG_ENDIAN +#define cpu_to_le32(x) NXSwapHostLongToLittle(x) +#define cpu_to_le64(x) NXSwapHostLongLongToLittle(x) #define le32_to_cpu(x) NXSwapLittleLongToHost(x) #define le64_to_cpu(x) NXSwapLittleLongLongToHost(x) -#define cpu_to_le32(x) NXSwapHostLongToLittle(x) -#define cpu_to_le64(x) NXSwapHostLongLongToLittle(x) +#else +#error unsupported BYTE_ORDER #endif /* BYTE_ORDER */ #if !defined(_KERNEL) && !defined(KERNEL)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200511111842.jABIg9gd026587>