aboutsummaryrefslogtreecommitdiff
path: root/include/platform.h
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2013-03-12 11:13:22 -0400
committerMike Frysinger <vapier@gentoo.org>2013-03-12 11:13:22 -0400
commit445e7543e80d629173d96a77fbfe228fe795cb88 (patch)
tree8cff682c57f9767dd77bcca26f48a750be99bb2a /include/platform.h
parentbca5c556c43ced7b368fdd90a24e4aecf40045ac (diff)
downloadbusybox-445e7543e80d629173d96a77fbfe228fe795cb88.tar.gz
platform: use KERNEL_VERSION to simplify uClibc version checking
This makes reading the logic (as well as adding new code) a lot simpler, and fixes one or two cases that were broken due to incorrect sub-version tests. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'include/platform.h')
-rw-r--r--include/platform.h20
1 files changed, 11 insertions, 9 deletions
diff --git a/include/platform.h b/include/platform.h
index f4deb30c0..917d87dd6 100644
--- a/include/platform.h
+++ b/include/platform.h
@@ -263,6 +263,12 @@ typedef unsigned smalluint;
#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
+#ifdef __UCLIBC__
+# define UCLIBC_VERSION KERNEL_VERSION(__UCLIBC_MAJOR__, __UCLIBC_MINOR__, __UCLIBC_SUBLEVEL__)
+#else
+# define UCLIBC_VERSION 0
+#endif
+
/* ---- Miscellaneous --------------------------------------- */
@@ -305,8 +311,9 @@ typedef unsigned smalluint;
* for a mmu-less system.
*/
#if ENABLE_NOMMU || \
- (defined __UCLIBC__ && __UCLIBC_MAJOR__ >= 0 && __UCLIBC_MINOR__ >= 9 && \
- __UCLIBC_SUBLEVEL__ > 28 && !defined __ARCH_USE_MMU__)
+ (defined __UCLIBC__ && \
+ UCLIBC_VERSION > KERNEL_VERSION(0, 9, 28) && \
+ !defined __ARCH_USE_MMU__)
# define BB_MMU 0
# define USE_FOR_NOMMU(...) __VA_ARGS__
# define USE_FOR_MMU(...)
@@ -373,13 +380,8 @@ typedef unsigned smalluint;
#define HAVE_NET_ETHERNET_H 1
#define HAVE_SYS_STATFS_H 1
-#if defined(__UCLIBC_MAJOR__)
-# if __UCLIBC_MAJOR__ == 0 \
- && ( __UCLIBC_MINOR__ < 9 \
- || (__UCLIBC_MINOR__ == 9 && __UCLIBC_SUBLEVEL__ < 32) \
- )
-# undef HAVE_STRVERSCMP
-# endif
+#if defined(__UCLIBC__) && UCLIBC_VERSION < KERNEL_VERSION(0, 9, 32)
+# undef HAVE_STRVERSCMP
#endif
#if defined(__dietlibc__)