[FFmpeg-devel] [PATCH] djgpp port

Michael Niedermayer michaelni
Mon Dec 24 04:21:50 CET 2007


On Mon, Dec 24, 2007 at 02:07:13AM +0300, Michael Kostylev wrote:
> 
> At Sun, 23 Dec 2007 22:48:34 +0100,
> Diego Biurrun wrote:
> 
>  >> --- ffmpeg-export-2007-12-23/libavformat/os_support.c        2007-12-09 17:39:01.000000000 +0300
>  >> +++ ffmpeg-export-2007-12-23_djgpp/libavformat/os_support.c        2007-12-23 12:27:37.000000000 +0300
>  >> @@ -30,9 +30,11 @@
>  >>  #ifdef HAVE_WINSOCK2_H
>  >>  #include <winsock2.h>
>  >>  #else
>  >> +#ifndef __DJGPP__
>  >>  #include <sys/select.h>
>  >>  #endif
>  >>  #endif
>  >> +#endif
>  > This would need to be done with a proper check in configure and
>  > HAVE_SYS_SELECT_H instead.
> 
> Redone.
> 
> Michael
> 

[...]

> diff -ur ffmpeg-export-2007-12-23/libavformat/os_support.h ffmpeg-export-2007-12-23_djgpp/libavformat/os_support.h
> --- ffmpeg-export-2007-12-23/libavformat/os_support.h	2007-11-27 14:27:50.000000000 +0300
> +++ ffmpeg-export-2007-12-23_djgpp/libavformat/os_support.h	2007-12-23 12:27:37.000000000 +0300
> @@ -27,7 +27,7 @@
>   * miscellaneous OS support macros and functions.
>   */
>  
> -#if defined(__BEOS__) || defined(__INNOTEK_LIBC__)
> +#if defined(__BEOS__) || defined(__INNOTEK_LIBC__) || defined(__DJGPP__)
>  typedef int socklen_t;
>  #endif
>  

ugly but thats not the fault of your patch, so that hunk is ok


> diff -ur ffmpeg-export-2007-12-23/libavutil/internal.h ffmpeg-export-2007-12-23_djgpp/libavutil/internal.h
> --- ffmpeg-export-2007-12-23/libavutil/internal.h	2007-11-19 13:40:11.000000000 +0300
> +++ ffmpeg-export-2007-12-23_djgpp/libavutil/internal.h	2007-12-24 00:08:32.000000000 +0300
> @@ -118,7 +118,7 @@
>  #endif
>  
>  // Use rip-relative addressing if compiling PIC code on x86-64.
> -#if defined(__MINGW32__) || defined(__CYGWIN__) || \
> +#if defined(__MINGW32__) || defined(__CYGWIN__) || defined(__DJGPP__) || \
>      defined(__OS2__) || (defined (__OpenBSD__) && !defined(__ELF__))
>  #    if defined(ARCH_X86_64) && defined(PIC)
>  #        define MANGLE(a) "_" #a"(%%rip)"

this too


> @@ -276,8 +276,29 @@
>  /* btw, rintf() is existing on fbsd too -- alex */
>  static av_always_inline long int lrintf(float x)
>  {
> -    return (int)(rint(x));
> +    return (long int)(rint(x));
>  }
>  #endif /* HAVE_LRINTF */
>  

this looks like a unrelated bugfix -> seperate patch


> +#ifdef __DJGPP__
> +static av_always_inline long int lrint(double x)
> +{
> +    return (long int)(rint(x));
> +}
> +
> +static av_always_inline long long llrint(double x)
> +{
> +    return (long long)(rint(x));
> +}
> +
> +static av_always_inline float roundf(float x)
> +{
> +    return floorf(x + 0.5);
> +}
> +static av_always_inline double round(double x)
> +{
> +    return floor(x + 0.5);
> +}
> +#endif /* __DJGPP__ */
> +

this stuff is not ok, the reason is that you add more ugly and fragile 
ifdeffery (which will break for example if a futue version of DJGPP adds these
functions ...)
each of these should be checked for by configure ...
also the implementation of round* is wrong

also did you or anyone else report these missing function to the djgpp
maintainer/developers/whatever? it would be much better if these would
be added to djgpp instead of every program which wants to be compileable
under djgpp

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

If a bugfix only changes things apparently unrelated to the bug with no
further explanation, that is a good sign that the bugfix is wrong.
-------------- 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/20071224/c2a693bb/attachment.pgp>



More information about the ffmpeg-devel mailing list