From owner-p4-projects@FreeBSD.ORG Fri Jan 4 18:21:24 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 5711B16A4AB; Fri, 4 Jan 2008 18:21:24 +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 1A5FA16A46B; Fri, 4 Jan 2008 18:21:22 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 53AA713C467; Fri, 4 Jan 2008 18:21:22 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.1/8.14.1) with ESMTP id m04II772024899; Fri, 4 Jan 2008 11:18:07 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Fri, 04 Jan 2008 11:18:36 -0700 (MST) Message-Id: <20080104.111836.857606070.imp@bsdimp.com> To: gonzo@freebsd.org From: "M. Warner Losh" In-Reply-To: <200801041637.m04GbdT4016593@repoman.freebsd.org> References: <200801041637.m04GbdT4016593@repoman.freebsd.org> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: perforce@freebsd.org Subject: Re: PERFORCE change 132493 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, 04 Jan 2008 18:21:24 -0000 I think that the NTOHL, et al, macros came from 4.2BSD and we need to keep them. Warner In message: <200801041637.m04GbdT4016593@repoman.freebsd.org> Oleksandr Tymoshenko writes: : http://perforce.freebsd.org/chv.cgi?CH=132493 : : Change 132493 by gonzo@gonzo_jeeves on 2008/01/04 16:37:32 : : o Rempove NTOHL/NTOHS/etc... macroses, they came from NetBSD land : o Add definition for __ntohl/__ntohs/etc... macroses for LE build : o Some cosmetics : : Affected files ... : : .. //depot/projects/mips2-jnpr/src/sys/mips/include/endian.h#5 edit : : Differences ... : : ==== //depot/projects/mips2-jnpr/src/sys/mips/include/endian.h#5 (text+ko) ==== : : @@ -111,33 +111,21 @@ : /* : * Define the order of 32-bit words in 64-bit words. : */ : -#if _BYTE_ORDER == LITTLE_ENDIAN : -#define _QUAD_HIGHWORD 1 : -#define _QUAD_LOWWORD 0 : -#endif : - : #if _BYTE_ORDER == BIG_ENDIAN : #define _QUAD_HIGHWORD 0 : #define _QUAD_LOWWORD 1 : -#endif : - : -#if _BYTE_ORDER == BIG_ENDIAN : #define __htonl(x) ((__uint32_t)(x)) : #define __htons(x) ((__uint16_t)(x)) : #define __ntohl(x) ((__uint32_t)(x)) : #define __ntohs(x) ((__uint16_t)(x)) : -#endif : - : - : -/* : - * Macros for network/external number representation conversion. : - */ : - : -#define NTOHL(x) (x) = __ntohl((x)) : -#define NTOHS(x) (x) = __ntohs((x)) : -#define HTONQ(x) (x) = __htonq((x)) : -#define HTONL(x) (x) = __htonl((x)) : -#define HTONS(x) (x) = __htons((x)) : +#else : +#define _QUAD_HIGHWORD 1 : +#define _QUAD_LOWWORD 0 : +#define __ntohl(x) (__bswap32(x)) : +#define __ntohs(x) (__bswap16(x)) : +#define __htonl(x) (__bswap32(x)) : +#define __htons(x) (__bswap16(x)) : +#endif /* _BYTE_ORDER == BIG_ENDIAN */ : : #endif /* !_POSIX_SOURCE */ : #endif /* !_MACHINE_ENDIAN_H_ */ :