summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cpukit/ChangeLog5
-rw-r--r--cpukit/libmisc/shell/fts.c7
2 files changed, 10 insertions, 2 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog
index f014ce59cf..04c1eccb61 100644
--- a/cpukit/ChangeLog
+++ b/cpukit/ChangeLog
@@ -1,5 +1,10 @@
2010-04-13 Ralf Corsépius <ralf.corsepius@rtems.org>
+ * libmisc/shell/fts.c (fts_pow2): Rebase fts_pow2 on
+ SIZEOF_SIZE_T * CHAR_BIT.
+
+2010-04-13 Ralf Corsépius <ralf.corsepius@rtems.org>
+
* aclocal/gcc-sanity.m4: Add RTEMS_CHECK_GCC_PRINTF_LD_OFF_T,
RTEMS_CHECK_GCC_PRINTF_LLD_OFF_T.
diff --git a/cpukit/libmisc/shell/fts.c b/cpukit/libmisc/shell/fts.c
index 2eeed2558e..e960a0ab19 100644
--- a/cpukit/libmisc/shell/fts.c
+++ b/cpukit/libmisc/shell/fts.c
@@ -49,6 +49,7 @@ __RCSID("$NetBSD: fts.c,v 1.40 2009/11/02 17:17:34 stacktic Exp $");
#ifndef __rtems__
#include "namespace.h"
#endif
+#include <limits.h>
#include <sys/param.h>
#include <sys/stat.h>
@@ -1115,11 +1116,13 @@ fts_pow2(size_t x)
x |= x>>2;
x |= x>>4;
x |= x>>8;
+#if (SIZEOF_SIZE_T * CHAR_BIT) > 16
x |= x>>16;
-#if LONG_BIT > 32
+#endif
+#if (SIZEOF_SIZE_T * CHAR_BIT) > 32
x |= x>>32;
#endif
-#if LONG_BIT > 64
+#if (SIZEOF_SIZE_T * CHAR_BIT) > 64
x |= x>>64;
#endif
x++;