From 1f868bd64e87d7a203fd357c686f4d25a6d3c283 Mon Sep 17 00:00:00 2001 From: Ralf Corsepius Date: Sat, 29 May 2010 05:17:11 +0000 Subject: =?UTF-8?q?2010-05-29=09Ralf=20Cors=C3=A9pius=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR 1531/newlib: * libmisc/shell/fts.c: Add local copy of ALIGN(). --- cpukit/ChangeLog | 6 ++++++ cpukit/libmisc/shell/fts.c | 7 +++++-- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'cpukit') diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index 807737aabf..4b31b254e9 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,3 +1,9 @@ +2010-05-29 Ralf Corsépius + + PR 1531/newlib: + * libmisc/shell/fts.c: + Add local copy of ALIGN(). + 2010-05-29 Ralf Corsépius * libnetworking/net/if.c: diff --git a/cpukit/libmisc/shell/fts.c b/cpukit/libmisc/shell/fts.c index 63d4eef393..2fd91b874c 100644 --- a/cpukit/libmisc/shell/fts.c +++ b/cpukit/libmisc/shell/fts.c @@ -87,6 +87,10 @@ static int fts_safe_changedir(const FTS *, const FTSENT *, int, #if defined(ALIGNBYTES) && defined(ALIGN) #define FTS_ALLOC_ALIGNED 1 +/* FIXME: Redefine because some versions of + * RTEMS newlib and the BSDs ship a broken ALIGN */ +#undef ALIGN +#define ALIGN(p) (((uintptr_t)(p) + ALIGNBYTES) & ~ALIGNBYTES) #else #undef FTS_ALLOC_ALIGNED #endif @@ -1055,8 +1059,7 @@ fts_alloc(FTS *sp, const char *name, size_t namelen) return (NULL); if (!ISSET(FTS_NOSTAT)) - p->fts_statp = (__fts_stat_t *)ALIGN( - (uintptr_t)(p->fts_name + namelen + 2)); + p->fts_statp = (__fts_stat_t *)ALIGN(p->fts_name + namelen + 2); #else if ((p = malloc(sizeof(FTSENT) + namelen)) == NULL) return (NULL); -- cgit v1.2.3