diff options
author | Mike Barcroft <mike@FreeBSD.org> | 2002-03-09 21:02:16 +0000 |
---|---|---|
committer | Mike Barcroft <mike@FreeBSD.org> | 2002-03-09 21:02:16 +0000 |
commit | d846855da8c8142a2f647f7a4c6949b341261297 (patch) | |
tree | 1d205aa43b36510bc014a26a35c058748d42812d /include/arpa | |
parent | 95651ec70e9de909fe21953e81fcd778e9bae3a2 (diff) |
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
Notes
Notes:
svn path=/head/; revision=91959
Diffstat (limited to 'include/arpa')
-rw-r--r-- | include/arpa/inet.h | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/include/arpa/inet.h b/include/arpa/inet.h index 3ac128d1ed9a..9c9554e5a625 100644 --- a/include/arpa/inet.h +++ b/include/arpa/inet.h @@ -115,23 +115,19 @@ struct in_addr { #define inet_nsap_ntoa __inet_nsap_ntoa #endif /* !_POSIX_SOURCE */ -#ifndef _BYTEORDER_FUNC_DEFINED -#define _BYTEORDER_FUNC_DEFINED -#define htonl(x) __htonl(x) -#define htons(x) __htons(x) -#define ntohl(x) __ntohl(x) -#define ntohs(x) __ntohs(x) +__BEGIN_DECLS +#ifndef _BYTEORDER_PROTOTYPED +#define _BYTEORDER_PROTOTYPED +__uint32_t htonl __P((__uint32_t)); +__uint16_t htons __P((__uint16_t)); +__uint32_t ntohl __P((__uint32_t)); +__uint16_t ntohs __P((__uint16_t)); #endif -__BEGIN_DECLS -__uint32_t htonl(__uint32_t); -__uint16_t htons(__uint16_t); in_addr_t inet_addr __P((const char *)); char *inet_ntoa __P((struct in_addr)); const char *inet_ntop __P((int, const void *, char *, socklen_t)); int inet_pton __P((int, const char *, void *)); -__uint32_t ntohl(__uint32_t); -__uint16_t ntohs(__uint16_t); /* Nonstandard functions. */ #ifndef _POSIX_SOURCE @@ -150,4 +146,12 @@ char *inet_nsap_ntoa __P((int, const unsigned char *, char *)); #endif /* !_POSIX_SOURCE */ __END_DECLS +#ifndef _BYTEORDER_FUNC_DEFINED +#define _BYTEORDER_FUNC_DEFINED +#define htonl(x) __htonl(x) +#define htons(x) __htons(x) +#define ntohl(x) __ntohl(x) +#define ntohs(x) __ntohs(x) +#endif + #endif /* !_ARPA_INET_H_ */ |