summaryrefslogtreecommitdiff
path: root/alsamixer
diff options
context:
space:
mode:
authorPeter Korsgaard <jacmet@sunsite.dk>2011-03-14 09:48:13 +0100
committerJaroslav Kysela <perex@perex.cz>2011-03-14 10:31:34 +0100
commita7bd33957e099dea109e219a348b131c7186ee1e (patch)
treedbc12d60881be41de4def81438aff5b623285544 /alsamixer
parent3801e25964070390c525b9f2c39913e6ea1eb864 (diff)
downloadalsa-utils-a7bd33957e099dea109e219a348b131c7186ee1e.tar.gz
alsamixer: fix build on uClibc
exp10 is a glibc extension, which isn't supported on uClibc. Luckily, exp10() is trivial to compute based on exp(), so add a wrapper for the uClibc case. Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'alsamixer')
-rw-r--r--alsamixer/volume_mapping.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/alsamixer/volume_mapping.c b/alsamixer/volume_mapping.c
index 9cacad8..1c0d7c4 100644
--- a/alsamixer/volume_mapping.c
+++ b/alsamixer/volume_mapping.c
@@ -37,6 +37,11 @@
#include <stdbool.h>
#include "volume_mapping.h"
+#ifdef __UCLIBC__
+/* 10^x = 10^(log e^x) = (e^x)^log10 = e^(x * log 10) */
+#define exp10(x) (exp((x) * log(10)))
+#endif /* __UCLIBC__ */
+
#define MAX_LINEAR_DB_SCALE 24
static inline bool use_linear_dB_scale(long dBmin, long dBmax)