[FFmpeg-devel] [PATCH]Simplify #if defined(__GCC__) && ...
Michael Niedermayer
michaelni
Mon Dec 22 13:52:13 CET 2008
On Mon, Dec 22, 2008 at 01:37:04PM +0100, Benoit Fouet wrote:
> On 12/22/2008 01:22 PM, Michael Niedermayer wrote:
> > 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.
> >
>
> to me too...
>
> > 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...
> >
> >
>
> ... but when we check 'if version > XX.YY', we check for our version to
> be (strictly) above the last one that did not support the feature, or am
> I missing something ?
we are checking ver >= XX.YY
#define AV_GCC_VERSION_AT_LEAST(x,y) (defined(__GNUC__) && (__GNUC__ > x || __GNUC__ == x && __GNUC_MINOR__ >= y))
> (once again, I am just wondering, this is not really important)
if it really is buggy this of course woudl be important ...
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
The greatest way to live with honor in this world is to be what we pretend
to be. -- Socrates
-------------- 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/18fec59d/attachment.pgp>
More information about the ffmpeg-devel
mailing list