Date: Fri, 4 Jan 2008 16:37:39 GMT From: Oleksandr Tymoshenko <gonzo@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 132493 for review Message-ID: <200801041637.m04GbdT4016593@repoman.freebsd.org>
index | next in thread | raw e-mail
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?200801041637.m04GbdT4016593>
