From 309d8c1318d7e92e6f685ad2011d73f8653dd4d1 Mon Sep 17 00:00:00 2001 From: pixel Date: Sun, 16 Jul 2006 12:24:26 +0000 Subject: Adding align --- include/generic.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/generic.h b/include/generic.h index 1633617..b8464c4 100644 --- a/include/generic.h +++ b/include/generic.h @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id: generic.h,v 1.37 2006-02-02 17:27:28 pixel Exp $ */ +/* $Id: generic.h,v 1.38 2006-07-16 12:24:26 pixel Exp $ */ #ifndef __GENERIC_H__ #define __GENERIC_H__ @@ -193,6 +193,10 @@ inline T ABS(T x) { } #endif +#ifndef align +# define align(a) (((ub4)a+(sizeof(void *)-1))&(~(sizeof(void *)-1))) +#endif + #if defined __linux__ || defined sun || defined __solaris__ || defined __CYGWIN32__ || defined __MINGW32__ || defined __APPLE__ #define FUNCNAME String(__PRETTY_FUNCTION__) #else -- cgit v1.2.3