[FFmpeg-devel] [PATCH]Simplify #if defined(__GCC__) && ...
Benoit Fouet
benoit.fouet
Mon Dec 22 13:37:04 CET 2008
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 ?
(once again, I am just wondering, this is not really important)
Ben
More information about the ffmpeg-devel
mailing list