[vlc-devel] [PATCH] aout: define fminf for systems that lacks it

Rémi Denis-Courmont remi at remlab.net
Fri Sep 27 18:55:31 CEST 2013


Le jeudi 26 septembre 2013 16:24:09 Natanael Copa a écrit :
> Some systems, like uClibc, does not have fminf. We check for it in
> configure script and implement a version of it if it is missing.
> 
> Signed-off-by: Natanael Copa <ncopa at alpinelinux.org>
> ---
>  configure.ac              | 4 ++++
>  src/audio_output/volume.c | 4 ++++
>  2 files changed, 8 insertions(+)
> 
> diff --git a/configure.ac b/configure.ac
> index 417bfdb..8dd59a4 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -663,6 +663,10 @@ AC_CHECK_LIB(m,lrintf, [
>    VLC_ADD_LIBS([skins2],[-lm])
>  ])
> 
> +AC_CHECK_LIB(m,fminf, [
> +  AC_DEFINE(HAVE_FMINF, 1, [Define to 1 if you have the fminf function])
> +])
> +

Normally we use AC_REPLACE_FUNCS for missing functions (and provide the 
correct specified semantics).

Note though, VLC is extremely unlikely to compile on a freestanding 
environment. The code base pretty much assumes a hosted environment plus 
either POSIX or Win32, so you may be fighting a windmill.

>  dnl Check for dynamic plugins
>  LIBDL=""
>  have_dynamic_objects="no"
> diff --git a/src/audio_output/volume.c b/src/audio_output/volume.c
> index 57e8f33..a719c33 100644
> --- a/src/audio_output/volume.c
> +++ b/src/audio_output/volume.c
> @@ -33,6 +33,10 @@
>  #include <vlc_aout_volume.h>
>  #include "aout_internal.h"
> 
> +#if !defined(HAVE_FMINF)
> +inline float fminf(float a, float b) { return (a < b) ? a : b; }
> +#endif
> +
>  struct aout_volume
>  {
>      audio_volume_t object;
-- 
Rémi Denis-Courmont
http://www.remlab.net/




More information about the vlc-devel mailing list