summaryrefslogtreecommitdiff
path: root/tools/build/src/engine/function.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/build/src/engine/function.c')
-rw-r--r--tools/build/src/engine/function.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/tools/build/src/engine/function.c b/tools/build/src/engine/function.c
index 690855e14c..d9ad754e43 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 )