2000-03-16 18:09:34 +03:00
|
|
|
/* $NetBSD: endian.h,v 1.28 2000/03/16 15:09:36 mycroft Exp $ */
|
1998-08-15 08:57:50 +04:00
|
|
|
|
2000-03-16 18:09:34 +03:00
|
|
|
#ifndef _I386_ENDIAN_H_
|
|
|
|
#define _I386_ENDIAN_H_
|
1993-08-16 22:30:35 +04:00
|
|
|
|
1999-08-21 09:53:50 +04:00
|
|
|
#define _BYTE_ORDER _LITTLE_ENDIAN
|
|
|
|
#include <sys/endian.h>
|
1993-08-16 22:30:35 +04:00
|
|
|
|
1993-12-20 08:25:02 +03:00
|
|
|
#ifdef __GNUC__
|
1993-09-16 09:59:43 +04:00
|
|
|
|
1999-01-15 16:31:15 +03:00
|
|
|
#include <machine/byte_swap.h>
|
1995-06-01 21:19:18 +04:00
|
|
|
|
1997-07-17 22:44:08 +04:00
|
|
|
#define ntohl(x) ((in_addr_t)__byte_swap_long((in_addr_t)(x)))
|
|
|
|
#define ntohs(x) ((in_port_t)__byte_swap_word((in_port_t)(x)))
|
|
|
|
#define htonl(x) ((in_addr_t)__byte_swap_long((in_addr_t)(x)))
|
|
|
|
#define htons(x) ((in_port_t)__byte_swap_word((in_port_t)(x)))
|
1993-09-16 09:59:43 +04:00
|
|
|
|
2000-03-16 18:09:34 +03:00
|
|
|
#endif
|
1993-08-16 22:30:35 +04:00
|
|
|
|
2000-03-16 18:09:34 +03:00
|
|
|
#endif /* !_I386_ENDIAN_H_ */
|