Home | History | Annotate | Line # | Download | only in include
endian_machdep.h revision 1.3
      1 /*	$NetBSD: endian_machdep.h,v 1.3 2005/12/11 12:16:25 christos Exp $	*/
      2 
      3 #define _BYTE_ORDER _LITTLE_ENDIAN
      4 
      5 #ifdef __GNUC__
      6 
      7 #include <machine/byte_swap.h>
      8 
      9 #define	ntohl(x)	((uint32_t)__byte_swap_long((uint32_t)(x)))
     10 #define	ntohs(x)	((uint16_t)__byte_swap_word((uint16_t)(x)))
     11 #define	htonl(x)	((uint32_t)__byte_swap_long((uint32_t)(x)))
     12 #define	htons(x)	((uint16_t)__byte_swap_word((uint16_t)(x)))
     13 
     14 #endif
     15