From owner-p4-projects@FreeBSD.ORG Fri Nov 11 18:42:11 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9A02116A421; Fri, 11 Nov 2005 18:42:10 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 59FC116A41F for ; Fri, 11 Nov 2005 18:42:10 +0000 (GMT) (envelope-from millert@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 250F743D45 for ; Fri, 11 Nov 2005 18:42:10 +0000 (GMT) (envelope-from millert@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id jABIgAu1026590 for ; Fri, 11 Nov 2005 18:42:10 GMT (envelope-from millert@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id jABIg9gd026587 for perforce@freebsd.org; Fri, 11 Nov 2005 18:42:09 GMT (envelope-from millert@freebsd.org) Date: Fri, 11 Nov 2005 18:42:09 GMT Message-Id: <200511111842.jABIg9gd026587@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to millert@freebsd.org using -f From: Todd Miller To: Perforce Change Reviews Cc: Subject: PERFORCE change 86661 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2005 18:42:11 -0000 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 +#include /* NOTE: mach sys/types, not BSD one. */ +#include /* We need to explicitly include */ +#include /* 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)