[FFmpeg-devel] [PATCH] Fix compilation on OpenBSD

Andrew Savchenko bircoph
Wed Nov 19 23:15:41 CET 2008


Hi,

On Thursday 20 November 2008 00:12, M?ns Rullg?rd wrote:
[...]
> >> And I always thought that the generic fallback define for
> >> INFINITY would be (1.0f/0.0f), hoping the compiler would
> >> replace it at compile time. The generic glibc code for it is
> >> really ugly and not exactly portable...
> >
> > Thank you for the idea, it seems it works OK.
> > Please review new version of the patch.
>
> I'm still against this patch in principle.  There really is no
> excuse for not supporting trivial parts of a 10-year old
> standard.

You may noticed fallback definitions in the same file for another 
mathematical constants defined in the standard you refered 
earlier. So, I hope, there is an excuse. Anyway this patch should 
harm nothing.

> > Index: libavutil/mathematics.h
> > ==============================================================
> >===== --- libavutil/mathematics.h	(revision 15884)
> > +++ libavutil/mathematics.h	(working copy)
> > @@ -40,6 +40,9 @@
> >  #ifndef M_SQRT1_2
> >  #define M_SQRT1_2      0.70710678118654752440  /* 1/sqrt(2)
> > */ #endif
> > +#ifndef INFINITY
> > +#define INFINITY       1.0f/0.0f               /* let
> > compiler to set INFINITY value */ +#endif
>
> Useless comment.  The macro replacement needs ().

Fixed. New version is attached.

-- 
Best regards,
Andrew
-------------- next part --------------
A non-text attachment was scrubbed...
Name: infinity.patch
Type: text/x-diff
Size: 430 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20081120/f1f8e22c/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20081120/f1f8e22c/attachment.pgp>



More information about the ffmpeg-devel mailing list