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

Måns Rullgård mans
Wed Nov 19 22:12:38 CET 2008


Andrew Savchenko <bircoph at gmail.com> writes:

> Hi,
>
> On Tuesday 18 November 2008 14:19, Reimar D?ffinger wrote:
> [...]
>> > > 3. Aside from the above, this is the wrong place to add a
>> > > missing definition of INFINITY.
>> >
>> > Why? Have you a better idea? I will be glad to hear it.
>>
>> libavutil/mathematics.h is where that other kind of stuff is.
>
> Very well, patch is moved there.
>
>> 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.

> 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 ().

-- 
M?ns Rullg?rd
mans at mansr.com




More information about the ffmpeg-devel mailing list