alsa-utils-exp10-workaround.patch 993 B

123456789101112131415161718192021222324252627282930313233
  1. From da14c5ab2a6e030c5c56c979b8eb3ca071890876 Mon Sep 17 00:00:00 2001
  2. From: Peter Korsgaard <jacmet@sunsite.dk>
  3. Date: Mon, 14 Mar 2011 09:19:18 +0100
  4. Subject: [PATCH] alsamixer: fix build on uClibc
  5. exp10 is a glibc extension, which isn't supported on uClibc. Luckily,
  6. exp10() is trivial to compute based on exp(), so add a wrapper for
  7. the uClibc case.
  8. Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
  9. ---
  10. alsamixer/volume_mapping.c | 5 +++++
  11. 1 files changed, 5 insertions(+), 0 deletions(-)
  12. diff --git a/alsamixer/volume_mapping.c b/alsamixer/volume_mapping.c
  13. index 9cacad8..1c0d7c4 100644
  14. --- a/alsamixer/volume_mapping.c
  15. +++ b/alsamixer/volume_mapping.c
  16. @@ -37,6 +37,11 @@
  17. #include <stdbool.h>
  18. #include "volume_mapping.h"
  19. +#ifdef __UCLIBC__
  20. +/* 10^x = 10^(log e^x) = (e^x)^log10 = e^(x * log 10) */
  21. +#define exp10(x) (exp((x) * log(10)))
  22. +#endif /* __UCLIBC__ */
  23. +
  24. #define MAX_LINEAR_DB_SCALE 24
  25. static inline bool use_linear_dB_scale(long dBmin, long dBmax)
  26. --
  27. 1.7.2.3