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

Natanael Copa ncopa at alpinelinux.org
Thu Sep 26 16:24:09 CEST 2013


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])
+])
+
 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;
-- 
1.8.4




More information about the vlc-devel mailing list