From: Pavel Charvat Date: Thu, 24 Oct 2013 13:47:49 +0000 (+0200) Subject: LibUCW: Fixed broken DARY_ALLOC() on 64bit architectures. X-Git-Tag: v5.99~69 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=5959916922193dea72ec0f74fa0a5211ca68f9c4;p=libucw.git LibUCW: Fixed broken DARY_ALLOC() on 64bit architectures. --- 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 /***