diff options
| author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-02-02 12:45:38 +0100 |
|---|---|---|
| committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-02-02 12:45:38 +0100 |
| commit | bb1dcc9aab5f517d963b601289aa75508d6e088e (patch) | |
| tree | 682957f7a02ac69cbe9c1adb5f22092bfd379de2 /include | |
| parent | 5b9b1365a086056e992e7868db8e49989fedcbaf (diff) | |
| download | busybox-w32-bb1dcc9aab5f517d963b601289aa75508d6e088e.tar.gz busybox-w32-bb1dcc9aab5f517d963b601289aa75508d6e088e.tar.bz2 busybox-w32-bb1dcc9aab5f517d963b601289aa75508d6e088e.zip | |
more thorough fix for systems with strange socklen_t
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/inet_common.h | 8 | ||||
| -rw-r--r-- | include/libbb.h | 40 | ||||
| -rw-r--r-- | include/platform.h | 12 | ||||
| -rw-r--r-- | include/unicode.h | 4 |
4 files changed, 34 insertions, 30 deletions
diff --git a/include/inet_common.h b/include/inet_common.h index f4374e5a2..4638aa9eb 100644 --- a/include/inet_common.h +++ b/include/inet_common.h | |||
| @@ -6,8 +6,10 @@ | |||
| 6 | * Heavily modified by Manuel Novoa III Mar 12, 2001 | 6 | * Heavily modified by Manuel Novoa III Mar 12, 2001 |
| 7 | * | 7 | * |
| 8 | */ | 8 | */ |
| 9 | #ifndef INET_COMMON_H | ||
| 10 | #define INET_COMMON_H 1 | ||
| 9 | 11 | ||
| 10 | #include "platform.h" | 12 | PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN |
| 11 | 13 | ||
| 12 | /* hostfirst!=0 If we expect this to be a hostname, | 14 | /* hostfirst!=0 If we expect this to be a hostname, |
| 13 | try hostname database first | 15 | try hostname database first |
| @@ -24,3 +26,7 @@ int INET6_resolve(const char *name, struct sockaddr_in6 *sin6) FAST_FUNC; | |||
| 24 | /* These return malloced string */ | 26 | /* These return malloced string */ |
| 25 | char *INET_rresolve(struct sockaddr_in *s_in, int numeric, uint32_t netmask) FAST_FUNC; | 27 | char *INET_rresolve(struct sockaddr_in *s_in, int numeric, uint32_t netmask) FAST_FUNC; |
| 26 | char *INET6_rresolve(struct sockaddr_in6 *sin6, int numeric) FAST_FUNC; | 28 | char *INET6_rresolve(struct sockaddr_in6 *sin6, int numeric) FAST_FUNC; |
| 29 | |||
| 30 | POP_SAVED_FUNCTION_VISIBILITY | ||
| 31 | |||
| 32 | #endif | ||
diff --git a/include/libbb.h b/include/libbb.h index 3b7eea286..9e3c18407 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
| @@ -30,10 +30,6 @@ | |||
| 30 | #include <sys/ioctl.h> | 30 | #include <sys/ioctl.h> |
| 31 | #include <sys/mman.h> | 31 | #include <sys/mman.h> |
| 32 | #include <sys/socket.h> | 32 | #include <sys/socket.h> |
| 33 | #if defined __FreeBSD__ | ||
| 34 | # include <netinet/in.h> | ||
| 35 | # include <arpa/inet.h> | ||
| 36 | #endif | ||
| 37 | #include <sys/stat.h> | 33 | #include <sys/stat.h> |
| 38 | #include <sys/time.h> | 34 | #include <sys/time.h> |
| 39 | #include <sys/types.h> | 35 | #include <sys/types.h> |
| @@ -44,39 +40,26 @@ | |||
| 44 | /* Try to pull in PATH_MAX */ | 40 | /* Try to pull in PATH_MAX */ |
| 45 | #include <limits.h> | 41 | #include <limits.h> |
| 46 | #include <sys/param.h> | 42 | #include <sys/param.h> |
| 47 | #ifndef PATH_MAX | ||
| 48 | # define PATH_MAX 256 | ||
| 49 | #endif | ||
| 50 | |||
| 51 | #ifndef BUFSIZ | ||
| 52 | # define BUFSIZ 4096 | ||
| 53 | #endif | ||
| 54 | |||
| 55 | #ifdef HAVE_MNTENT_H | 43 | #ifdef HAVE_MNTENT_H |
| 56 | #include <mntent.h> | 44 | #include <mntent.h> |
| 57 | #endif | 45 | #endif |
| 58 | |||
| 59 | #ifdef HAVE_SYS_STATFS_H | 46 | #ifdef HAVE_SYS_STATFS_H |
| 60 | #include <sys/statfs.h> | 47 | #include <sys/statfs.h> |
| 61 | #endif | 48 | #endif |
| 62 | |||
| 63 | #if ENABLE_SELINUX | 49 | #if ENABLE_SELINUX |
| 64 | #include <selinux/selinux.h> | 50 | #include <selinux/selinux.h> |
| 65 | #include <selinux/context.h> | 51 | #include <selinux/context.h> |
| 66 | #include <selinux/flask.h> | 52 | #include <selinux/flask.h> |
| 67 | #include <selinux/av_permissions.h> | 53 | #include <selinux/av_permissions.h> |
| 68 | #endif | 54 | #endif |
| 69 | |||
| 70 | #if ENABLE_LOCALE_SUPPORT | 55 | #if ENABLE_LOCALE_SUPPORT |
| 71 | # include <locale.h> | 56 | # include <locale.h> |
| 72 | #else | 57 | #else |
| 73 | # define setlocale(x,y) ((void)0) | 58 | # define setlocale(x,y) ((void)0) |
| 74 | #endif | 59 | #endif |
| 75 | |||
| 76 | #ifdef DMALLOC | 60 | #ifdef DMALLOC |
| 77 | # include <dmalloc.h> | 61 | # include <dmalloc.h> |
| 78 | #endif | 62 | #endif |
| 79 | |||
| 80 | #include <pwd.h> | 63 | #include <pwd.h> |
| 81 | #include <grp.h> | 64 | #include <grp.h> |
| 82 | #if ENABLE_FEATURE_SHADOWPASSWDS | 65 | #if ENABLE_FEATURE_SHADOWPASSWDS |
| @@ -87,6 +70,23 @@ | |||
| 87 | # include <shadow.h> | 70 | # include <shadow.h> |
| 88 | # endif | 71 | # endif |
| 89 | #endif | 72 | #endif |
| 73 | #if defined __FreeBSD__ | ||
| 74 | # include <netinet/in.h> | ||
| 75 | # include <arpa/inet.h> | ||
| 76 | #elif defined __APPLE__ | ||
| 77 | # include <netinet/in.h> | ||
| 78 | #else | ||
| 79 | # include <arpa/inet.h> | ||
| 80 | # if !defined(__socklen_t_defined) && !defined(_SOCKLEN_T_DECLARED) | ||
| 81 | /* We #define socklen_t *after* includes, otherwise we get | ||
| 82 | * typedef redefinition errors from system headers | ||
| 83 | * (in case "is it defined already" detection above failed) | ||
| 84 | */ | ||
| 85 | # define socklen_t bb_socklen_t | ||
| 86 | typedef unsigned socklen_t; | ||
| 87 | # endif | ||
| 88 | #endif | ||
| 89 | |||
| 90 | 90 | ||
| 91 | /* Some libc's forget to declare these, do it ourself */ | 91 | /* Some libc's forget to declare these, do it ourself */ |
| 92 | 92 | ||
| @@ -121,6 +121,12 @@ struct sysinfo { | |||
| 121 | char _f[20 - 2 * sizeof(long) - sizeof(int)]; /* Padding: libc5 uses this.. */ | 121 | char _f[20 - 2 * sizeof(long) - sizeof(int)]; /* Padding: libc5 uses this.. */ |
| 122 | }; | 122 | }; |
| 123 | int sysinfo(struct sysinfo* info); | 123 | int sysinfo(struct sysinfo* info); |
| 124 | #ifndef PATH_MAX | ||
| 125 | # define PATH_MAX 256 | ||
| 126 | #endif | ||
| 127 | #ifndef BUFSIZ | ||
| 128 | # define BUFSIZ 4096 | ||
| 129 | #endif | ||
| 124 | 130 | ||
| 125 | 131 | ||
| 126 | /* Make all declarations hidden (-fvisibility flag only affects definitions) */ | 132 | /* Make all declarations hidden (-fvisibility flag only affects definitions) */ |
diff --git a/include/platform.h b/include/platform.h index c34a46e79..b58b14936 100644 --- a/include/platform.h +++ b/include/platform.h | |||
| @@ -210,18 +210,6 @@ | |||
| 210 | } while (0) | 210 | } while (0) |
| 211 | #endif | 211 | #endif |
| 212 | 212 | ||
| 213 | /* ---- Networking ------------------------------------------ */ | ||
| 214 | |||
| 215 | #ifndef __APPLE__ | ||
| 216 | # include <arpa/inet.h> | ||
| 217 | # if !defined(__socklen_t_defined) && !defined(_SOCKLEN_T_DECLARED) | ||
| 218 | # define socklen_t bb_socklen_t | ||
| 219 | typedef int socklen_t; | ||
| 220 | # endif | ||
| 221 | #else | ||
| 222 | # include <netinet/in.h> | ||
| 223 | #endif | ||
| 224 | |||
| 225 | /* ---- Compiler dependent settings ------------------------- */ | 213 | /* ---- Compiler dependent settings ------------------------- */ |
| 226 | 214 | ||
| 227 | #if (defined __digital__ && defined __unix__) \ | 215 | #if (defined __digital__ && defined __unix__) \ |
diff --git a/include/unicode.h b/include/unicode.h index 25ef7407e..7ab044e17 100644 --- a/include/unicode.h +++ b/include/unicode.h | |||
| @@ -5,6 +5,8 @@ | |||
| 5 | #ifndef UNICODE_H | 5 | #ifndef UNICODE_H |
| 6 | #define UNICODE_H 1 | 6 | #define UNICODE_H 1 |
| 7 | 7 | ||
| 8 | PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN | ||
| 9 | |||
| 8 | enum { | 10 | enum { |
| 9 | UNICODE_UNKNOWN = 0, | 11 | UNICODE_UNKNOWN = 0, |
| 10 | UNICODE_OFF = 1, | 12 | UNICODE_OFF = 1, |
| @@ -79,4 +81,6 @@ int iswpunct(wint_t wc) FAST_FUNC; | |||
| 79 | 81 | ||
| 80 | #endif /* FEATURE_ASSUME_UNICODE */ | 82 | #endif /* FEATURE_ASSUME_UNICODE */ |
| 81 | 83 | ||
| 84 | POP_SAVED_FUNCTION_VISIBILITY | ||
| 85 | |||
| 82 | #endif | 86 | #endif |
