From f2541bb90af059680aa7036f315f052175999355 Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Wed, 8 Apr 2015 03:09:47 +0000 Subject: Imported from /home/lorry/working-area/delta_boost-tarball/boost_1_58_0.tar.bz2. --- tools/build/src/engine/function.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'tools/build/src/engine/function.c') diff --git a/tools/build/src/engine/function.c b/tools/build/src/engine/function.c index 690855e14..d9ad754e4 100644 --- a/tools/build/src/engine/function.c +++ b/tools/build/src/engine/function.c @@ -228,9 +228,18 @@ STACK * stack_global() return &result; } +struct list_alignment_helper +{ + char ch; + LIST * l; +}; + +#define LISTPTR_ALIGN_BASE ( sizeof( struct list_alignment_helper ) - sizeof( LIST * ) ) +#define LISTPTR_ALIGN ( ( LISTPTR_ALIGN_BASE > sizeof( LIST * ) ) ? sizeof( LIST * ) : LISTPTR_ALIGN_BASE ) + static void check_alignment( STACK * s ) { - assert( (size_t)s->data % sizeof( LIST * ) == 0 ); + assert( (size_t)s->data % LISTPTR_ALIGN == 0 ); } void * stack_allocate( STACK * s, int size ) -- cgit v1.2.1