diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2010-09-14 13:51:53 +1000 |
---|---|---|
committer | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2010-09-14 13:51:53 +1000 |
commit | e8db4fe96b3a68b6f971d88084ef2fd2c8513e78 (patch) | |
tree | 4770fe2f056587951a88f614421f50c1a9c9ead1 | |
parent | 53899dc573f4203d5d2a030b4404f7b30f92d202 (diff) | |
parent | 867ffb961672a226ba269b32c5d88a2c56b685fe (diff) | |
download | busybox-w32-e8db4fe96b3a68b6f971d88084ef2fd2c8513e78.tar.gz busybox-w32-e8db4fe96b3a68b6f971d88084ef2fd2c8513e78.tar.bz2 busybox-w32-e8db4fe96b3a68b6f971d88084ef2fd2c8513e78.zip |
Merge branch 'origin/master' (early part)
Conflicts:
include/platform.h
-rw-r--r-- | include/platform.h | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/include/platform.h b/include/platform.h index 2f3639d9c..7f2216a55 100644 --- a/include/platform.h +++ b/include/platform.h | |||
@@ -1,9 +1,9 @@ | |||
1 | /* vi: set sw=4 ts=4: */ | 1 | /* vi: set sw=4 ts=4: */ |
2 | /* | 2 | /* |
3 | Copyright 2006, Bernhard Reutner-Fischer | 3 | * Copyright 2006, Bernhard Reutner-Fischer |
4 | 4 | * | |
5 | Licensed under the GPL v2 or later, see the file LICENSE in this tarball. | 5 | * Licensed under the GPL v2 or later, see the file LICENSE in this tarball. |
6 | */ | 6 | */ |
7 | #ifndef BB_PLATFORM_H | 7 | #ifndef BB_PLATFORM_H |
8 | #define BB_PLATFORM_H 1 | 8 | #define BB_PLATFORM_H 1 |
9 | 9 | ||
@@ -162,9 +162,8 @@ | |||
162 | 162 | ||
163 | #if defined(__digital__) && defined(__unix__) | 163 | #if defined(__digital__) && defined(__unix__) |
164 | # include <sex.h> | 164 | # include <sex.h> |
165 | # define __BIG_ENDIAN__ (BYTE_ORDER == BIG_ENDIAN) | 165 | #elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) \ |
166 | # define __BYTE_ORDER BYTE_ORDER | 166 | || defined(__APPLE__) |
167 | #elif defined __FreeBSD__ | ||
168 | # include <sys/resource.h> /* rlimit */ | 167 | # include <sys/resource.h> /* rlimit */ |
169 | # include <machine/endian.h> | 168 | # include <machine/endian.h> |
170 | # define bswap_64 __bswap64 | 169 | # define bswap_64 __bswap64 |
@@ -178,24 +177,30 @@ | |||
178 | # define bswap_16(x) ((((x) & 0xFF00) >> 8) | (((x) & 0xFF) << 8)) | 177 | # define bswap_16(x) ((((x) & 0xFF00) >> 8) | (((x) & 0xFF) << 8)) |
179 | # define bswap_32(x) ((bswap_16(((x) & 0xFFFF0000L) >> 16)) | (bswap_16((x) & 0xFFFFL) << 16)) | 178 | # define bswap_32(x) ((bswap_16(((x) & 0xFFFF0000L) >> 16)) | (bswap_16((x) & 0xFFFFL) << 16)) |
180 | # define bswap_64(x) ((bswap_32(((x) & 0xFFFFFFFF00000000LL) >> 32)) | (bswap_32((x) & 0xFFFFFFFFLL) << 32)) | 179 | # define bswap_64(x) ((bswap_32(((x) & 0xFFFFFFFF00000000LL) >> 32)) | (bswap_32((x) & 0xFFFFFFFFLL) << 32)) |
181 | #elif !defined __APPLE__ && !defined __OpenBSD__ | 180 | #else |
182 | # include <byteswap.h> | 181 | # include <byteswap.h> |
183 | # include <endian.h> | 182 | # include <endian.h> |
184 | #endif | 183 | #endif |
185 | 184 | ||
186 | #if defined(__BIG_ENDIAN__) && __BIG_ENDIAN__ | 185 | #if defined(__BYTE_ORDER) && __BYTE_ORDER == __BIG_ENDIAN |
187 | # define BB_BIG_ENDIAN 1 | 186 | # define BB_BIG_ENDIAN 1 |
188 | # define BB_LITTLE_ENDIAN 0 | 187 | # define BB_LITTLE_ENDIAN 0 |
189 | #elif defined(__BYTE_ORDER) && __BYTE_ORDER == __BIG_ENDIAN | 188 | #elif defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN |
189 | # define BB_BIG_ENDIAN 0 | ||
190 | # define BB_LITTLE_ENDIAN 1 | ||
191 | #elif defined(_BYTE_ORDER) && _BYTE_ORDER == _BIG_ENDIAN | ||
190 | # define BB_BIG_ENDIAN 1 | 192 | # define BB_BIG_ENDIAN 1 |
191 | # define BB_LITTLE_ENDIAN 0 | 193 | # define BB_LITTLE_ENDIAN 0 |
192 | #elif defined(_BYTE_ORDER) && _BYTE_ORDER == _BIG_ENDIAN | 194 | #elif defined(_BYTE_ORDER) && _BYTE_ORDER == _LITTLE_ENDIAN |
195 | # define BB_BIG_ENDIAN 0 | ||
196 | # define BB_LITTLE_ENDIAN 1 | ||
197 | #elif defined(BYTE_ORDER) && BYTE_ORDER == BIG_ENDIAN | ||
193 | # define BB_BIG_ENDIAN 1 | 198 | # define BB_BIG_ENDIAN 1 |
194 | # define BB_LITTLE_ENDIAN 0 | 199 | # define BB_LITTLE_ENDIAN 0 |
195 | #elif (defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN) || defined(__386__) | 200 | #elif defined(BYTE_ORDER) && BYTE_ORDER == LITTLE_ENDIAN |
196 | # define BB_BIG_ENDIAN 0 | 201 | # define BB_BIG_ENDIAN 0 |
197 | # define BB_LITTLE_ENDIAN 1 | 202 | # define BB_LITTLE_ENDIAN 1 |
198 | #elif defined(_BYTE_ORDER) && _BYTE_ORDER == _LITTLE_ENDIAN | 203 | #elif defined(__386__) |
199 | # define BB_BIG_ENDIAN 0 | 204 | # define BB_BIG_ENDIAN 0 |
200 | # define BB_LITTLE_ENDIAN 1 | 205 | # define BB_LITTLE_ENDIAN 1 |
201 | #else | 206 | #else |
@@ -253,7 +258,8 @@ typedef uint32_t bb__aliased_uint32_t FIX_ALIASING; | |||
253 | /* ---- Compiler dependent settings ------------------------- */ | 258 | /* ---- Compiler dependent settings ------------------------- */ |
254 | 259 | ||
255 | #if (defined __digital__ && defined __unix__) \ | 260 | #if (defined __digital__ && defined __unix__) \ |
256 | || defined __APPLE__ || defined __FreeBSD__ || defined __OpenBSD__ \ | 261 | || defined __APPLE__ \ |
262 | || defined __FreeBSD__ || defined __OpenBSD__ || defined __NetBSD__ \ | ||
257 | || ENABLE_PLATFORM_MINGW32 | 263 | || ENABLE_PLATFORM_MINGW32 |
258 | # undef HAVE_MNTENT_H | 264 | # undef HAVE_MNTENT_H |
259 | # undef HAVE_SYS_STATFS_H | 265 | # undef HAVE_SYS_STATFS_H |