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

Michael Niedermayer michaelni
Sat Dec 20 18:00:09 CET 2008


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

except that patch ok, no need to resend with this minor change, just commit

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Its not that you shouldnt use gotos but rather that you should write
readable code and code with gotos often but not always is less readable
-------------- 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/20081220/37801fed/attachment.pgp>



More information about the ffmpeg-devel mailing list