[Ffmpeg-devel] No llrint() in Cygwin

Måns Rullgård mru
Tue Sep 26 14:05:03 CEST 2006


V?ctor Paesa said:
> Hi,
>>
>> SVN r6290 brought llrint(), but that function is not defined in Cygwin
>> (because it uses newlib for math.h).
>>
>> I found this LGPL code that defines llrint() as inline for x86:
>>
>> http://sourceware.org/ml/cygwin/2002-12/msg01146/mathinline.h
>>
>> Would it be acceptable to copy that llrint() implementation
>> into libavcodec/i386/mathops.h ?
>>
>
> Maybe this patch will ignite some comments:
>
> ===================================================================
> --- ffmpeg/libavcodec/i386/mathops.h    (revision 6329)
> +++ ffmpeg/libavcodec/i386/mathops.h    (working copy)
> @@ -37,3 +37,16 @@
>       asm ("imull %2\n\t" : "=A"(rt) : "a" (ra), "g" (rb));\
>       rt; })
>
> +#ifndef llrint
> +#define __llrint_code \
> +    long long int __llrintres;\
> +    __asm__ \
> +    ("fistpll %0" \
> +    : "=m" (__llrintres) : "t" (__x) : "st"); \
> +    return __llrintres
> +
> +__inline long long int llrint (double __x)
> +{
> +    __llrint_code;
> +}
> +#endif

Identifiers starting with __ are reserved for the system.
What's the purpose of the macro?

-- 
M?ns Rullg?rd
mru at inprovide.com




More information about the ffmpeg-devel mailing list