alsamixer: define _GNU_SOURCE to get exp10

Fixes Master, Headphones and Speaker stuck at -8 percentage after
building with Clang 7.0.1 and getting warned about implicit declaration
of exp10, which is behind _GNU_SOURCE as a non-standard feature. Thanks
Takashi Iwai for the CFLAGS suggestion on the mailing list. GCC build is
not affected, so not adding a compiler check to the configure script.

uClibc-ng has got exp10 since 1.0.12, so the fallback macro is no longer
needed. However, alsa-utils relies on gettext so might need further
patches to actually work on uClibc systems.

Signed-off-by: makepost <makepost@firemail.cc>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Jaroslav Kysela 2019-01-18 09:24:12 +01:00
parent e1aa6d4d55
commit 116488e5f2
2 changed files with 1 additions and 6 deletions

View file

@ -1,4 +1,4 @@
AM_CFLAGS = @CURSES_CFLAGS@ -DCURSESINC="@CURSESINC@"
AM_CFLAGS = -D_GNU_SOURCE @CURSES_CFLAGS@ -DCURSESINC="@CURSESINC@"
LDADD = @CURSESLIB@
bin_PROGRAMS = alsamixer

View file

@ -36,11 +36,6 @@
#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)