summaryrefslogtreecommitdiffstats
path: root/sys/netinet/in.h
diff options
context:
space:
mode:
authormike <mike@FreeBSD.org>2002-03-09 21:02:16 +0000
committermike <mike@FreeBSD.org>2002-03-09 21:02:16 +0000
commitb8cc0d1207ca0471e0fc9e82c60e6e0c76b9dd98 (patch)
tree1d205aa43b36510bc014a26a35c058748d42812d /sys/netinet/in.h
parentd2f6ffc283d7b4755bbd498ac25b9dee0663b09e (diff)
downloadFreeBSD-src-b8cc0d1207ca0471e0fc9e82c60e6e0c76b9dd98.zip
FreeBSD-src-b8cc0d1207ca0471e0fc9e82c60e6e0c76b9dd98.tar.gz
o Don't require long long support in bswap64() functions.
o In i386's <machine/endian.h>, macros have some advantages over inlines, so change some inlines to macros. o In i386's <machine/endian.h>, ungarbage collect word_swap_int() (previously __uint16_swap_uint32), it has some uses on i386's with PDP endianness. Submitted by: bde o Move a comment up in <machine/endian.h> that was accidentially moved down a few revisions ago. o Reenable userland's use of optimized inline-asm versions of byteorder(3) functions. o Fix ordering of prototypes vs. redefinition of byteorder(3) functions, so that the non-GCC (libc asm) case has proper prototypes. o Add proper prototypes for byteorder(3) functions in <sys/param.h>. o Prevent redundant duplicate prototypes by making use of the _BYTEORDER_PROTOTYPED define. o Move the bswap16(), bswap32(), bswap64() C functions into MD space for platforms in which asm versions don't exist. This significantly reduces the complexity of some things at the cost of duplicate code. Reviewed by: bde
Diffstat (limited to 'sys/netinet/in.h')
-rw-r--r--sys/netinet/in.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/sys/netinet/in.h b/sys/netinet/in.h
index cfd55ca..819a827 100644
--- a/sys/netinet/in.h
+++ b/sys/netinet/in.h
@@ -498,6 +498,16 @@ char *inet_ntoa_r __P((struct in_addr ina, char *buf)); /* in libkern */
#else /* !_KERNEL */
+#ifndef _BYTEORDER_PROTOTYPED
+#define _BYTEORDER_PROTOTYPED
+__BEGIN_DECLS
+__uint32_t htonl __P((__uint32_t));
+__uint16_t htons __P((__uint16_t));
+__uint32_t ntohl __P((__uint32_t));
+__uint16_t ntohs __P((__uint16_t));
+__END_DECLS
+#endif
+
#ifndef _BYTEORDER_FUNC_DEFINED
#define _BYTEORDER_FUNC_DEFINED
#define htonl(x) __htonl(x)
@@ -506,13 +516,6 @@ char *inet_ntoa_r __P((struct in_addr ina, char *buf)); /* in libkern */
#define ntohs(x) __ntohs(x)
#endif
-__BEGIN_DECLS
-__uint32_t htonl __P((__uint32_t));
-__uint16_t htons __P((__uint16_t));
-__uint32_t ntohl __P((__uint32_t));
-__uint16_t ntohs __P((__uint16_t));
-__END_DECLS
-
#endif /* _KERNEL */
#endif
OpenPOWER on IntegriCloud