1 1.27 simonb /* $NetBSD: endian.h,v 1.27 1999/08/21 05:53:50 simonb Exp $ */ 2 1.23 mycroft 3 1.27 simonb #ifndef _MACHINE_ENDIAN_H_ 4 1.27 simonb #define _MACHINE_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.4 jtc #endif /* __GNUC__ */ 19 1.1 cgd 20 1.27 simonb #endif /* !_MACHINE_ENDIAN_H_ */ 21