NetBSD/sys/arch/i386/include/endian_machdep.h
kleink c004d32eb8 Reflect <sys/endian.h> rev. 1.4: make htonl() et al. arguments and
results uint{16,32}_t.  Noted by Ian Zagorskih.
2004-06-10 16:01:39 +00:00

15 lines
409 B
C

/* $NetBSD: endian_machdep.h,v 1.2 2004/06/10 16:01:39 kleink Exp $ */
#define _BYTE_ORDER _LITTLE_ENDIAN
#ifdef __GNUC__
#include <machine/byte_swap.h>
#define ntohl(x) ((uint32_t)__byte_swap_long((uint32_t)(x)))
#define ntohs(x) ((uint16_t)__byte_swap_word((uint16_t)(x)))
#define htonl(x) ((uint32_t)__byte_swap_long((uint32_t)(x)))
#define htons(x) ((uint16_t)__byte_swap_word((uint16_t)(x)))
#endif