Date: Fri, 04 Jan 2008 11:18:36 -0700 (MST) From: "M. Warner Losh" <imp@bsdimp.com> To: gonzo@freebsd.org Cc: perforce@freebsd.org Subject: Re: PERFORCE change 132493 for review Message-ID: <20080104.111836.857606070.imp@bsdimp.com> In-Reply-To: <200801041637.m04GbdT4016593@repoman.freebsd.org> References: <200801041637.m04GbdT4016593@repoman.freebsd.org>
index | next in thread | previous in thread | raw e-mail
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 <gonzo@FreeBSD.ORG> 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_ */
:
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080104.111836.857606070.imp>
