diff options
author | mike <mike@FreeBSD.org> | 2002-04-10 10:51:53 +0000 |
---|---|---|
committer | mike <mike@FreeBSD.org> | 2002-04-10 10:51:53 +0000 |
commit | 04f18ad12cd35050f55d9c510670c77e6352646d (patch) | |
tree | c6dbd5ed111369f0ac8e4c77115188e3f75a9b60 /include | |
parent | c6c6023da15f1b201e6592f54325f89bbd96a75b (diff) | |
download | FreeBSD-src-04f18ad12cd35050f55d9c510670c77e6352646d.zip FreeBSD-src-04f18ad12cd35050f55d9c510670c77e6352646d.tar.gz |
Be more strict about exposing BSD-specific functions when a standard
has been requested.
Unconditionalize the definition of INET_ADDRSTRLEN and
INET6_ADDRSTRLEN. Doing this helps expose bogus redefinitions in 3rd
party software.
Diffstat (limited to 'include')
-rw-r--r-- | include/arpa/inet.h | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/include/arpa/inet.h b/include/arpa/inet.h index 1a69363..d16fd1f 100644 --- a/include/arpa/inet.h +++ b/include/arpa/inet.h @@ -64,13 +64,8 @@ /* Required for byteorder(3) functions. */ #include <machine/endian.h> -#ifndef INET_ADDRSTRLEN #define INET_ADDRSTRLEN 16 -#endif - -#ifndef INET6_ADDRSTRLEN #define INET6_ADDRSTRLEN 46 -#endif #ifndef _UINT16_T_DECLARED typedef __uint16_t uint16_t; @@ -116,7 +111,7 @@ struct in_addr { #endif /* XXX all new diversions!! argh!! */ -#ifndef _POSIX_SOURCE +#if __BSD_VISIBLE #define inet_addr __inet_addr #define inet_aton __inet_aton #define inet_lnaof __inet_lnaof @@ -131,7 +126,7 @@ struct in_addr { #define inet_ntop __inet_ntop #define inet_nsap_addr __inet_nsap_addr #define inet_nsap_ntoa __inet_nsap_ntoa -#endif /* !_POSIX_SOURCE */ +#endif /* __BSD_VISIBLE */ __BEGIN_DECLS #ifndef _BYTEORDER_PROTOTYPED @@ -147,8 +142,7 @@ char *inet_ntoa(struct in_addr); const char *inet_ntop(int, const void *, char *, socklen_t); int inet_pton(int, const char *, void *); -/* Nonstandard functions. */ -#ifndef _POSIX_SOURCE +#if __BSD_VISIBLE int ascii2addr(int, const char *, void *); char *addr2ascii(int, const void *, int, char *); int inet_aton(const char *, struct in_addr *); @@ -161,7 +155,7 @@ char *inet_net_ntop(int, const void *, int, char *, size_t); int inet_net_pton(int, const char *, void *, size_t); unsigned inet_nsap_addr(const char *, unsigned char *, int); char *inet_nsap_ntoa(int, const unsigned char *, char *); -#endif /* !_POSIX_SOURCE */ +#endif /* __BSD_VISIBLE */ __END_DECLS #ifndef _BYTEORDER_FUNC_DEFINED |