diff options
Diffstat (limited to 'include/platform.h')
-rw-r--r-- | include/platform.h | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/include/platform.h b/include/platform.h index b3eee55ee..fa4267b4b 100644 --- a/include/platform.h +++ b/include/platform.h | |||
@@ -245,7 +245,7 @@ typedef uint32_t bb__aliased_uint32_t FIX_ALIASING; | |||
245 | # define move_from_unaligned32(v, u32p) (memcpy(&(v), (u32p), 4)) | 245 | # define move_from_unaligned32(v, u32p) (memcpy(&(v), (u32p), 4)) |
246 | # define move_to_unaligned16(u16p, v) do { \ | 246 | # define move_to_unaligned16(u16p, v) do { \ |
247 | uint16_t __t = (v); \ | 247 | uint16_t __t = (v); \ |
248 | memcpy((u16p), &__t, 4); \ | 248 | memcpy((u16p), &__t, 2); \ |
249 | } while (0) | 249 | } while (0) |
250 | # define move_to_unaligned32(u32p, v) do { \ | 250 | # define move_to_unaligned32(u32p, v) do { \ |
251 | uint32_t __t = (v); \ | 251 | uint32_t __t = (v); \ |
@@ -280,6 +280,12 @@ typedef unsigned smalluint; | |||
280 | 280 | ||
281 | #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) | 281 | #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) |
282 | 282 | ||
283 | #ifdef __UCLIBC__ | ||
284 | # define UCLIBC_VERSION KERNEL_VERSION(__UCLIBC_MAJOR__, __UCLIBC_MINOR__, __UCLIBC_SUBLEVEL__) | ||
285 | #else | ||
286 | # define UCLIBC_VERSION 0 | ||
287 | #endif | ||
288 | |||
283 | 289 | ||
284 | /* ---- Miscellaneous --------------------------------------- */ | 290 | /* ---- Miscellaneous --------------------------------------- */ |
285 | 291 | ||
@@ -322,8 +328,9 @@ typedef unsigned smalluint; | |||
322 | * for a mmu-less system. | 328 | * for a mmu-less system. |
323 | */ | 329 | */ |
324 | #if ENABLE_NOMMU || \ | 330 | #if ENABLE_NOMMU || \ |
325 | (defined __UCLIBC__ && __UCLIBC_MAJOR__ >= 0 && __UCLIBC_MINOR__ >= 9 && \ | 331 | (defined __UCLIBC__ && \ |
326 | __UCLIBC_SUBLEVEL__ > 28 && !defined __ARCH_USE_MMU__) | 332 | UCLIBC_VERSION > KERNEL_VERSION(0, 9, 28) && \ |
333 | !defined __ARCH_USE_MMU__) | ||
327 | # define BB_MMU 0 | 334 | # define BB_MMU 0 |
328 | # define USE_FOR_NOMMU(...) __VA_ARGS__ | 335 | # define USE_FOR_NOMMU(...) __VA_ARGS__ |
329 | # define USE_FOR_MMU(...) | 336 | # define USE_FOR_MMU(...) |
@@ -390,13 +397,8 @@ typedef unsigned smalluint; | |||
390 | #define HAVE_NET_ETHERNET_H 1 | 397 | #define HAVE_NET_ETHERNET_H 1 |
391 | #define HAVE_SYS_STATFS_H 1 | 398 | #define HAVE_SYS_STATFS_H 1 |
392 | 399 | ||
393 | #if defined(__UCLIBC_MAJOR__) | 400 | #if defined(__UCLIBC__) && UCLIBC_VERSION < KERNEL_VERSION(0, 9, 32) |
394 | # if __UCLIBC_MAJOR__ == 0 \ | 401 | # undef HAVE_STRVERSCMP |
395 | && ( __UCLIBC_MINOR__ < 9 \ | ||
396 | || (__UCLIBC_MINOR__ == 9 && __UCLIBC_SUBLEVEL__ < 32) \ | ||
397 | ) | ||
398 | # undef HAVE_STRVERSCMP | ||
399 | # endif | ||
400 | #endif | 402 | #endif |
401 | 403 | ||
402 | #if defined(__dietlibc__) | 404 | #if defined(__dietlibc__) |