[vlc-devel] [PATCH 3/6] configure: use attributes.m4 to check for attribute packed

Rémi Denis-Courmont remi at remlab.net
Sun Feb 26 20:48:04 CET 2017


Le sunnuntaina 26. helmikuuta 2017, 20.13.13 EET Filip Roséen a écrit :
> ---
>  configure.ac | 11 +----------
>  1 file changed, 1 insertion(+), 10 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index c2af1bd93e..fee531f6dd 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -1106,6 +1106,7 @@ AM_ATTRIBUTE_FN_COND_DEFINE([unused],
> [HAVE_ATTRIBUTE_UNUSED]) AM_ATTRIBUTE_FN_COND_DEFINE([error("")],
> [HAVE_ATTRIBUTE_ERROR])
>  AM_ATTRIBUTE_FN_COND_DEFINE([warning("")], [HAVE_ATTRIBUTE_WARNING])
>  AM_ATTRIBUTE_FN_COND_DEFINE([noinline], [HAVE_ATTRIBUTE_NOINLINE])
> +AM_ATTRIBUTE_STRUCT_COND_DEFINE([packed], [HAVE_ATTRIBUTE_PACKED])
> 
>  dnl Checks for __attribute__(aligned()) directive
>  VLC_SAVE_FLAGS
> @@ -1124,16 +1125,6 @@ if test "${ac_cv_c_attribute_aligned}" != "0"; then
>          [${ac_cv_c_attribute_aligned}],[Maximum supported data alignment])
>  fi
> 
> -dnl Check for __attribute__((packed))
> -AC_CACHE_CHECK([for __attribute__((packed))],
> -  [ac_cv_c_attribute_packed],
> -  [ac_cv_c_attribute_packed=no
> -   AC_TRY_COMPILE(, [struct __attribute__((__packed__)) foo { int a; } b;
> (void)b;], -                    [ac_cv_c_attribute_packed=yes])])
> -if test "${ac_cv_c_attribute_packed}" != "no"; then
> -  AC_DEFINE(HAVE_ATTRIBUTE_PACKED, 1, Support for __attribute__((packed))
> for structs) -fi
> -

That (existing code) was, err, hypocritical.

It is fine in the case that packing is just an optimization. Timeshifting is 
the only case I remember.

But we should stop pretending that it is optional where it is required for 
proper run-time function - vlc_codecs.h, DMO, fixed-point WMA, Matroska and 
V4L2 - if not for succesful compilation.

-- 
雷米‧德尼-库尔蒙
https://www.remlab.net/



More information about the vlc-devel mailing list