[FFmpeg-devel] [PATCH]Simplify #if defined(__GCC__) && ...

Michael Niedermayer michaelni
Mon Dec 22 13:22:08 CET 2008


On Mon, Dec 22, 2008 at 08:30:02AM +0100, Benoit Fouet wrote:
> On 12/20/2008 06:00 PM, Michael Niedermayer wrote:
> > On Fri, Dec 19, 2008 at 08:35:43PM +0100, Carl Eugen Hoyos wrote:
> >   
> >> Hi!
> >>
> >> Attached patch should simplify the #if GCC_VERSION> condition that occurs 
> >> several times in libavutil.
> >>     
> > [...]
> >   
> >> Index: libavutil/common.h
> >> ===================================================================
> >> --- libavutil/common.h	(revision 16223)
> >> +++ libavutil/common.h	(working copy)
> >> @@ -41,8 +41,10 @@
> >>  #    include <math.h>
> >>  #endif /* HAVE_AV_CONFIG_H */
> >>  
> >> +#define AV_GCC_VERSION_GREATER(x,y) (defined(__GNUC__) && (__GNUC__ > x || __GNUC__ == x && __GNUC_MINOR__ > y))
> >> +
> >>     
> >
> > i just wanted to say looks ok but then i realized that a
> >
> > AV_GCC_VERSION_AT_LEAST() would be more natural as it would contain the
> > version of the first gcc that supported something not the last that did
> > not
> >
> >   
> 
> well... it is the number of the last revision that does not support the
> feature, no ?
> we check for the minor to be strictly greater than the one which is
> specified as an argument to the macro...
> (not that I care much about the name, though)

to me it feels more natural to list the first version that does support it.
I mean if you look in some manual or press release or anything, they always
list the first version that supports something not the last that did not.
As a sideeffect it also makes it easier to use as one doesnt have to
subtract 1 from what is listed somewhere in a manual to add a AV_GCC...

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

There will always be a question for which you do not know the correct awnser.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20081222/d825aa77/attachment.pgp>



More information about the ffmpeg-devel mailing list