From owner-p4-projects@FreeBSD.ORG Tue May 27 03:34:15 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id F00CB106566C; Tue, 27 May 2008 03:34:14 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5417106567B for ; Tue, 27 May 2008 03:34:14 +0000 (UTC) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 911FD8FC27 for ; Tue, 27 May 2008 03:34:14 +0000 (UTC) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m4R3YEAK029586 for ; Tue, 27 May 2008 03:34:14 GMT (envelope-from jb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m4R3YE4j029584 for perforce@freebsd.org; Tue, 27 May 2008 03:34:14 GMT (envelope-from jb@freebsd.org) Date: Tue, 27 May 2008 03:34:14 GMT Message-Id: <200805270334.m4R3YE4j029584@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jb@freebsd.org using -f From: John Birrell To: Perforce Change Reviews Cc: Subject: PERFORCE change 142348 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: Tue, 27 May 2008 03:34:15 -0000 http://perforce.freebsd.org/chv.cgi?CH=142348 Change 142348 by jb@freebsd3 on 2008/05/27 03:33:43 Do byte order tests the FreeBSD way. Affected files ... .. //depot/projects/dtrace7/src/sys/cddl/contrib/opensolaris/uts/common/rpc/xdr.c#3 edit Differences ... ==== //depot/projects/dtrace7/src/sys/cddl/contrib/opensolaris/uts/common/rpc/xdr.c#3 (text+ko) ==== @@ -54,11 +54,13 @@ #pragma weak xdr_int64_t = xdr_longlong_t #pragma weak xdr_uint64_t = xdr_u_longlong_t +#if defined(sun) #if !defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN) #error "Exactly one of _BIG_ENDIAN or _LITTLE_ENDIAN must be defined" #elif defined(_BIG_ENDIAN) && defined(_LITTLE_ENDIAN) #error "Only one of _BIG_ENDIAN or _LITTLE_ENDIAN may be defined" #endif +#endif /* * constants specific to the xdr "protocol" @@ -174,12 +176,12 @@ xdr_longlong_t(XDR *xdrs, longlong_t *hp) { if (xdrs->x_op == XDR_ENCODE) { -#if defined(_LITTLE_ENDIAN) +#if BYTE_ORDER == _LITTLE_ENDIAN if (XDR_PUTINT32(xdrs, (int32_t *)((char *)hp + BYTES_PER_XDR_UNIT)) == TRUE) { return (XDR_PUTINT32(xdrs, (int32_t *)hp)); } -#elif defined(_BIG_ENDIAN) +#else if (XDR_PUTINT32(xdrs, (int32_t *)hp) == TRUE) { return (XDR_PUTINT32(xdrs, (int32_t *)((char *)hp + BYTES_PER_XDR_UNIT))); @@ -189,12 +191,12 @@ } if (xdrs->x_op == XDR_DECODE) { -#if defined(_LITTLE_ENDIAN) +#if BYTE_ORDER == _LITTLE_ENDIAN if (XDR_GETINT32(xdrs, (int32_t *)((char *)hp + BYTES_PER_XDR_UNIT)) == TRUE) { return (XDR_GETINT32(xdrs, (int32_t *)hp)); } -#elif defined(_BIG_ENDIAN) +#else if (XDR_GETINT32(xdrs, (int32_t *)hp) == TRUE) { return (XDR_GETINT32(xdrs, (int32_t *)((char *)hp + BYTES_PER_XDR_UNIT))); @@ -213,12 +215,12 @@ { if (xdrs->x_op == XDR_ENCODE) { -#if defined(_LITTLE_ENDIAN) +#if BYTE_ORDER == _LITTLE_ENDIAN if (XDR_PUTINT32(xdrs, (int32_t *)((char *)hp + BYTES_PER_XDR_UNIT)) == TRUE) { return (XDR_PUTINT32(xdrs, (int32_t *)hp)); } -#elif defined(_BIG_ENDIAN) +#else if (XDR_PUTINT32(xdrs, (int32_t *)hp) == TRUE) { return (XDR_PUTINT32(xdrs, (int32_t *)((char *)hp + BYTES_PER_XDR_UNIT))); @@ -228,12 +230,12 @@ } if (xdrs->x_op == XDR_DECODE) { -#if defined(_LITTLE_ENDIAN) +#if BYTE_ORDER == _LITTLE_ENDIAN if (XDR_GETINT32(xdrs, (int32_t *)((char *)hp + BYTES_PER_XDR_UNIT)) == TRUE) { return (XDR_GETINT32(xdrs, (int32_t *)hp)); } -#elif defined(_BIG_ENDIAN) +#else if (XDR_GETINT32(xdrs, (int32_t *)hp) == TRUE) { return (XDR_GETINT32(xdrs, (int32_t *)((char *)hp + BYTES_PER_XDR_UNIT)));