[FFmpeg-devel] [PATCH] Remove MinGW lrintf hack

Måns Rullgård mans
Wed Jul 11 02:48:17 CEST 2007


Ramiro Polla <ramiro at lisha.ufsc.br> writes:

> Hello,
>
> r1519 added an lrintf() hack for MinGW. The log message says:
> win32: rint() does not seem to be defined with mingw32-gcc 2.95 - do
> you have a better solution ?
>
> Well, I didn't check when it was added, but the latest version of
> MinGW does implement a hack for lrintf(). So, there's no need of
> duplicating this hack in FFmpeg.
>
> Ramiro Polla
> Index: libavutil/internal.h
> ===================================================================
> --- libavutil/internal.h	(revis_o 9587)
> +++ libavutil/internal.h	(c?pia de trabalho)
> @@ -270,21 +270,7 @@
>  /* btw, rintf() is existing on fbsd too -- alex */
>  static av_always_inline long int lrintf(float x)
>  {
> -#ifdef __MINGW32__
> -#  ifdef ARCH_X86_32
> -    int32_t i;
> -    asm volatile(
> -        "fistpl %0\n\t"
> -        : "=m" (i) : "t" (x) : "st"
> -    );
> -    return i;
> -#  else
> -    /* XXX: incorrect, but make it compile */
> -    return (int)(x + (x < 0 ? -0.5 : 0.5));
> -#  endif /* ARCH_X86_32 */
> -#else
>      return (int)(rint(x));
> -#endif /* __MINGW32__ */
>  }
>  #endif /* HAVE_LRINTF */

If you say so...

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




More information about the ffmpeg-devel mailing list