1 1.28 mycroft /* $NetBSD: endian.h,v 1.28 2000/03/16 15:09:36 mycroft Exp $ */ 2 1.23 mycroft 3 1.28 mycroft #ifndef _I386_ENDIAN_H_ 4 1.28 mycroft #define _I386_ENDIAN_H_ 5 1.4 jtc 6 1.27 simonb #define _BYTE_ORDER _LITTLE_ENDIAN 7 1.27 simonb #include <sys/endian.h> 8 1.4 jtc 9 1.8 mycroft #ifdef __GNUC__ 10 1.6 mycroft 11 1.25 bouyer #include <machine/byte_swap.h> 12 1.4 jtc 13 1.20 thorpej #define ntohl(x) ((in_addr_t)__byte_swap_long((in_addr_t)(x))) 14 1.20 thorpej #define ntohs(x) ((in_port_t)__byte_swap_word((in_port_t)(x))) 15 1.20 thorpej #define htonl(x) ((in_addr_t)__byte_swap_long((in_addr_t)(x))) 16 1.20 thorpej #define htons(x) ((in_port_t)__byte_swap_word((in_port_t)(x))) 17 1.6 mycroft 18 1.28 mycroft #endif 19 1.1 cgd 20 1.28 mycroft #endif /* !_I386_ENDIAN_H_ */ 21