From patchwork Wed Jan 16 01:35:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: makepost@firemail.cc X-Patchwork-Id: 10765311 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 792A613A4 for ; Wed, 16 Jan 2019 01:35:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 61ED42C96D for ; Wed, 16 Jan 2019 01:35:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4F84C2CB3C; Wed, 16 Jan 2019 01:35:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0B89C2C96D for ; Wed, 16 Jan 2019 01:35:47 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 9901F266A73; Wed, 16 Jan 2019 02:35:45 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 18D9126699F; Wed, 16 Jan 2019 02:35:43 +0100 (CET) Received: from cock.li (cock.li [185.100.85.212]) by alsa0.perex.cz (Postfix) with ESMTP id F3A5926687D; Wed, 16 Jan 2019 02:35:35 +0100 (CET) MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=firemail.cc; s=mail; t=1547602534; bh=fN4mkG63D8Q10mCSCz9UuAlvAHrPqnX4tavcf9nIisM=; h=Date:From:To:Cc:Subject:From; b=myP3JgauXPd/afkGwN3JM4dRFjKpTtwVm2rvbyWsoqrSgtvTbAp2pj0Jrz6uyzMig /nCVphP/VuRcOEE3HFBjIuqQ375ybFgCEVAzVqxFF3vibt78GCjsBxNlMcAuFoktL3 A7Jj88Rl5iomWga6XZk8thv7R8CMJTPoObzamhWAmQZnLKfUSlwGEmScVZmVPkColU s6usjCr+ps0oCwUzdTG9xCafmgi2w5wZuTz32N60MTLABGM09SgiKWk5hHHPdWtpVh 1Atd8VW59yuYGc+tVw8X/4j8tY5H8+zodSpJhpW68V0Xqlt8ED1YJebBebGAyn7H4k oT2rASxT/Ml4A== Date: Wed, 16 Jan 2019 03:35:33 +0200 From: makepost@firemail.cc To: patch@alsa-project.org Message-ID: X-Sender: makepost@firemail.cc User-Agent: Roundcube Webmail/1.3.6 Cc: alsa-devel@alsa-project.org Subject: [alsa-devel] [PATCH] alsamixer: define _GNU_SOURCE to get exp10 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP 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 diff --git a/alsamixer/volume_mapping.c b/alsamixer/volume_mapping.c index 94bd0fe..48cfbe2 100644 --- a/alsamixer/volume_mapping.c +++ b/alsamixer/volume_mapping.c @@ -36,11 +36,6 @@ #include #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) diff --git a/configure.ac b/configure.ac index 7938996..0d54942 100644 --- a/configure.ac +++ b/configure.ac @@ -350,6 +350,8 @@ if test x$alsamixer = xtrue; then AC_MSG_RESULT([$CURSESLIB]) + + CFLAGS="$CFLAGS -D_GNU_SOURCE" AC_SUBST(CURSESINC)