1999-08-21 09:53:50 +04:00
|
|
|
/* $NetBSD: endian.h,v 1.15 1999/08/21 05:53:51 simonb Exp $ */
|
1994-10-26 11:23:50 +03:00
|
|
|
|
1999-08-21 09:53:50 +04:00
|
|
|
#ifndef _MACHINE_ENDIAN_H_
|
|
|
|
#define _MACHINE_ENDIAN_H_
|
1993-09-10 03:53:45 +04:00
|
|
|
|
1999-08-21 09:53:50 +04:00
|
|
|
#define _BYTE_ORDER _LITTLE_ENDIAN
|
|
|
|
#include <sys/endian.h>
|
1993-09-10 03:53:45 +04:00
|
|
|
|
1994-05-03 11:29:37 +04:00
|
|
|
#ifdef __GNUC__
|
|
|
|
|
1999-01-15 16:31:15 +03:00
|
|
|
#include <machine/byte_swap.h>
|
1995-06-18 11:13:46 +04:00
|
|
|
|
1994-05-03 11:29:37 +04:00
|
|
|
#define ntohl(x) __byte_swap_long(x)
|
|
|
|
#define ntohs(x) __byte_swap_word(x)
|
|
|
|
#define htonl(x) __byte_swap_long(x)
|
|
|
|
#define htons(x) __byte_swap_word(x)
|
1993-09-10 03:53:45 +04:00
|
|
|
|
1994-05-03 11:29:37 +04:00
|
|
|
#endif /* __GNUC__ */
|
|
|
|
|
1999-08-21 09:53:50 +04:00
|
|
|
#endif /* _MACHINE_ENDIAN_H_ */
|