[FFmpeg-devel] [PATCH] Fix for broken build

Måns Rullgård mans
Sun Jan 25 19:54:45 CET 2009


Diego Biurrun <diego at biurrun.de> writes:

> On Sun, Jan 25, 2009 at 12:29:45AM +0100, Aurelien Jacobs wrote:
>> On Sat, 24 Jan 2009 14:09:48 -0800
>> Art Clarke <aclarke at xuggle.com> wrote:
>> 
>> > On Sat, Jan 24, 2009 at 2:04 PM, Ronald S. Bultje <rsbultje at gmail.com> wrote:
>> > >
>> > > On Sat, Jan 24, 2009 at 4:50 PM, Art Clarke <aclarke at xuggle.com> wrote:
>> > >> On Sat, Jan 24, 2009 at 11:39 AM, Art Clarke <aclarke at xuggle.com> wrote:
>> > >>> 2) change the configure script to install config.h by default (a bad
>> > >>> idea I think, but I'm not sure).
>> > >> and no I know why a bad idea; because other (admittedly stupid)
>> > >> programs might install a /usr/local/config.h and either override
>> > >> libav's, or ffmpeg would override someone elses.
>> > >
>> > > It's also a packaging problem. The build and install/run host might
>> > > not be the same, and thus their config.h might (have to) differ.
>> > 
>> > Agreed.  So that leaves two proposed solutions:
>> > 1) the patch I added which removes the unneeded include of config.h in mem.h
>> 
>> For this to be acceptable you also need to remove the following code:
>> 
>> #elif HAVE_INLINE_ASM
>>     #error The asm code needs alignment, ...
>> 
>> because that's what actually require config.h.
>> If removing this code is not acceptable, the only alternative seems
>> to be to move the whole DECLARE_ALIGNED() and DECLARE_ASM_CONST()
>> to a non-installed header.
>
> Here is a patch to move those macros to internal.h.
>
> Diego
>
> Index: libavutil/internal.h
> ===================================================================
> --- libavutil/internal.h	(revision 16775)
> +++ libavutil/internal.h	(working copy)
> @@ -311,4 +311,21 @@
>  #   define NULL_IF_CONFIG_SMALL(x) x
>  #endif
>  
> +
> +#if defined(__ICC) || defined(__SUNPRO_C)
> +    #define DECLARE_ALIGNED(n,t,v)      t v __attribute__ ((aligned (n)))
> +    #define DECLARE_ASM_CONST(n,t,v)    const t __attribute__ ((aligned (n))) v
> +#elif defined(__GNUC__)
> +    #define DECLARE_ALIGNED(n,t,v)      t v __attribute__ ((aligned (n)))
> +    #define DECLARE_ASM_CONST(n,t,v)    static const t v attribute_used __attribute__ ((aligned (n)))
> +#elif defined(_MSC_VER)
> +    #define DECLARE_ALIGNED(n,t,v)      __declspec(align(n)) t v
> +    #define DECLARE_ASM_CONST(n,t,v)    __declspec(align(n)) static const t v

If we're moving them there, we should drop the _MSC_VER case since
that compiler will never see this.

-- 
M?ns Rullg?rd
mans at mansr.com




More information about the ffmpeg-devel mailing list