summaryrefslogtreecommitdiffstats
path: root/sys/arch/powerpc/include/endian.h
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>1997-04-04 03:05:28 +0000
committermillert <millert@openbsd.org>1997-04-04 03:05:28 +0000
commit985cfbd4cfbc38fcdd6d41095ba2f662f4b48b54 (patch)
treec886533064006f153a83fccfaf617cdae92bf4fb /sys/arch/powerpc/include/endian.h
parentwe are a 4.4bsd-style system; correct pathnames (diff)
downloadwireguard-openbsd-985cfbd4cfbc38fcdd6d41095ba2f662f4b48b54.tar.xz
wireguard-openbsd-985cfbd4cfbc38fcdd6d41095ba2f662f4b48b54.zip
Define in_addr_t and in_port_t everywhere but use u_intXX_t for
htonl and friends.
Diffstat (limited to 'sys/arch/powerpc/include/endian.h')
-rw-r--r--sys/arch/powerpc/include/endian.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/sys/arch/powerpc/include/endian.h b/sys/arch/powerpc/include/endian.h
index f5db7ea9216..15cb3226815 100644
--- a/sys/arch/powerpc/include/endian.h
+++ b/sys/arch/powerpc/include/endian.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: endian.h,v 1.3 1996/12/28 06:25:05 rahnds Exp $ */
+/* $OpenBSD: endian.h,v 1.4 1997/04/04 03:05:34 millert Exp $ */
/* $NetBSD: endian.h,v 1.2 1996/10/13 03:16:41 christos Exp $ */
/*-
@@ -52,6 +52,9 @@
#include <sys/cdefs.h>
+typedef u_int32_t in_addr_t;
+typedef u_int16_t in_port_t;
+
__BEGIN_DECLS
u_int32_t htonl __P((u_int32_t));
u_int16_t htons __P((u_int16_t));
@@ -75,10 +78,10 @@ __END_DECLS
#else
-#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)
+#define NTOHL(x) (x) = ntohl((u_int32_t)x)
+#define NTOHS(x) (x) = ntohs((u_int16_t)x)
+#define HTONL(x) (x) = htonl((u_int32_t)x)
+#define HTONS(x) (x) = htons((u_int16_t)x)
#endif
#endif /* _POSIX_SOURCE */