[FFmpeg-devel] [PATCH] Remove useless preprocessor directives.

Loren Merritt lorenm
Fri Jun 18 20:55:20 CEST 2010

On Fri, 18 Jun 2010, M?ns Rullg?rd wrote:

> Loren Merritt <lorenm at u.washington.edu> writes:
>> On Fri, 18 Jun 2010, Michael Niedermayer wrote:
>>> On Fri, Jun 18, 2010 at 08:51:29AM +0200, Benoit Fouet wrote:
>>>> On Thu, 17 Jun 2010 21:57:09 +0200 Reimar D?ffinger wrote:
>>>>> On Thu, Jun 17, 2010 at 03:32:02PM +0200, Benoit Fouet wrote:
>>> [...]
>>>>> If you don't need/want the whole function, then put the whole function under
>>>>> the #if.
>>>> that wouldn't work either... as the code using it is in the form of:
>>>> if (HAVE_7REGS)
>>>>     foo = yuva420_rgb32_MMX;
>>>> You'll get an undeclared function error.
>>> what if you add a weak attibute at the function declaration?
>>> (should in theory work though probably its not portable enough
>>> if it does work)
>> Can't you just declare the function, no special attributes?
> Making it weak wouldn't change anything there.
>> I thought ffmpeg policy was to require dead code elimination, so that
>> functions used under if(0) need not exist.
> That still requires the function itself to be compilable.  Some errors
> occur before DCE.

Don't instantiate the function, just declare a prototype.
e.g. dsputil.c contains
   if (HAVE_MMX) dsputil_init_mmx(c, avctx);
even though on other archs that function does not exist.

--Loren Merritt

More information about the ffmpeg-devel mailing list