diff options
author | Dan Fandrich <dan@coneharvesters.com> | 2010-06-18 22:37:42 -0700 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-06-19 20:03:15 +0200 |
commit | fdd7b566ecdc174907f38d9389b28ba842d2b4bf (patch) | |
tree | 38e5f9a61da8c6ed5155d3542fd0d56aaf157714 | |
parent | eb08b6ed5cc7bb764658cd7a3b829e2b3aac4abc (diff) | |
download | busybox-w32-fdd7b566ecdc174907f38d9389b28ba842d2b4bf.tar.gz busybox-w32-fdd7b566ecdc174907f38d9389b28ba842d2b4bf.tar.bz2 busybox-w32-fdd7b566ecdc174907f38d9389b28ba842d2b4bf.zip |
A few minor portability improvements
Signed-off-by: Dan Fandrich <dan@coneharvesters.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | archival/libunarchive/unxz/xz_config.h | 2 | ||||
-rw-r--r-- | include/platform.h | 4 | ||||
-rw-r--r-- | libbb/xconnect.c | 1 | ||||
-rw-r--r-- | networking/ipcalc.c | 4 | ||||
-rw-r--r-- | shell/hush.c | 2 |
5 files changed, 8 insertions, 5 deletions
diff --git a/archival/libunarchive/unxz/xz_config.h b/archival/libunarchive/unxz/xz_config.h index ff90eff26..a4141e136 100644 --- a/archival/libunarchive/unxz/xz_config.h +++ b/archival/libunarchive/unxz/xz_config.h | |||
@@ -32,7 +32,9 @@ | |||
32 | #define memeq(a, b, size) (memcmp(a, b, size) == 0) | 32 | #define memeq(a, b, size) (memcmp(a, b, size) == 0) |
33 | #define memzero(buf, size) memset(buf, 0, size) | 33 | #define memzero(buf, size) memset(buf, 0, size) |
34 | 34 | ||
35 | #ifndef min | ||
35 | #define min(x, y) ((x) < (y) ? (x) : (y)) | 36 | #define min(x, y) ((x) < (y) ? (x) : (y)) |
37 | #endif | ||
36 | #define min_t(type, x, y) min(x, y) | 38 | #define min_t(type, x, y) min(x, y) |
37 | 39 | ||
38 | /* | 40 | /* |
diff --git a/include/platform.h b/include/platform.h index f87add552..4bd7a3d2e 100644 --- a/include/platform.h +++ b/include/platform.h | |||
@@ -168,10 +168,10 @@ | |||
168 | #if defined(__BIG_ENDIAN__) && __BIG_ENDIAN__ | 168 | #if defined(__BIG_ENDIAN__) && __BIG_ENDIAN__ |
169 | # define BB_BIG_ENDIAN 1 | 169 | # define BB_BIG_ENDIAN 1 |
170 | # define BB_LITTLE_ENDIAN 0 | 170 | # define BB_LITTLE_ENDIAN 0 |
171 | #elif __BYTE_ORDER == __BIG_ENDIAN | 171 | #elif defined(__BYTE_ORDER) && __BYTE_ORDER == __BIG_ENDIAN |
172 | # define BB_BIG_ENDIAN 1 | 172 | # define BB_BIG_ENDIAN 1 |
173 | # define BB_LITTLE_ENDIAN 0 | 173 | # define BB_LITTLE_ENDIAN 0 |
174 | #elif __BYTE_ORDER == __LITTLE_ENDIAN | 174 | #elif (defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN) || defined(__386__) |
175 | # define BB_BIG_ENDIAN 0 | 175 | # define BB_BIG_ENDIAN 0 |
176 | # define BB_LITTLE_ENDIAN 1 | 176 | # define BB_LITTLE_ENDIAN 1 |
177 | #else | 177 | #else |
diff --git a/libbb/xconnect.c b/libbb/xconnect.c index c3ee633e4..2de6de7c5 100644 --- a/libbb/xconnect.c +++ b/libbb/xconnect.c | |||
@@ -7,6 +7,7 @@ | |||
7 | * Licensed under GPLv2, see file LICENSE in this tarball for details. | 7 | * Licensed under GPLv2, see file LICENSE in this tarball for details. |
8 | */ | 8 | */ |
9 | 9 | ||
10 | #include <sys/types.h> | ||
10 | #include <sys/socket.h> /* netinet/in.h needs it */ | 11 | #include <sys/socket.h> /* netinet/in.h needs it */ |
11 | #include <netinet/in.h> | 12 | #include <netinet/in.h> |
12 | #include <net/if.h> | 13 | #include <net/if.h> |
diff --git a/networking/ipcalc.c b/networking/ipcalc.c index 17b216354..87f31fdb5 100644 --- a/networking/ipcalc.c +++ b/networking/ipcalc.c | |||
@@ -12,11 +12,11 @@ | |||
12 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. | 12 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. |
13 | */ | 13 | */ |
14 | 14 | ||
15 | #include "libbb.h" | ||
16 | |||
15 | #include <sys/socket.h> | 17 | #include <sys/socket.h> |
16 | #include <arpa/inet.h> | 18 | #include <arpa/inet.h> |
17 | 19 | ||
18 | #include "libbb.h" | ||
19 | |||
20 | #define CLASS_A_NETMASK ntohl(0xFF000000) | 20 | #define CLASS_A_NETMASK ntohl(0xFF000000) |
21 | #define CLASS_B_NETMASK ntohl(0xFFFF0000) | 21 | #define CLASS_B_NETMASK ntohl(0xFFFF0000) |
22 | #define CLASS_C_NETMASK ntohl(0xFFFFFF00) | 22 | #define CLASS_C_NETMASK ntohl(0xFFFFFF00) |
diff --git a/shell/hush.c b/shell/hush.c index 4832e2c48..e64c923b4 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
@@ -1217,7 +1217,7 @@ static void hush_exit(int exitcode) | |||
1217 | 1217 | ||
1218 | static int check_and_run_traps(int sig) | 1218 | static int check_and_run_traps(int sig) |
1219 | { | 1219 | { |
1220 | static const struct timespec zero_timespec = { 0, 0 }; | 1220 | static const struct timespec zero_timespec; |
1221 | smalluint save_rcode; | 1221 | smalluint save_rcode; |
1222 | int last_sig = 0; | 1222 | int last_sig = 0; |
1223 | 1223 | ||