From 5959916922193dea72ec0f74fa0a5211ca68f9c4 Mon Sep 17 00:00:00 2001 From: Pavel Charvat Date: Thu, 24 Oct 2013 15:47:49 +0200 Subject: [PATCH] LibUCW: Fixed broken DARY_ALLOC() on 64bit architectures. --- ucw/conf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ucw/conf.h b/ucw/conf.h index 0ff99130..d08aa120 100644 --- a/ucw/conf.h +++ b/ucw/conf.h @@ -392,7 +392,7 @@ struct cf_section { /** A section. **/ #define CF_ANY_NUM -0x7fffffff #define DARY_LEN(a) ((uns*)a)[-1] /** Length of an dynamic array. **/ -#define DARY_ALLOC(type,len,val...) ((struct { uns l; type a[len]; }) { .l = len, .a = { val } }).a +#define DARY_ALLOC(type,len,val...) ((struct { byte pad[ALIGN_TO(sizeof(uns), CPU_STRUCT_ALIGN) - sizeof(uns)]; uns l; type a[len]; }) { .l = len, .a = { val } }).a // creates a static instance of a dynamic array /*** -- 2.39.5