in_addr_t and in_port_t changes
This commit is contained in:
parent
520aa2aeba
commit
b078069824
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: endian.h,v 1.1 1995/02/13 23:07:36 cgd Exp $ */
|
||||
/* $NetBSD: endian.h,v 1.2 1996/10/13 02:55:48 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1987, 1991, 1993
|
||||
|
@ -57,11 +57,14 @@
|
|||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
typedef u_int32_t in_addr_t;
|
||||
typeded u_int16_t in_port_t;
|
||||
|
||||
__BEGIN_DECLS
|
||||
unsigned long htonl __P((unsigned long));
|
||||
unsigned short htons __P((unsigned short));
|
||||
unsigned long ntohl __P((unsigned long));
|
||||
unsigned short ntohs __P((unsigned short));
|
||||
in_addr_t htonl __P((in_addr_t));
|
||||
in_port_t htons __P((in_port_t));
|
||||
in_addr_t ntohl __P((in_addr_t));
|
||||
in_port_t ntohs __P((in_port_t));
|
||||
__END_DECLS
|
||||
|
||||
/*
|
||||
|
@ -80,10 +83,10 @@ __END_DECLS
|
|||
|
||||
#else
|
||||
|
||||
#define NTOHL(x) (x) = ntohl((u_long)x)
|
||||
#define NTOHS(x) (x) = ntohs((u_short)x)
|
||||
#define HTONL(x) (x) = htonl((u_long)x)
|
||||
#define HTONS(x) (x) = htons((u_short)x)
|
||||
#define NTOHL(x) (x) = ntohl((in_addr_t)x)
|
||||
#define NTOHS(x) (x) = ntohs((in_port_t)x)
|
||||
#define HTONL(x) (x) = htonl((in_addr_t)x)
|
||||
#define HTONS(x) (x) = htons((in_port_t)x)
|
||||
#endif
|
||||
#endif /* !_POSIX_SOURCE */
|
||||
#endif /* !_ENDIAN_H_ */
|
||||
|
|
Loading…
Reference in New Issue