From 78df45e1d104be0d9a2c7784df07a4d7843e6c16 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Tue, 8 Oct 2013 15:31:44 -0700 Subject: [PATCH] Fix the ALIGN and ALIGNBYTES macros for LP64. Change-Id: I3a361255afce375ab1cefa449721f0aea4d47919 --- libc/include/sys/param.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libc/include/sys/param.h b/libc/include/sys/param.h index 0bfdc5d7b..27acd70cb 100644 --- a/libc/include/sys/param.h +++ b/libc/include/sys/param.h @@ -34,8 +34,13 @@ #define MAXPATHLEN PATH_MAX #define MAXSYMLINKS 8 -#define ALIGNBYTES 3 -#define ALIGN(p) (((unsigned int)(p) + ALIGNBYTES) &~ ALIGNBYTES) +#if __LP64__ +#define ALIGNBYTES 7 +#else +#define ALIGNBYTES 3 +#endif + +#define ALIGN(p) (((unsigned long)(p) + ALIGNBYTES) &~ ALIGNBYTES) #define powerof2(x) ((((x)-1)&(x))==0)