Home | History | Annotate | Line # | Download | only in include
endian.h revision 1.27
      1 /*	$NetBSD: endian.h,v 1.27 1999/08/21 05:53:50 simonb Exp $	*/
      2 
      3 #ifndef _MACHINE_ENDIAN_H_
      4 #define	_MACHINE_ENDIAN_H_
      5 
      6 #define _BYTE_ORDER _LITTLE_ENDIAN
      7 #include <sys/endian.h>
      8 
      9 #ifdef __GNUC__
     10 
     11 #include <machine/byte_swap.h>
     12 
     13 #define	ntohl(x)	((in_addr_t)__byte_swap_long((in_addr_t)(x)))
     14 #define	ntohs(x)	((in_port_t)__byte_swap_word((in_port_t)(x)))
     15 #define	htonl(x)	((in_addr_t)__byte_swap_long((in_addr_t)(x)))
     16 #define	htons(x)	((in_port_t)__byte_swap_word((in_port_t)(x)))
     17 
     18 #endif	/* __GNUC__ */
     19 
     20 #endif /* !_MACHINE_ENDIAN_H_ */
     21